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 --- core/src/main/kotlin/configuration.kt | 20 ++++---- core/src/main/kotlin/defaultConfiguration.kt | 24 ++++------ core/src/main/kotlin/utilities/json.kt | 18 -------- .../kotlin/utilities/DokkaConfigurationJsonTest.kt | 10 ++-- .../gradle/projects/it-basic-groovy/build.gradle | 4 +- .../dokka/analysis/AnalysisEnvironment.kt | 2 +- .../dokka/analysis/EnvironmentAndFacade.kt | 1 - .../DefaultDescriptorToDocumentableTranslator.kt | 2 +- .../psi/DefaultPsiToDocumentableTranslator.kt | 2 +- .../test/kotlin/renderers/html/DivergentTest.kt | 4 +- .../renderers/html/HtmlRenderingOnlyTestBase.kt | 8 ++-- .../renderers/html/SourceSetDependentHintTest.kt | 8 ++-- .../src/main/kotlin/renderers/defaultSourceSet.kt | 14 +++--- .../src/test/kotlin/renderers/gfm/DivergentTest.kt | 7 ++- .../renderers/gfm/SourceSetDependentHintTest.kt | 10 ++-- .../dokka/javadoc/JavadocPackageTemplateMapTest.kt | 2 +- runners/cli/src/main/kotlin/cli/main.kt | 40 ++++++++-------- .../jetbrains/dokka/gradle/DokkaCollectorTask.kt | 2 +- .../jetbrains/dokka/gradle/DokkaMultimoduleTask.kt | 4 +- .../kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt | 2 +- .../dokka/gradle/GradleDokkaSourceSetBuilder.kt | 54 ++++++++++------------ .../dokka/gradle/GradleSourceRootBuilder.kt | 15 ------ .../jetbrains/dokka/gradle/KotlinSourceSetGist.kt | 1 + .../gradle/sourceSetKotlinGistConfiguration.kt | 7 ++- .../dokka/gradle/DokkaCollectorTaskTest.kt | 1 - .../dokka/gradle/DokkaMultiModuleTaskTest.kt | 2 +- runners/maven-plugin/src/main/kotlin/DokkaMojo.kt | 33 ++++++------- .../main/kotlin/testApi/testRunner/TestRunner.kt | 30 ++++++------ 28 files changed, 133 insertions(+), 194 deletions(-) delete mode 100644 runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceRootBuilder.kt diff --git a/core/src/main/kotlin/configuration.kt b/core/src/main/kotlin/configuration.kt index 67c55861..b26b93a4 100644 --- a/core/src/main/kotlin/configuration.kt +++ b/core/src/main/kotlin/configuration.kt @@ -79,39 +79,35 @@ interface DokkaConfiguration : Serializable { val failOnWarning: Boolean val sourceSets: List val modules: List - val pluginsClasspath: List + val pluginsClasspath: Set val pluginsConfiguration: Map interface DokkaSourceSet : Serializable { val sourceSetID: DokkaSourceSetID val displayName: String val moduleDisplayName: String - val classpath: List - val sourceRoots: List + val classpath: Set + val sourceRoots: Set val dependentSourceSets: Set - val samples: List - val includes: List + val samples: Set + val includes: Set val includeNonPublic: Boolean val includeRootPackage: Boolean val reportUndocumented: Boolean val skipEmptyPackages: Boolean val skipDeprecated: Boolean val jdkVersion: Int - val sourceLinks: List + val sourceLinks: Set val perPackageOptions: List - val externalDocumentationLinks: List + val externalDocumentationLinks: Set val languageVersion: String? val apiVersion: String? val noStdlibLink: Boolean val noJdkLink: Boolean - val suppressedFiles: List + val suppressedFiles: Set val analysisPlatform: Platform } - interface SourceRoot : Serializable { - val directory: File - } - interface SourceLinkDefinition : Serializable { val path: String val url: String diff --git a/core/src/main/kotlin/defaultConfiguration.kt b/core/src/main/kotlin/defaultConfiguration.kt index 384ce392..1b79ec61 100644 --- a/core/src/main/kotlin/defaultConfiguration.kt +++ b/core/src/main/kotlin/defaultConfiguration.kt @@ -3,15 +3,13 @@ package org.jetbrains.dokka import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet import java.io.File import java.net.URL -import kotlin.reflect.full.memberProperties -import kotlin.reflect.full.primaryConstructor data class DokkaConfigurationImpl( override val outputDir: File = DokkaDefaults.outputDir, override val cacheRoot: File? = DokkaDefaults.cacheRoot, override val offlineMode: Boolean = DokkaDefaults.offlineMode, override val sourceSets: List = emptyList(), - override val pluginsClasspath: List = emptyList(), + override val pluginsClasspath: Set = emptySet(), override val pluginsConfiguration: Map = emptyMap(), override val modules: List = emptyList(), override val failOnWarning: Boolean = DokkaDefaults.failOnWarning @@ -22,25 +20,25 @@ data class DokkaSourceSetImpl( override val moduleDisplayName: String, override val displayName: String = DokkaDefaults.sourceSetDisplayName, override val sourceSetID: DokkaSourceSetID, - override val classpath: List = emptyList(), - override val sourceRoots: List, + override val classpath: Set = emptySet(), + override val sourceRoots: Set = emptySet(), override val dependentSourceSets: Set = emptySet(), - override val samples: List = emptyList(), - override val includes: List = emptyList(), + override val samples: Set = emptySet(), + override val includes: Set = emptySet(), override val includeNonPublic: Boolean = DokkaDefaults.includeNonPublic, override val includeRootPackage: Boolean = DokkaDefaults.includeRootPackage, override val reportUndocumented: Boolean = DokkaDefaults.reportUndocumented, override val skipEmptyPackages: Boolean = DokkaDefaults.skipEmptyPackages, override val skipDeprecated: Boolean = DokkaDefaults.skipDeprecated, override val jdkVersion: Int = DokkaDefaults.jdkVersion, - override val sourceLinks: List = emptyList(), + override val sourceLinks: Set = emptySet(), override val perPackageOptions: List = emptyList(), - override var externalDocumentationLinks: List = emptyList(), + override var externalDocumentationLinks: Set = emptySet(), override val languageVersion: String? = null, override val apiVersion: String? = null, override val noStdlibLink: Boolean = DokkaDefaults.noStdlibLink, override val noJdkLink: Boolean = DokkaDefaults.noJdkLink, - override val suppressedFiles: List = emptyList(), + override val suppressedFiles: Set = emptySet(), override val analysisPlatform: Platform = DokkaDefaults.analysisPlatform ) : DokkaSourceSet @@ -50,12 +48,6 @@ data class DokkaModuleDescriptionImpl( override val docFile: File ) : DokkaConfiguration.DokkaModuleDescription -data class SourceRootImpl( - override val directory: File -) : DokkaConfiguration.SourceRoot { - constructor(directoryPath: String) : this(File(directoryPath)) -} - data class SourceLinkDefinitionImpl( override val path: String, override val url: String, diff --git a/core/src/main/kotlin/utilities/json.kt b/core/src/main/kotlin/utilities/json.kt index feac2b23..211037d6 100644 --- a/core/src/main/kotlin/utilities/json.kt +++ b/core/src/main/kotlin/utilities/json.kt @@ -1,26 +1,18 @@ package org.jetbrains.dokka.utilities import com.fasterxml.jackson.core.JsonGenerator -import com.fasterxml.jackson.core.JsonParser -import com.fasterxml.jackson.databind.DeserializationContext import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.SerializerProvider -import com.fasterxml.jackson.databind.deser.std.StdScalarDeserializer import com.fasterxml.jackson.databind.module.SimpleModule import com.fasterxml.jackson.databind.ser.std.StdScalarSerializer import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.fasterxml.jackson.module.kotlin.jacksonTypeRef -import org.jetbrains.dokka.DokkaConfiguration.SourceRoot -import org.jetbrains.dokka.SourceRootImpl import java.io.File import com.fasterxml.jackson.core.type.TypeReference as JacksonTypeReference private val objectMapper = run { val module = SimpleModule().apply { addSerializer(FileSerializer) - addSerializer(SourceRoot::class.java, SourceRootSerializer) - addDeserializer(SourceRootImpl::class.java, SourceRootImplDeserializer) - addDeserializer(SourceRoot::class.java, SourceRootImplDeserializer) } jacksonObjectMapper() .registerModule(module) @@ -53,13 +45,3 @@ private object FileSerializer : StdScalarSerializer(File::class.java) { g.writeString(value.path) } } - -private object SourceRootSerializer : StdScalarSerializer(SourceRoot::class.java) { - override fun serialize(value: SourceRoot, g: JsonGenerator, provider: SerializerProvider) { - g.writeString(value.directory.path) - } -} - -private object SourceRootImplDeserializer : StdScalarDeserializer(SourceRootImpl::class.java) { - override fun deserialize(p: JsonParser, ctxt: DeserializationContext): SourceRootImpl = SourceRootImpl(File(p.text)) -} diff --git a/core/src/test/kotlin/utilities/DokkaConfigurationJsonTest.kt b/core/src/test/kotlin/utilities/DokkaConfigurationJsonTest.kt index 35755f50..e8135f96 100644 --- a/core/src/test/kotlin/utilities/DokkaConfigurationJsonTest.kt +++ b/core/src/test/kotlin/utilities/DokkaConfigurationJsonTest.kt @@ -10,11 +10,11 @@ class DokkaConfigurationJsonTest { fun `simple configuration toJsonString then parseJson`() { val configuration = DokkaConfigurationImpl( outputDir = File("customOutputDir"), - pluginsClasspath = listOf(File("plugins/customPlugin.jar")), + pluginsClasspath = setOf(File("plugins/customPlugin.jar")), sourceSets = listOf( DokkaSourceSetImpl( moduleDisplayName = "customModuleDisplayName", - sourceRoots = listOf(SourceRootImpl(File("customSourceRoot"))), + sourceRoots = setOf(File("customSourceRoot")), sourceSetID = DokkaSourceSetID("customModuleName", "customSourceSetName") ) ) @@ -49,13 +49,13 @@ class DokkaConfigurationJsonTest { assertEquals( DokkaConfigurationImpl( outputDir = File("customOutputDir"), - pluginsClasspath = listOf(File("plugins/customPlugin.jar")), + pluginsClasspath = setOf(File("plugins/customPlugin.jar")), sourceSets = listOf( DokkaSourceSetImpl( moduleDisplayName = "customModuleDisplayName", - sourceRoots = listOf(SourceRootImpl(File("customSourceRoot"))), + sourceRoots = setOf(File("customSourceRoot")), sourceSetID = DokkaSourceSetID("customModuleName", "customSourceSetName"), - classpath = listOf(File("classpath/custom1.jar"), File("classpath/custom2.jar")) + classpath = setOf(File("classpath/custom1.jar"), File("classpath/custom2.jar")) ) ) ), diff --git a/integration-tests/gradle/projects/it-basic-groovy/build.gradle b/integration-tests/gradle/projects/it-basic-groovy/build.gradle index 405b55ed..fadf4287 100644 --- a/integration-tests/gradle/projects/it-basic-groovy/build.gradle +++ b/integration-tests/gradle/projects/it-basic-groovy/build.gradle @@ -15,8 +15,8 @@ dokkaHtml { failOnWarning = false dokkaSourceSets { customSourceSet { - sourceRoot { directory = file("src/main/java") } - sourceRoot { directory = file("src/main/kotlin") } + sourceRoot(file("src/main/java")) + sourceRoot(file("src/main/kotlin")) displayName = "custom" reportUndocumented = true } diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt index 14067f43..cb65b168 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/AnalysisEnvironment.kt @@ -540,7 +540,7 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl * Adds list of paths to source roots. * $list: collection of files to add */ - fun addSources(sourceDirectories: List) { + fun addSources(sourceDirectories: Iterable) { sourceDirectories.forEach { directory -> configuration.addKotlinSourceRoot(directory.path) if (directory.isDirectory || directory.extension == ".java") { diff --git a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt index 009bc66c..38b0b69b 100644 --- a/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt +++ b/kotlin-analysis/src/main/kotlin/org/jetbrains/dokka/analysis/EnvironmentAndFacade.kt @@ -22,7 +22,6 @@ internal fun createEnvironmentAndFacade( addSources( (sourceSet.sourceRoots + configuration.sourceSets.filter { it.sourceSetID in sourceSet.dependentSourceSets } .flatMap { it.sourceRoots }) - .map { it.directory } ) loadLanguageVersionSettings(sourceSet.languageVersion, sourceSet.apiVersion) diff --git a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt index 1ac4edf7..383a3715 100644 --- a/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/descriptors/DefaultDescriptorToDocumentableTranslator.kt @@ -95,7 +95,7 @@ private class DokkaDescriptorVisitor( private fun Collection.filterDescriptorsInSourceSet() = filter { it.toSourceElement.containingFile.toString().let { path -> path.isNotBlank() && sourceSet.sourceRoots.any { root -> - Paths.get(path).startsWith(root.directory.toPath()) + Paths.get(path).startsWith(root.toPath()) } } } diff --git a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt index cd43e635..71c19bbe 100644 --- a/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt +++ b/plugins/base/src/main/kotlin/translators/psi/DefaultPsiToDocumentableTranslator.kt @@ -44,7 +44,7 @@ class DefaultPsiToDocumentableTranslator( override fun invoke(sourceSet: DokkaSourceSet, context: DokkaContext): DModule { fun isFileInSourceRoots(file: File): Boolean { - return sourceSet.sourceRoots.any { root -> file.startsWith(root.directory) } + return sourceSet.sourceRoots.any { root -> file.startsWith(root) } } val (environment, _) = kotlinAnalysis[sourceSet] diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt index 8ab277f1..b4de5aed 100644 --- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt @@ -1,12 +1,10 @@ package renderers.html -import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentDivergentGroup import org.junit.jupiter.api.Test -import renderers.* +import renderers.TestPage import utils.Div import utils.Span import utils.match diff --git a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt index ae494929..eea4dc0c 100644 --- a/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt +++ b/plugins/base/src/test/kotlin/renderers/html/HtmlRenderingOnlyTestBase.kt @@ -2,7 +2,6 @@ package renderers.html import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.base.DokkaBase import org.jetbrains.dokka.base.renderers.DefaultTabSortingStrategy import org.jetbrains.dokka.base.renderers.RootCreator @@ -17,6 +16,7 @@ import org.jsoup.nodes.TextNode import renderers.RenderingOnlyTestBase import utils.TestOutputWriter import renderers.defaultSourceSet +import java.io.File abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase() { @@ -25,7 +25,7 @@ abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase() { "JS", defaultSourceSet.sourceSetID.copy(sourceSetName = "js"), analysisPlatform = Platform.js, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) protected val jvm = defaultSourceSet.copy( "root", @@ -33,14 +33,14 @@ abstract class HtmlRenderingOnlyTestBase : RenderingOnlyTestBase() { defaultSourceSet.sourceSetID.copy(sourceSetName = "jvm"), analysisPlatform = Platform.jvm, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) protected val native = defaultSourceSet.copy( "root", "NATIVE", defaultSourceSet.sourceSetID.copy(sourceSetName = "native"), analysisPlatform = Platform.native, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) val files = TestOutputWriter() diff --git a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt index cf7f47e6..77ba390e 100644 --- a/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/SourceSetDependentHintTest.kt @@ -1,7 +1,6 @@ package renderers.html import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.base.renderers.html.HtmlRenderer import org.jetbrains.dokka.pages.TextStyle import org.junit.jupiter.api.Test @@ -10,6 +9,7 @@ import renderers.defaultSourceSet import renderers.RenderingOnlyTestBase import utils.Div import utils.match +import java.io.File class SourceSetDependentHintTest : HtmlRenderingOnlyTestBase() { @@ -18,21 +18,21 @@ class SourceSetDependentHintTest : HtmlRenderingOnlyTestBase() { "pl1", defaultSourceSet.sourceSetID.copy(sourceSetName = "pl1"), analysisPlatform = Platform.js, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val pl2 = defaultSourceSet.copy( "root", "pl2", defaultSourceSet.sourceSetID.copy(sourceSetName = "pl2"), analysisPlatform = Platform.jvm, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val pl3 = defaultSourceSet.copy( "root", "pl3", defaultSourceSet.sourceSetID.copy(sourceSetName = "pl3"), analysisPlatform = Platform.native, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) @Test diff --git a/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt b/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt index 7358d2c2..8d19870c 100644 --- a/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt +++ b/plugins/base/test-utils/src/main/kotlin/renderers/defaultSourceSet.kt @@ -8,24 +8,24 @@ val defaultSourceSet = DokkaSourceSetImpl( moduleDisplayName = "DEFAULT", displayName = "DEFAULT", sourceSetID = DokkaSourceSetID("DEFAULT", "DEFAULT"), - classpath = emptyList(), - sourceRoots = emptyList(), + classpath = emptySet(), + sourceRoots = emptySet(), dependentSourceSets = emptySet(), - samples = emptyList(), - includes = emptyList(), + samples = emptySet(), + includes = emptySet(), includeNonPublic = false, includeRootPackage = false, reportUndocumented = false, skipEmptyPackages = true, skipDeprecated = false, jdkVersion = 8, - sourceLinks = emptyList(), + sourceLinks = emptySet(), perPackageOptions = emptyList(), - externalDocumentationLinks = emptyList(), + externalDocumentationLinks = emptySet(), languageVersion = null, apiVersion = null, noStdlibLink = false, noJdkLink = false, - suppressedFiles = emptyList(), + suppressedFiles = emptySet(), analysisPlatform = Platform.DEFAULT ) diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt index 2381ad07..cd9b9dfc 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/DivergentTest.kt @@ -2,7 +2,6 @@ package renderers.gfm import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.gfm.CommonmarkRenderer import org.jetbrains.dokka.links.DRI import org.jetbrains.dokka.pages.ContentDivergentGroup @@ -17,21 +16,21 @@ class DivergentTest : GfmRenderingOnlyTestBase() { "js", DokkaSourceSetID("root", "js"), analysisPlatform = Platform.js, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val jvm = defaultSourceSet.copy( "root", "jvm", DokkaSourceSetID("root", "jvm"), analysisPlatform = Platform.jvm, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val native = defaultSourceSet.copy( "root", "native", DokkaSourceSetID("root", "native"), analysisPlatform = Platform.native, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) @Test diff --git a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt index e181e3a2..de473db0 100644 --- a/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt +++ b/plugins/gfm/src/test/kotlin/renderers/gfm/SourceSetDependentHintTest.kt @@ -2,12 +2,12 @@ package renderers.gfm import org.jetbrains.dokka.DokkaSourceSetID import org.jetbrains.dokka.Platform -import org.jetbrains.dokka.SourceRootImpl import org.jetbrains.dokka.gfm.CommonmarkRenderer import org.jetbrains.dokka.pages.TextStyle import org.junit.jupiter.api.Test import renderers.TestPage import renderers.defaultSourceSet +import java.io.File class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { @@ -16,21 +16,21 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { "pl1", DokkaSourceSetID("root", "pl1"), analysisPlatform = Platform.js, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val pl2 = defaultSourceSet.copy( "root", "pl2", DokkaSourceSetID("root", "pl2"), analysisPlatform = Platform.jvm, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) private val pl3 = defaultSourceSet.copy( "root", "pl3", DokkaSourceSetID("root", "pl3"), analysisPlatform = Platform.native, - sourceRoots = listOf(SourceRootImpl("pl1")) + sourceRoots = setOf(File("pl1")) ) @Test @@ -134,4 +134,4 @@ class SourceSetDependentHintTest : GfmRenderingOnlyTestBase() { CommonmarkRenderer(context).render(page) assert(renderedContent == "//[testPage](test-page.md)\n\n [pl1, pl2] a \n \n [pl3] b \n \n") } -} \ No newline at end of file +} diff --git a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt index 89d5b286..aa5013e5 100644 --- a/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt +++ b/plugins/javadoc/src/test/kotlin/org/jetbrains/dokka/javadoc/JavadocPackageTemplateMapTest.kt @@ -110,7 +110,7 @@ internal class JavadocPackageTemplateMapTest : AbstractJavadocTemplateMapTest() configuration = config.copy( sourceSets = config.sourceSets.map { sourceSet -> sourceSet.copy( - includes = listOf(File("packages.md")) + includes = setOf(File("packages.md")) ) } ) diff --git a/runners/cli/src/main/kotlin/cli/main.kt b/runners/cli/src/main/kotlin/cli/main.kt index df763596..a9c15ec1 100644 --- a/runners/cli/src/main/kotlin/cli/main.kt +++ b/runners/cli/src/main/kotlin/cli/main.kt @@ -36,11 +36,13 @@ class GlobalArguments(args: Array) : DokkaConfiguration { description = "Configuration for plugins in format fqPluginName=json^^fqPluginName=json..." ).default(emptyMap()) - override val pluginsClasspath by parser.option( + private val pluginsClasspathList by parser.option( ArgTypeFile, + fullName = "pluginsClasspath", description = "List of jars with dokka plugins (allows many paths separated by the semicolon `;`)" ).delimiter(";") + override val pluginsClasspath: Set by lazy { pluginsClasspathList.toMutableSet() } override val offlineMode by parser.option( ArgType.Boolean, @@ -77,19 +79,19 @@ class GlobalArguments(args: Array) : DokkaConfiguration { init { parser.parse(args) - sourceSets.all { + sourceSets.forEach { it.perPackageOptions.cast>() .addAll(parsePerPackageOptions(globalPackageOptions)) } - sourceSets.all { - it.externalDocumentationLinks.cast>().addAll(parseLinks(globalLinks)) + sourceSets.forEach { + it.externalDocumentationLinks.cast>().addAll(parseLinks(globalLinks)) } globalSrcLink.forEach { if (it.isNotEmpty() && it.contains("=")) sourceSets.all { sourceSet -> - sourceSet.sourceLinks.cast>() + sourceSet.sourceLinks.cast>() .add(SourceLinkDefinitionImpl.parseSourceLinkDefinition(it)) } else { @@ -98,10 +100,7 @@ class GlobalArguments(args: Array) : DokkaConfiguration { } sourceSets.forEach { - it.externalDocumentationLinks.cast>().addAll(defaultLinks(it)) - it.externalDocumentationLinks.cast>().replaceAll { link -> - ExternalDocumentationLink.Builder(link.url, link.packageListUrl).build() - } + it.externalDocumentationLinks.cast>().addAll(defaultLinks(it)) } } } @@ -227,28 +226,28 @@ private fun parseSourceSet(args: Array): DokkaConfiguration.DokkaSourceS override val moduleDisplayName = moduleDisplayName ?: moduleName override val displayName = displayName override val sourceSetID = DokkaSourceSetID(moduleName, sourceSetName) - override val classpath = classpath - override val sourceRoots = sourceRoots.map { SourceRootImpl(it) } - override val dependentSourceSets: Set = dependentSourceSets + override val classpath = classpath.toMutableSet() + override val sourceRoots = sourceRoots.toMutableSet() + override val dependentSourceSets = dependentSourceSets .map { dependentSourceSetName -> dependentSourceSetName.split('/').let { DokkaSourceSetID(it[0], it[1]) } } - .toSet() - override val samples = samples - override val includes = includes + .toMutableSet() + override val samples = samples.toMutableSet() + override val includes = includes.toMutableSet() override val includeNonPublic = includeNonPublic override val includeRootPackage = includeRootPackage override val reportUndocumented = reportUndocumented override val skipEmptyPackages = skipEmptyPackages override val skipDeprecated = skipDeprecated override val jdkVersion = jdkVersion - override val sourceLinks = sourceLinks + override val sourceLinks = sourceLinks.toMutableSet() override val analysisPlatform = analysisPlatform override val perPackageOptions = parsePerPackageOptions(perPackageOptions) - override val externalDocumentationLinks = parseLinks(externalDocumentationLinks) + override val externalDocumentationLinks = parseLinks(externalDocumentationLinks).toMutableSet() override val languageVersion = languageVersion override val apiVersion = apiVersion override val noStdlibLink = noStdlibLink override val noJdkLink = noJdkLink - override val suppressedFiles = suppressedFiles + override val suppressedFiles = suppressedFiles.toMutableSet() } } @@ -307,13 +306,14 @@ object ArgTypeHelpSourceSet : ArgType(false) { fun defaultLinks(config: DokkaConfiguration.DokkaSourceSet): MutableList = mutableListOf().apply { if (!config.noJdkLink) { + // TODO NOW: Duplication val javadocLink = if (config.jdkVersion < 11) "https://docs.oracle.com/javase/${config.jdkVersion}/docs/api/" else "https://docs.oracle.com/en/java/javase/${config.jdkVersion}/docs/api/java.base/" val packageListLink = if (config.jdkVersion < 11) "${javadocLink}/package-list" else "https://docs.oracle.com/en/java/javase/${config.jdkVersion}/docs/api/element-list" - this += DokkaConfiguration.ExternalDocumentationLink + this += ExternalDocumentationLink .Builder(javadocLink, packageListLink) .build() } @@ -324,7 +324,6 @@ fun defaultLinks(config: DokkaConfiguration.DokkaSourceSet): MutableList): List { val (parsedLinks, parsedOfflineLinks) = links @@ -355,3 +354,4 @@ fun main(args: Array) { globalArguments DokkaGenerator(configuration, DokkaConsoleLogger).generate() } + diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt index 7a73d633..4762c333 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTask.kt @@ -10,7 +10,7 @@ open class DokkaCollectorTask : AbstractDokkaParentTask() { cacheRoot = cacheRoot, failOnWarning = failOnWarning, offlineMode = offlineMode, - pluginsClasspath = plugins.resolve().toList(), + pluginsClasspath = plugins.resolve().toSet(), ) val subprojectDokkaConfigurations = dokkaTasks.map { dokkaTask -> dokkaTask.buildDokkaConfiguration() } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt index 8369954b..48a9721f 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaMultimoduleTask.kt @@ -2,6 +2,7 @@ package org.jetbrains.dokka.gradle import org.gradle.api.internal.tasks.TaskDependencyInternal import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal import org.jetbrains.dokka.DokkaConfigurationImpl import org.jetbrains.dokka.DokkaModuleDescriptionImpl import org.jetbrains.dokka.DokkaMultimoduleBootstrapImpl @@ -16,6 +17,7 @@ open class DokkaMultimoduleTask : AbstractDokkaParentTask(DokkaMultimoduleBootst @Input var documentationFileName: String = "README.md" + @Internal override fun getTaskDependencies(): TaskDependencyInternal { return super.getTaskDependencies() + dokkaTasks } @@ -27,7 +29,7 @@ open class DokkaMultimoduleTask : AbstractDokkaParentTask(DokkaMultimoduleBootst pluginsConfiguration = pluginsConfiguration, failOnWarning = failOnWarning, offlineMode = offlineMode, - pluginsClasspath = plugins.resolve().toList(), + pluginsClasspath = plugins.resolve().toSet(), modules = dokkaTasks.map { dokkaTask -> DokkaModuleDescriptionImpl( name = dokkaTask.project.name, diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt index a74068ae..06b936ce 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/DokkaTask.kt @@ -29,7 +29,7 @@ open class DokkaTask : AbstractDokkaTask(DokkaBootstrapImpl::class) { failOnWarning = failOnWarning, sourceSets = dokkaSourceSets.build(), pluginsConfiguration = pluginsConfiguration, - pluginsClasspath = plugins.resolve().toList() + pluginsClasspath = plugins.resolve() ) } } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt index e420e1a5..09c9bec9 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilder.kt @@ -27,7 +27,7 @@ open class GradleDokkaSourceSetBuilder constructor( @Classpath @Optional - var classpath: List = emptyList() + val classpath: MutableSet = mutableSetOf() @Input @Optional @@ -41,18 +41,18 @@ open class GradleDokkaSourceSetBuilder constructor( val sourceSetID: DokkaSourceSetID = DokkaSourceSetID(project, name) @Nested - var sourceRoots: MutableList = mutableListOf() + val sourceRoots: MutableSet = mutableSetOf() @Input - var dependentSourceSets: MutableSet = mutableSetOf() + val dependentSourceSets: MutableSet = mutableSetOf() @InputFiles @Optional - var samples: List = emptyList() + val samples: MutableSet = mutableSetOf() @InputFiles @Optional - var includes: List = emptyList() + val includes: MutableSet = mutableSetOf() @Input var includeNonPublic: Boolean = DokkaDefaults.includeNonPublic @@ -73,13 +73,13 @@ open class GradleDokkaSourceSetBuilder constructor( var jdkVersion: Int = DokkaDefaults.jdkVersion @Nested - var sourceLinks: MutableList = mutableListOf() + val sourceLinks: MutableSet = mutableSetOf() @Nested - var perPackageOptions: MutableList = mutableListOf() + val perPackageOptions: MutableList = mutableListOf() @Nested - var externalDocumentationLinks: MutableList = mutableListOf() + val externalDocumentationLinks: MutableSet = mutableSetOf() @Input @Optional @@ -99,7 +99,7 @@ open class GradleDokkaSourceSetBuilder constructor( var noAndroidSdkLink: Boolean = false @Input - var suppressedFiles: List = emptyList() + val suppressedFiles: MutableSet = mutableSetOf() @Input @Optional @@ -134,15 +134,13 @@ open class GradleDokkaSourceSetBuilder constructor( } // TODO NOW: Cover with tests - fun sourceRoot(c: Closure) { - val configured = ConfigureUtil.configure(c, GradleSourceRootBuilder()) - sourceRoots.add(configured) + + fun sourceRoot(file: File) { + sourceRoots.add(file) } - fun sourceRoot(action: Action) { - val sourceRoot = GradleSourceRootBuilder() - action.execute(sourceRoot) - sourceRoots.add(sourceRoot) + fun sourceRoot(path: String) { + sourceRoots.add(project.file(path)) } fun sourceLink(c: Closure) { @@ -241,33 +239,31 @@ open class GradleDokkaSourceSetBuilder constructor( else -> Platform.DEFAULT } - val sourceRoots = sourceRoots.build().distinct() - - val suppressedFiles = suppressedFiles + project.collectSuppressedFiles(sourceRoots) + val suppressedFiles = suppressedFiles + project.collectSuppressedFiles(sourceRoots.toSet()) return DokkaSourceSetImpl( - classpath = classpath.distinct().toList(), + classpath = classpath.toSet(), moduleDisplayName = moduleDisplayName, displayName = displayName, sourceSetID = sourceSetID, - sourceRoots = sourceRoots, + sourceRoots = sourceRoots.toSet(), dependentSourceSets = dependentSourceSets.toSet(), - samples = samples.toList(), - includes = includes.toList(), + samples = samples.toSet(), + includes = includes.toSet(), includeNonPublic = includeNonPublic, includeRootPackage = includeRootPackage, reportUndocumented = reportUndocumented, skipEmptyPackages = skipEmptyPackages, skipDeprecated = skipDeprecated, jdkVersion = jdkVersion, - sourceLinks = sourceLinks.build(), + sourceLinks = sourceLinks.build().toSet(), perPackageOptions = perPackageOptions.build(), - externalDocumentationLinks = externalDocumentationLinks, + externalDocumentationLinks = externalDocumentationLinks.toSet(), languageVersion = languageVersion, apiVersion = apiVersion, noStdlibLink = noStdlibLink, noJdkLink = noJdkLink, - suppressedFiles = suppressedFiles, + suppressedFiles = suppressedFiles.toSet(), analysisPlatform = analysisPlatform ) } @@ -286,13 +282,13 @@ fun GradleDokkaSourceSetBuilder.dependsOn(sourceSet: AndroidSourceSet) { } // TODO NOW: Test -private fun Project.collectSuppressedFiles(sourceRoots: List): List = +private fun Project.collectSuppressedFiles(sourceRoots: Set): Set = if (project.isAndroidProject()) { val generatedRoot = project.buildDir.resolve("generated").absoluteFile sourceRoots - .map { it.directory } .filter { it.startsWith(generatedRoot) } .flatMap { it.walk().toList() } + .toSet() } else { - emptyList() + emptySet() } diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceRootBuilder.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceRootBuilder.kt deleted file mode 100644 index 687dec9c..00000000 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/GradleSourceRootBuilder.kt +++ /dev/null @@ -1,15 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.gradle.api.tasks.InputDirectory -import org.jetbrains.dokka.DokkaConfigurationBuilder -import org.jetbrains.dokka.SourceRootImpl -import java.io.File - -class GradleSourceRootBuilder : DokkaConfigurationBuilder { - @InputDirectory - var directory: File? = null - - override fun build(): SourceRootImpl { - return SourceRootImpl(checkNotNull(directory) { "directory not set" }) - } -} diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGist.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGist.kt index 334aae15..6e202ac3 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGist.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGist.kt @@ -11,6 +11,7 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.io.File +// TODO NOW: Test this all private typealias KotlinCompilation = org.jetbrains.kotlin.gradle.plugin.KotlinCompilation diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt index 9bb11f36..88833a76 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/sourceSetKotlinGistConfiguration.kt @@ -9,13 +9,12 @@ fun GradleDokkaSourceSetBuilder.configureWithKotlinSourceSet(sourceSet: KotlinSo } internal fun GradleDokkaSourceSetBuilder.configureWithKotlinSourceSetGist(sourceSet: KotlinSourceSetGist) { - sourceRoots.addAll(sourceRoots.union(sourceSet.sourceRoots.toSourceRoots()).distinct()) + sourceRoots.addAll(sourceRoots.union(sourceSet.sourceRoots).distinct()) dependentSourceSets.addAll(dependentSourceSets) dependentSourceSets.addAll(sourceSet.dependentSourceSets.map { DokkaSourceSetID(project, it) }) - classpath = classpath.union(sourceSet.classpath).distinct() + classpath.addAll(sourceSet.classpath) if (platform == null && sourceSet.platform != "") platform = sourceSet.platform } -private fun Iterable.toSourceRoots(): List = - this.filter { it.exists() }.map { GradleSourceRootBuilder().apply { directory = it } } + diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt index 2d8dc21a..58a44a5c 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaCollectorTaskTest.kt @@ -50,7 +50,6 @@ class DokkaCollectorTaskTest { pluginsClasspath = task.dokkaTasks .map { it.plugins.resolve() } .reduce { acc, mutableSet -> acc + mutableSet } - .toList() ), dokkaConfiguration ) diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt index ff318bdf..8814a897 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/DokkaMultiModuleTaskTest.kt @@ -69,7 +69,7 @@ class DokkaMultiModuleTaskTest { outputDir = task.project.buildDir.resolve("customOutputDirectory"), cacheRoot = File("customCacheRoot"), pluginsConfiguration = mapOf("pluginA" to "configA"), - pluginsClasspath = emptyList(), + pluginsClasspath = emptySet(), failOnWarning = true, offlineMode = true, modules = listOf( diff --git a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt index 3df2a17e..4dc9020a 100644 --- a/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt +++ b/runners/maven-plugin/src/main/kotlin/DokkaMojo.kt @@ -53,13 +53,6 @@ class ExternalDocumentationLinkBuilder : DokkaConfiguration.ExternalDocumentatio } abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List) : AbstractMojo() { - class SourceRoot : DokkaConfigurationBuilder { - @Parameter(required = true) - var path: String = "" - override fun build(): DokkaConfiguration.SourceRoot { - return SourceRootImpl(File(path)) - } - } @Parameter(defaultValue = "\${project}", readonly = true) private var mavenProject: MavenProject? = null @@ -185,17 +178,17 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List { - val links = mutableListOf() + fun defaultLinks(config: DokkaSourceSetImpl): Set { + val links = mutableSetOf() if (!config.noJdkLink) links += DokkaConfiguration.ExternalDocumentationLink .Builder("https://docs.oracle.com/javase/${config.jdkVersion}/docs/api/") - .build() as ExternalDocumentationLinkImpl + .build() if (!config.noStdlibLink) links += DokkaConfiguration.ExternalDocumentationLink .Builder("https://kotlinlang.org/api/latest/jvm/stdlib/") - .build() as ExternalDocumentationLinkImpl + .build() return links } @@ -203,18 +196,18 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List { + ): Set { val repoSystem: RepositorySystem = newRepositorySystem() val session: RepositorySystemSession = newSession(repoSystem) val dependency = @@ -303,7 +296,7 @@ abstract class AbstractDokkaMojo(private val defaultDokkaPlugins: List 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