Use archivesBaseName for module names in MPP common modules as well.

Issue #KT-23574 Fixed
This commit is contained in:
Sergey Igushkin
2018-04-03 17:30:59 +03:00
parent 4396b4259e
commit 2b41a0d30e
2 changed files with 16 additions and 1 deletions
@@ -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")
}
}
}
@@ -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) {