From 37d12bed40edc226d96d0e1a4b28a24583ece94f Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Wed, 22 Jul 2020 11:12:16 +0200 Subject: DokkaConfiguration: Use `Set` instead of `List` when collections are expected to be distinct --- .../main/kotlin/testApi/testRunner/TestRunner.kt | 30 ++++++++++------------ 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'testApi/src') diff --git a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt index 6d80d15a..034b945f 100644 --- a/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt +++ b/testApi/src/main/kotlin/testApi/testRunner/TestRunner.kt @@ -66,14 +66,12 @@ abstract class AbstractCoreTest( outputDir = testDirPath.toFile(), sourceSets = configuration.sourceSets.map { sourceSet -> sourceSet.copy( - sourceRoots = sourceSet.sourceRoots.map { sourceRoot -> - sourceRoot.copy( - directory = testDirPath.toFile().resolve(sourceRoot.directory) - ) - }, + sourceRoots = sourceSet.sourceRoots.map { file -> + testDirPath.toFile().resolve(file) + }.toSet(), suppressedFiles = sourceSet.suppressedFiles.map { file -> testDirPath.toFile().resolve(file) - } + }.toSet() ) } ) @@ -176,8 +174,8 @@ abstract class AbstractCoreTest( outputDir = File(outputDir), cacheRoot = cacheRoot?.let(::File), offlineMode = offlineMode, - sourceSets = sourceSets, - pluginsClasspath = pluginsClasspath, + sourceSets = sourceSets.toList(), + pluginsClasspath = pluginsClasspath.toSet(), pluginsConfiguration = pluginsConfigurations, modules = emptyList(), failOnWarning = failOnWarning @@ -225,25 +223,25 @@ abstract class AbstractCoreTest( moduleDisplayName = moduleDisplayName ?: moduleName, displayName = displayName, sourceSetID = DokkaSourceSetID(moduleName, name), - classpath = classpath.map(::File), - sourceRoots = sourceRoots.map(::File).map(::SourceRootImpl), + classpath = classpath.map(::File).toSet(), + sourceRoots = sourceRoots.map(::File).toSet(), dependentSourceSets = dependentSourceSets, - samples = samples.map(::File), - includes = includes.map(::File), + samples = samples.map(::File).toSet(), + includes = includes.map(::File).toSet(), includeNonPublic = includeNonPublic, includeRootPackage = includeRootPackage, reportUndocumented = reportUndocumented, skipEmptyPackages = skipEmptyPackages, skipDeprecated = skipDeprecated, jdkVersion = jdkVersion, - sourceLinks = sourceLinks, - perPackageOptions = perPackageOptions, - externalDocumentationLinks = externalDocumentationLinks, + sourceLinks = sourceLinks.toSet(), + perPackageOptions = perPackageOptions.toList(), + externalDocumentationLinks = externalDocumentationLinks.toSet(), languageVersion = languageVersion, apiVersion = apiVersion, noStdlibLink = noStdlibLink, noJdkLink = noJdkLink, - suppressedFiles = suppressedFiles.map(::File), + suppressedFiles = suppressedFiles.map(::File).toSet(), analysisPlatform = Platform.fromString(analysisPlatform) ) } -- cgit