Skip to content

Commit ee8e730

Browse files
authored
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
1 parent a816e91 commit ee8e730

File tree

5 files changed

+32
-4
lines changed

5 files changed

+32
-4
lines changed

integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ kotlin {
1414
macosX64("macos")
1515
js()
1616
sourceSets {
17+
val commonMain by sourceSets.getting
18+
val linuxMain by sourceSets.getting
19+
val macosMain by sourceSets.getting
20+
val desktopMain by sourceSets.creating {
21+
dependsOn(commonMain)
22+
linuxMain.dependsOn(this)
23+
macosMain.dependsOn(this)
24+
}
1725
named("commonMain") {
1826
dependencies {
1927
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
@@ -26,8 +34,8 @@ tasks.withType<DokkaTask>().configureEach {
2634
dokkaSourceSets {
2735
configureEach {
2836
externalDocumentationLink {
29-
url.set(URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/"))
30-
//packageListUrl.set(URL("https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/package-list"))
37+
url.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/"))
38+
//packageListUrl.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/package-list"))
3139
}
3240
}
3341
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
dokka_it_kotlin_version=1.7.10
2+
#these flags are enabled by default since 1.6.20.
3+
#remove when this test is executed with Kotlin >= 1.6.20
4+
kotlin.mpp.enableGranularSourceSetsMetadata=true
5+
kotlin.native.enableDependencyPropagation=false
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package it.mpp0
2+
3+
import kotlinx.cinterop.CPointed
4+
import kotlinx.cinterop.CPointer
5+
6+
/**
7+
* Will print the raw value
8+
*/
9+
fun CPointer<CPointed>.customExtension() {
10+
println(this.rawValue)
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package it.mpp0
2+
3+
actual class ExpectedClass {
4+
actual val platform: String = "linux"
5+
}

runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import org.gradle.api.file.FileCollection
55
import org.jetbrains.dokka.gradle.isAndroidTarget
66
import org.jetbrains.dokka.utilities.cast
77
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
8-
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeCompilation
8+
import org.jetbrains.kotlin.gradle.plugin.mpp.AbstractKotlinNativeCompilation
99
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinCommonCompilation
1010
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
1111

@@ -42,7 +42,7 @@ private fun Project.compileClasspathOf(compilation: KotlinCompilation): FileColl
4242
return compilation.compileKotlinTask.cast<KotlinCompile>().classpath
4343
}
4444

45-
val platformDependencyFiles: FileCollection = (compilation as? KotlinNativeCompilation)
45+
val platformDependencyFiles: FileCollection = (compilation as? AbstractKotlinNativeCompilation)
4646
?.target?.project?.configurations
4747
?.findByName(compilation.defaultSourceSet.implementationMetadataConfigurationName)
4848
?: files()

0 commit comments

Comments
 (0)