JPS: Use module name from compiler arguments (JVM)

This commit is contained in:
Sergey Rostov
2018-10-29 15:10:11 +03:00
parent 37e706ef12
commit 74271cfecd
4 changed files with 10 additions and 3 deletions
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.jps.incremental
import java.io.File
private val NORMAL_VERSION = 9
private val NORMAL_VERSION = 10
private val NORMAL_VERSION_FILE_NAME = "format-version.txt"
fun localCacheVersionManager(dataRoot: File, isCachesEnabled: Boolean) =
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.jps.incremental
import java.io.File
private val DATA_CONTAINER_VERSION_FILE_NAME = "data-container-format-version.txt"
private val DATA_CONTAINER_VERSION = 3
private val DATA_CONTAINER_VERSION = 4
fun lookupsCacheVersionManager(dataRoot: File, isEnabled: Boolean) =
CacheVersionManager(
@@ -63,6 +63,13 @@ class KotlinJvmModuleBuildTarget(kotlinContext: KotlinCompileContext, jpsModuleB
override val buildMetaInfoFileName
get() = JVM_BUILD_META_INFO_FILE_NAME
override val targetId: TargetId
get() {
val moduleName = module.k2JvmCompilerArguments.moduleName
return if (moduleName != null) TargetId(moduleName, jpsModuleBuildTarget.targetType.typeId)
else super.targetId
}
override fun makeServices(
builder: Services.Builder,
incrementalCaches: Map<KotlinModuleBuildTarget<*>, JpsIncrementalCache>,
@@ -80,7 +80,7 @@ abstract class KotlinModuleBuildTarget<BuildMetaInfoType : BuildMetaInfo> intern
val isTests: Boolean
get() = jpsModuleBuildTarget.isTests
val targetId: TargetId
open val targetId: TargetId
get() {
// Since IDEA 2016 each gradle source root is imported as a separate module.
// One gradle module X is imported as two JPS modules: