aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim Mishenev <vad-mishenev@yandex.ru>2022-09-26 16:46:41 +0300
committerGitHub <noreply@github.com>2022-09-26 16:46:41 +0300
commitee8e73012c1a7f86783920181590489d740af839 (patch)
tree4c286b99ca6e7a62a82fba58d3881b10e0afa7b6
parenta816e917995858129ad074409f73e99d3b100318 (diff)
downloaddokka-ee8e73012c1a7f86783920181590489d740af839.tar.gz
dokka-ee8e73012c1a7f86783920181590489d740af839.tar.bz2
dokka-ee8e73012c1a7f86783920181590489d740af839.zip
Extract classpath from `KotlinSharedNativeCompilation` as well (#2664)
* Extract classpath from `KotlinSharedNativeCompilation` as well * Enhance mpp integration test * Enable HMPP for old Kotlin in integration test * Add comments
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts12
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/gradle.properties4
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt11
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt5
-rw-r--r--runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt4
5 files changed, 32 insertions, 4 deletions
diff --git a/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts b/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts
index 9f93c2cd..2cea2076 100644
--- a/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts
+++ b/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts
@@ -14,6 +14,14 @@ kotlin {
macosX64("macos")
js()
sourceSets {
+ val commonMain by sourceSets.getting
+ val linuxMain by sourceSets.getting
+ val macosMain by sourceSets.getting
+ val desktopMain by sourceSets.creating {
+ dependsOn(commonMain)
+ linuxMain.dependsOn(this)
+ macosMain.dependsOn(this)
+ }
named("commonMain") {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
@@ -26,8 +34,8 @@ tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
externalDocumentationLink {
- url.set(URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/"))
- //packageListUrl.set(URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/package-list"))
+ url.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/"))
+ //packageListUrl.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/package-list"))
}
}
}
diff --git a/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties b/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties
index 80612345..87948ac9 100644
--- a/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties
+++ b/integration-tests/gradle/projects/it-multiplatform-0/gradle.properties
@@ -1 +1,5 @@
dokka_it_kotlin_version=1.7.10
+#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
diff --git a/integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt b/integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt
new file mode 100644
index 00000000..342a749e
--- /dev/null
+++ b/integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/CPointerExtension.kt
@@ -0,0 +1,11 @@
+package it.mpp0
+
+import kotlinx.cinterop.CPointed
+import kotlinx.cinterop.CPointer
+
+/**
+ * Will print the raw value
+ */
+fun CPointer<CPointed>.customExtension() {
+ println(this.rawValue)
+}
diff --git a/integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt b/integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt
new file mode 100644
index 00000000..19070a96
--- /dev/null
+++ b/integration-tests/gradle/projects/it-multiplatform-0/src/desktopMain/kotlin/it/mpp0/ExpectedClass.kt
@@ -0,0 +1,5 @@
+package it.mpp0
+
+actual class ExpectedClass {
+ actual val platform: String = "linux"
+}
diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
index b934d206..9ef268f2 100644
--- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
+++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt
@@ -5,7 +5,7 @@ import org.gradle.api.file.FileCollection
import org.jetbrains.dokka.gradle.isAndroidTarget
import org.jetbrains.dokka.utilities.cast
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
-import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation
+import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeCompilation
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
@@ -42,7 +42,7 @@ private fun Project.compileClasspathOf(compilation: KotlinCompilation): FileColl
return compilation.compileKotlinTask.cast<KotlinCompile>().classpath
}
- val platformDependencyFiles: FileCollection = (compilation as? KotlinNativeCompilation)
+ val platformDependencyFiles: FileCollection = (compilation as? AbstractKotlinNativeCompilation)
?.target?.project?.configurations
?.findByName(compilation.defaultSourceSet.implementationMetadataConfigurationName)
?: files()