KT-49066: Use correct moduleName in the incremental compilation

When storing mapping from moduleName to module information, ensure
that values from kotlinOptions DSL objects are taken into
consideration.

Fixes #KT-49066
Test: KotlinAndroid70GradleIT.testCustomModuleName
This commit is contained in:
Ivan Gavrilovic
2021-10-04 12:50:40 +01:00
committed by TeamCityServer
parent 472eceb13c
commit 32bf7f33a7
2 changed files with 35 additions and 0 deletions
@@ -553,6 +553,9 @@ abstract class KotlinCompile @Inject constructor(
compileJavaTaskProvider.map { it.name }
)
}
task.moduleName.set(task.project.provider {
task.kotlinOptions.moduleName ?: task.parentKotlinOptionsImpl.orNull?.moduleName ?: compilation.moduleName
})
if (properties.useClasspathSnapshot) {
val classpathSnapshot = task.project.configurations.getByName(classpathSnapshotConfigurationName(task.name))