diff options
25 files changed, 65 insertions, 49 deletions
diff --git a/examples/gradle/dokka-customFormat-example/build.gradle.kts b/examples/gradle/dokka-customFormat-example/build.gradle.kts index 8f9b6d2e..90093999 100644 --- a/examples/gradle/dokka-customFormat-example/build.gradle.kts +++ b/examples/gradle/dokka-customFormat-example/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.dokka.gradle.DokkaTask plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version ("1.7.10") } diff --git a/examples/gradle/dokka-gradle-example/build.gradle.kts b/examples/gradle/dokka-gradle-example/build.gradle.kts index bf1b31c1..ce24b597 100644 --- a/examples/gradle/dokka-gradle-example/build.gradle.kts +++ b/examples/gradle/dokka-gradle-example/build.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.dokka.gradle.DokkaTask import java.net.URL plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version ("1.7.10") } diff --git a/examples/gradle/dokka-kotlinAsJava-example/build.gradle.kts b/examples/gradle/dokka-kotlinAsJava-example/build.gradle.kts index 5e5b33f6..0f47c53c 100644 --- a/examples/gradle/dokka-kotlinAsJava-example/build.gradle.kts +++ b/examples/gradle/dokka-kotlinAsJava-example/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version ("1.7.10") } diff --git a/examples/gradle/dokka-library-publishing-example/build.gradle.kts b/examples/gradle/dokka-library-publishing-example/build.gradle.kts index 1580a7e0..97f00364 100644 --- a/examples/gradle/dokka-library-publishing-example/build.gradle.kts +++ b/examples/gradle/dokka-library-publishing-example/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version ("1.7.10") `java-library` `maven-publish` diff --git a/examples/gradle/dokka-multimodule-example/settings.gradle.kts b/examples/gradle/dokka-multimodule-example/settings.gradle.kts index cc019c78..11f0e236 100644 --- a/examples/gradle/dokka-multimodule-example/settings.gradle.kts +++ b/examples/gradle/dokka-multimodule-example/settings.gradle.kts @@ -1,6 +1,6 @@ pluginManagement { plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version ("1.7.10") } } diff --git a/examples/gradle/dokka-multiplatform-example/build.gradle.kts b/examples/gradle/dokka-multiplatform-example/build.gradle.kts index 19d86ac7..74b41a0f 100644 --- a/examples/gradle/dokka-multiplatform-example/build.gradle.kts +++ b/examples/gradle/dokka-multiplatform-example/build.gradle.kts @@ -4,7 +4,7 @@ import org.jetbrains.dokka.gradle.DokkaTask import org.jetbrains.dokka.Platform plugins { - kotlin("multiplatform") version "1.7.10" + kotlin("multiplatform") version "1.7.20-RC" id("org.jetbrains.dokka") version "1.7.10" } diff --git a/examples/gradle/dokka-versioning-multimodule-example/build.gradle.kts b/examples/gradle/dokka-versioning-multimodule-example/build.gradle.kts index 8d6eb8f4..93427844 100644 --- a/examples/gradle/dokka-versioning-multimodule-example/build.gradle.kts +++ b/examples/gradle/dokka-versioning-multimodule-example/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version ("1.7.10") apply false } diff --git a/examples/maven/pom.xml b/examples/maven/pom.xml index d6b5bb33..ca332649 100644 --- a/examples/maven/pom.xml +++ b/examples/maven/pom.xml @@ -8,7 +8,7 @@ <artifactId>kotlin-maven-example</artifactId> <version>1.0-SNAPSHOT</version> <properties> - <kotlin.version>1.7.10</kotlin.version> + <kotlin.version>1.7.20-RC</kotlin.version> <dokka.version>1.7.10</dokka.version> </properties> diff --git a/examples/plugin/hide-internal-api/build.gradle.kts b/examples/plugin/hide-internal-api/build.gradle.kts index 26d700ff..4eb7c6c1 100644 --- a/examples/plugin/hide-internal-api/build.gradle.kts +++ b/examples/plugin/hide-internal-api/build.gradle.kts @@ -2,7 +2,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile import java.net.URI plugins { - kotlin("jvm") version "1.7.10" + kotlin("jvm") version "1.7.20-RC" id("org.jetbrains.dokka") version "1.7.10" `maven-publish` signing diff --git a/gradle.properties b/gradle.properties index d7838847..3581d278 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,10 +2,10 @@ dokka_version=1.7.20-SNAPSHOT dokka_integration_test_parallelism=2 # Versions -kotlin_version=1.7.10 +kotlin_version=1.7.20-RC coroutines_version=1.6.3 kotlinx_html_version=0.7.5 -kotlin_plugin_version=213-1.7.10-release-333-IJ6777.52 +kotlin_plugin_version=213-1.7.20-199-IJ6777.52 jsoup_version=1.14.3 idea_version=213.6777.52 language_version=1.4 diff --git a/integration-tests/gradle/projects/it-android-0/gradle.properties b/integration-tests/gradle/projects/it-android-0/gradle.properties index 3e9a5b51..0610fb62 100644 --- a/integration-tests/gradle/projects/it-android-0/gradle.properties +++ b/integration-tests/gradle/projects/it-android-0/gradle.properties @@ -1,3 +1,3 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC dokka_it_android_gradle_plugin_version=4.0.0 android.useAndroidX=true diff --git a/integration-tests/gradle/projects/it-basic-groovy/gradle.properties b/integration-tests/gradle/projects/it-basic-groovy/gradle.properties index 80612345..9af31a1c 100644 --- a/integration-tests/gradle/projects/it-basic-groovy/gradle.properties +++ b/integration-tests/gradle/projects/it-basic-groovy/gradle.properties @@ -1 +1 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC diff --git a/integration-tests/gradle/projects/it-basic/gradle.properties b/integration-tests/gradle/projects/it-basic/gradle.properties index 80612345..9af31a1c 100644 --- a/integration-tests/gradle/projects/it-basic/gradle.properties +++ b/integration-tests/gradle/projects/it-basic/gradle.properties @@ -1 +1 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC diff --git a/integration-tests/gradle/projects/it-collector-0/gradle.properties b/integration-tests/gradle/projects/it-collector-0/gradle.properties index 80612345..9af31a1c 100644 --- a/integration-tests/gradle/projects/it-collector-0/gradle.properties +++ b/integration-tests/gradle/projects/it-collector-0/gradle.properties @@ -1 +1 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC diff --git a/integration-tests/gradle/projects/it-js-ir-0/gradle.properties b/integration-tests/gradle/projects/it-js-ir-0/gradle.properties index 48aa5d9e..bd992717 100644 --- a/integration-tests/gradle/projects/it-js-ir-0/gradle.properties +++ b/integration-tests/gradle/projects/it-js-ir-0/gradle.properties @@ -1,2 +1,2 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC react_version=18.1.0-pre.345 diff --git a/integration-tests/gradle/projects/it-multimodule-0/gradle.properties b/integration-tests/gradle/projects/it-multimodule-0/gradle.properties index 80612345..9af31a1c 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/gradle.properties +++ b/integration-tests/gradle/projects/it-multimodule-0/gradle.properties @@ -1 +1 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC diff --git a/integration-tests/gradle/projects/it-multimodule-1/gradle.properties b/integration-tests/gradle/projects/it-multimodule-1/gradle.properties index 80612345..9af31a1c 100644 --- a/integration-tests/gradle/projects/it-multimodule-1/gradle.properties +++ b/integration-tests/gradle/projects/it-multimodule-1/gradle.properties @@ -1 +1 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC diff --git a/integration-tests/gradle/projects/it-multimodule-versioning-0/gradle.properties b/integration-tests/gradle/projects/it-multimodule-versioning-0/gradle.properties index e94932a7..d9956c89 100644 --- a/integration-tests/gradle/projects/it-multimodule-versioning-0/gradle.properties +++ b/integration-tests/gradle/projects/it-multimodule-versioning-0/gradle.properties @@ -1,2 +1,2 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC diff --git a/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties b/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties index 87948ac9..3cd9e773 100644 --- a/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties +++ b/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties @@ -1,5 +1,5 @@ -dokka_it_kotlin_version=1.7.10 +dokka_it_kotlin_version=1.7.20-RC #these flags are enabled by default since 1.6.20. #remove when this test is executed with Kotlin >= 1.6.20 kotlin.mpp.enableGranularSourceSetsMetadata=true -kotlin.native.enableDependencyPropagation=false
\ No newline at end of file +kotlin.native.enableDependencyPropagation=false diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt index ef9d67cc..241dc732 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/JsIRGradleIntegrationTest.kt @@ -40,9 +40,9 @@ class JsIRGradleIntegrationTest(override val versions: BuildVersions) : Abstract return } - val reactPropertyArg = TestedVersions.KT_REACT_WRAPPER_MAPPING[versions.kotlinVersion] + val reactVersion = TestedVersions.KT_REACT_WRAPPER_MAPPING[versions.kotlinVersion] ?: throw IllegalStateException("Unspecified version of react for kotlin " + versions.kotlinVersion) - val result = createGradleRunner(reactPropertyArg, "dokkaHtml", "-i", "-s").buildRelaxed() + val result = createGradleRunner("-Preact_version=$reactVersion", "dokkaHtml", "-i", "-s").buildRelaxed() assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":dokkaHtml")).outcome) val htmlOutputDir = File(projectDir, "build/dokka/html") @@ -61,4 +61,4 @@ class JsIRGradleIntegrationTest(override val versions: BuildVersions) : Abstract assertNoEmptySpans(file) } } -}
\ No newline at end of file +} diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt index f8ec453e..18ebe427 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/TestedVersions.kt @@ -5,7 +5,7 @@ internal object TestedVersions { val BASE = BuildVersions.permutations( gradleVersions = listOf("7.4.2", "6.9"), - kotlinVersions = listOf("1.7.10", "1.6.21", "1.5.31", "1.4.32"), + kotlinVersions = listOf("1.7.20-RC", "1.6.21", "1.5.31", "1.4.32"), ) + BuildVersions.permutations( gradleVersions = listOf(*ifExhaustive("7.0", "6.1.1")), kotlinVersions = listOf(*ifExhaustive("1.6.0", "1.5.0", "1.4.0")) @@ -18,20 +18,20 @@ internal object TestedVersions { val ANDROID = BuildVersions.permutations( gradleVersions = listOf("7.4.2", *ifExhaustive("7.0")), - kotlinVersions = listOf("1.7.10", "1.6.21", "1.5.31", "1.4.32"), + kotlinVersions = listOf("1.7.20-RC", "1.6.21", "1.5.31", "1.4.32"), androidGradlePluginVersions = listOf("7.2.0") ) + BuildVersions.permutations( gradleVersions = listOf("6.9", *ifExhaustive("6.1.1", "5.6.4")), - kotlinVersions = listOf("1.7.10", "1.6.21", "1.5.31", "1.4.32"), + kotlinVersions = listOf("1.7.20-RC", "1.6.21", "1.5.31", "1.4.32"), androidGradlePluginVersions = listOf("4.0.0", *ifExhaustive("3.6.3")) ) // https://mvnrepository.com/artifact/org.jetbrains.kotlin-wrappers/kotlin-react val KT_REACT_WRAPPER_MAPPING = mapOf( - "1.5.0" to "-Preact_version=17.0.2-pre.204-kotlin-1.5.0", - "1.6.0" to "-Preact_version=17.0.2-pre.280-kotlin-1.6.0", - "1.5.31" to "-Preact_version=17.0.2-pre.265-kotlin-1.5.31", - "1.6.21" to "-Preact_version=18.0.0-pre.332-kotlin-1.6.21", - "1.7.10" to "-Preact_version=18.2.0-pre.354" + "1.5.0" to "17.0.2-pre.204-kotlin-1.5.0", + "1.6.0" to "17.0.2-pre.280-kotlin-1.6.0", + "1.5.31" to "17.0.2-pre.265-kotlin-1.5.31", + "1.6.21" to "18.0.0-pre.332-kotlin-1.6.21", + "1.7.20-RC" to "18.2.0-pre.391", ) } diff --git a/integration-tests/maven/projects/it-maven/pom.xml b/integration-tests/maven/projects/it-maven/pom.xml index 823933ca..296fe7e7 100644 --- a/integration-tests/maven/projects/it-maven/pom.xml +++ b/integration-tests/maven/projects/it-maven/pom.xml @@ -7,7 +7,7 @@ <version>1.0-SNAPSHOT</version> <properties> - <kotlin.version>1.7.10</kotlin.version> + <kotlin.version>1.7.20-RC</kotlin.version> </properties> <build> <plugins> 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 37381b0f..044a4f07 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 @@ -362,9 +362,11 @@ class AnalysisEnvironment(val messageCollector: MessageCollector, val analysisPl moduleInfo: ModuleInfo ): ResolverForModule = CommonResolverForModuleFactory( - CommonAnalysisParameters { content -> - environment.createPackagePartProvider(content.moduleContentScope) - }, + CommonAnalysisParameters( + metadataPartProviderFactory = { content -> + environment.createPackagePartProvider(content.moduleContentScope) + } + ), CompilerEnvironment, unspecifiedJvmPlatform, true, diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt index fdb4642c..1d06e608 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinCompilationUtils.kt @@ -10,26 +10,36 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet internal typealias KotlinCompilation = org.jetbrains.kotlin.gradle.plugin.KotlinCompilation<KotlinCommonOptions> +internal fun Project.compilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { + //KT-45412 Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set + return allCompilationsOf(sourceSet).filter { compilation -> + sourceSet in compilation.kotlinSourceSets || sourceSet == compilation.defaultSourceSet + } +} + internal fun Project.allCompilationsOf( sourceSet: KotlinSourceSet ): List<KotlinCompilation> { return when (val kotlin = kotlin) { - is KotlinMultiplatformExtension -> kotlin.allCompilationsOf(sourceSet) - is KotlinSingleTargetExtension -> kotlin.allCompilationsOf(sourceSet) + is KotlinMultiplatformExtension -> allCompilationsOf(kotlin, sourceSet) + is KotlinSingleTargetExtension<*> -> allCompilationsOf(kotlin, sourceSet) else -> emptyList() } } -internal fun Project.compilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { - //KT-45412 Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set - return allCompilationsOf(sourceSet).filter { compilation -> sourceSet in compilation.kotlinSourceSets || sourceSet == compilation.defaultSourceSet } -} - -private fun KotlinMultiplatformExtension.allCompilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { - val allCompilations = targets.flatMap { target -> target.compilations } - return allCompilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets || sourceSet == compilation.defaultSourceSet } +private fun allCompilationsOf( + kotlin: KotlinMultiplatformExtension, + sourceSet: KotlinSourceSet +): List<KotlinCompilation> { + val allCompilations = kotlin.targets.flatMap { target -> target.compilations } + return allCompilations.filter { compilation -> + sourceSet in compilation.allKotlinSourceSets || sourceSet == compilation.defaultSourceSet + } } -private fun KotlinSingleTargetExtension.allCompilationsOf(sourceSet: KotlinSourceSet): List<KotlinCompilation> { - return target.compilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets } +private fun allCompilationsOf( + kotlin: KotlinSingleTargetExtension<*>, + sourceSet: KotlinSourceSet +): List<KotlinCompilation> { + return kotlin.target.compilations.filter { compilation -> sourceSet in compilation.allKotlinSourceSets } } diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt index 770d1af3..9babeefd 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/GradleDokkaSourceSetBuilderTest.kt @@ -113,7 +113,7 @@ class GradleDokkaSourceSetBuilderTest { sourceSet.dependsOn(sourceSet.DokkaSourceSetID("s3")) sourceSet.dependsOn(GradleDokkaSourceSetBuilder("s4", project)) sourceSet.dependsOn(GradleDokkaSourceSetBuilder("s5", project).build()) - sourceSet.dependsOn(DefaultKotlinSourceSet(project, "s6")) + sourceSet.dependsOn(createDefaultKotlinSourceSet("s6")) sourceSet.dependsOn(DefaultAndroidSourceSet("s7", project, false)) assertEquals( @@ -123,6 +123,10 @@ class GradleDokkaSourceSetBuilderTest { ) } + private fun createDefaultKotlinSourceSet(displayName: String): DefaultKotlinSourceSet { + return project.objects.newInstance(DefaultKotlinSourceSet::class.java, project, displayName) + } + @Test fun samples() { val sourceSet = GradleDokkaSourceSetBuilder("", project) |