Use the project name + compilation name for secondary klib compilations
This helps avoid duplicate library names when compiling shared-Native source sets (the resulting klibs will have a more unique name than just the source set name which likely repeats between projects)
This commit is contained in:
+1
-1
@@ -93,7 +93,7 @@ class KlibBasedMppIT : BaseGradleIT() {
|
|||||||
assertTasksExecuted(*tasksToExecute.toTypedArray())
|
assertTasksExecuted(*tasksToExecute.toTypedArray())
|
||||||
|
|
||||||
assertFileExists("build/classes/kotlin/metadata/jvmAndJsMain/manifest")
|
assertFileExists("build/classes/kotlin/metadata/jvmAndJsMain/manifest")
|
||||||
assertFileExists("build/classes/kotlin/metadata/iosMain/iosMain.klib")
|
assertFileExists("build/classes/kotlin/metadata/iosMain/${projectName}_iosMain.klib")
|
||||||
|
|
||||||
// Check that the common and JVM+JS source sets don't receive the Kotlin/Native stdlib in the classpath:
|
// Check that the common and JVM+JS source sets don't receive the Kotlin/Native stdlib in the classpath:
|
||||||
run {
|
run {
|
||||||
|
|||||||
+1
-1
@@ -2235,7 +2235,7 @@ class NewMultiplatformIT : BaseGradleIT() {
|
|||||||
assertFileExists("build/classes/kotlin/js/integrationTest/new-mpp-associate-compilations_integrationTest.js")
|
assertFileExists("build/classes/kotlin/js/integrationTest/new-mpp-associate-compilations_integrationTest.js")
|
||||||
|
|
||||||
// Native:
|
// Native:
|
||||||
assertFileExists("build/classes/kotlin/$nativeHostTargetName/integrationTest/integrationTest.klib")
|
assertFileExists("build/classes/kotlin/$nativeHostTargetName/integrationTest/new-mpp-associate-compilations_integrationTest.klib")
|
||||||
}
|
}
|
||||||
|
|
||||||
gradleBuildScript().appendText(
|
gradleBuildScript().appendText(
|
||||||
|
|||||||
+1
-1
@@ -288,7 +288,7 @@ open class KotlinNativeCompile : AbstractKotlinNativeCompile<KotlinCommonOptions
|
|||||||
|
|
||||||
@get:Internal
|
@get:Internal
|
||||||
override val baseName: String
|
override val baseName: String
|
||||||
get() = if (compilation.isMainCompilation) project.name else compilation.name
|
get() = if (compilation.isMainCompilation) project.name else "${project.name}_${compilation.name}"
|
||||||
|
|
||||||
// Inputs and outputs.
|
// Inputs and outputs.
|
||||||
// region Sources.
|
// region Sources.
|
||||||
|
|||||||
Reference in New Issue
Block a user