Use archivesBaseName for module names in MPP common modules as well.
Issue #KT-23574 Fixed
This commit is contained in:
+14
@@ -222,4 +222,18 @@ class MultiplatformGradleIT : BaseGradleIT() {
|
||||
assertContains("Dependency: 'lib'")
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testArchivesBaseNameAsCommonModuleName() = with(Project("multiplatformProject")) {
|
||||
setupWorkingDir()
|
||||
|
||||
val moduleName = "my_module_name"
|
||||
|
||||
gradleBuildScript("lib").appendText("\narchivesBaseName = '$moduleName'")
|
||||
|
||||
build("compileKotlinCommon") {
|
||||
assertSuccessful()
|
||||
assertFileExists(kotlinClassesDir(subproject = "lib") + "META-INF/$moduleName.kotlin_module")
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -50,10 +50,11 @@ internal open class KotlinCompileCommon : AbstractKotlinCompile<K2MetadataCompil
|
||||
args.apply { fillDefaultValues() }
|
||||
super.setupCompilerArgs(args, defaultsOnly)
|
||||
|
||||
args.moduleName = friendTask?.moduleName ?: this@KotlinCompileCommon.moduleName
|
||||
|
||||
if (defaultsOnly) return
|
||||
|
||||
val classpathList = classpath.files.toMutableList()
|
||||
val friendTask = friendTaskName?.let { project.tasks.findByName(it) } as? AbstractCompile
|
||||
friendTask?.let { classpathList.add(it.destinationDir) }
|
||||
|
||||
with(args) {
|
||||
|
||||
Reference in New Issue
Block a user