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:
Sergey Igushkin
2020-01-24 23:25:33 +03:00
parent 2a15df6a20
commit 81216ceb51
3 changed files with 3 additions and 3 deletions
@@ -93,7 +93,7 @@ class KlibBasedMppIT : BaseGradleIT() {
assertTasksExecuted(*tasksToExecute.toTypedArray())
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:
run {
@@ -2235,7 +2235,7 @@ class NewMultiplatformIT : BaseGradleIT() {
assertFileExists("build/classes/kotlin/js/integrationTest/new-mpp-associate-compilations_integrationTest.js")
// Native:
assertFileExists("build/classes/kotlin/$nativeHostTargetName/integrationTest/integrationTest.klib")
assertFileExists("build/classes/kotlin/$nativeHostTargetName/integrationTest/new-mpp-associate-compilations_integrationTest.klib")
}
gradleBuildScript().appendText(
@@ -288,7 +288,7 @@ open class KotlinNativeCompile : AbstractKotlinNativeCompile<KotlinCommonOptions
@get:Internal
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.
// region Sources.