+11
-7
@@ -75,13 +75,18 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest()
|
||||
val sb = StringBuilder()
|
||||
val p = Printer(sb)
|
||||
val targets = projectDescriptor.allModuleTargets
|
||||
val paths = projectDescriptor.dataManager.dataPaths
|
||||
val dataManager = projectDescriptor.dataManager
|
||||
val paths = dataManager.dataPaths
|
||||
val versions = CacheVersionProvider(paths)
|
||||
|
||||
dumpCachesForTarget(p, paths, KotlinDataContainerTarget, versions.dataContainerVersion())
|
||||
dumpCachesForTarget(p, paths, KotlinDataContainerTarget, versions.dataContainerVersion().formatVersionFile)
|
||||
|
||||
for (target in targets.sortedBy { it.presentableName }) {
|
||||
dumpCachesForTarget(p, paths, target, versions.normalVersion(target), versions.experimentalVersion(target),
|
||||
val jvmMetaBuildInfo = jvmBuildMetaInfoFile(target, dataManager)
|
||||
dumpCachesForTarget(p, paths, target,
|
||||
versions.normalVersion(target).formatVersionFile,
|
||||
versions.experimentalVersion(target).formatVersionFile,
|
||||
jvmMetaBuildInfo,
|
||||
subdirectory = KOTLIN_CACHE_DIRECTORY_NAME)
|
||||
}
|
||||
|
||||
@@ -92,16 +97,15 @@ abstract class AbstractIncrementalLazyCachesTest : AbstractIncrementalJpsTest()
|
||||
p: Printer,
|
||||
paths: BuildDataPaths,
|
||||
target: BuildTarget<*>,
|
||||
vararg cacheVersions: CacheVersion,
|
||||
vararg cacheVersionsFiles: File,
|
||||
subdirectory: String? = null
|
||||
) {
|
||||
p.println(target)
|
||||
p.pushIndent()
|
||||
|
||||
val dataRoot = paths.getTargetDataRoot(target).let { if (subdirectory != null) File(it, subdirectory) else it }
|
||||
cacheVersions
|
||||
.map { it.formatVersionFile }
|
||||
.filter { it.exists() }
|
||||
cacheVersionsFiles
|
||||
.filter(File::exists)
|
||||
.sortedBy { it.name }
|
||||
.forEach { p.println(it.name) }
|
||||
|
||||
|
||||
@@ -75,6 +75,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
@JvmField val KOTLIN_BUILDER_NAME: String = "Kotlin Builder"
|
||||
|
||||
val LOG = Logger.getInstance("#org.jetbrains.kotlin.jps.build.KotlinBuilder")
|
||||
const val JVM_BUILD_META_INFO_FILE_NAME = "jvm-build-meta-info.txt"
|
||||
}
|
||||
|
||||
private val statisticsLogger = TeamcityStatisticsLogger()
|
||||
@@ -211,7 +212,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
return ABORT
|
||||
}
|
||||
|
||||
val commonArguments = JpsKotlinCompilerSettings.getCommonCompilerArguments(chunk.representativeTarget().module)
|
||||
val commonArguments = compilerArgumentsForChunk(chunk)
|
||||
commonArguments.verbose = true // Make compiler report source to output files mapping
|
||||
|
||||
val allCompiledFiles = getAllCompiledFilesContainer(context)
|
||||
@@ -241,7 +242,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
val generatedFiles = getGeneratedFiles(chunk, environment.outputItemsCollector)
|
||||
|
||||
registerOutputItems(outputConsumer, generatedFiles)
|
||||
saveVersions(context, chunk)
|
||||
saveVersions(context, chunk, commonArguments)
|
||||
|
||||
if (targets.any { hasKotlin[it] == null }) {
|
||||
fsOperations.markChunk(recursively = false, kotlinOnly = true, excludeFiles = filesToCompile.values().toSet())
|
||||
@@ -356,13 +357,25 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
}
|
||||
}
|
||||
|
||||
private fun saveVersions(context: CompileContext, chunk: ModuleChunk) {
|
||||
private fun saveVersions(context: CompileContext, chunk: ModuleChunk, commonArguments: CommonCompilerArguments) {
|
||||
val dataManager = context.projectDescriptor.dataManager
|
||||
val targets = chunk.targets
|
||||
val cacheVersionsProvider = CacheVersionProvider(dataManager.dataPaths)
|
||||
cacheVersionsProvider.allVersions(targets).forEach { it.saveIfNeeded() }
|
||||
|
||||
if (!JpsUtils.isJsKotlinModule(chunk.representativeTarget())) {
|
||||
val jvmBuildMetaInfo = JvmBuildMetaInfo(commonArguments)
|
||||
val serializedMetaInfo = JvmBuildMetaInfo.serializeToString(jvmBuildMetaInfo)
|
||||
|
||||
for (target in chunk.targets) {
|
||||
jvmBuildMetaInfoFile(target, dataManager).writeText(serializedMetaInfo)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun compilerArgumentsForChunk(chunk: ModuleChunk): CommonCompilerArguments =
|
||||
JpsKotlinCompilerSettings.getCommonCompilerArguments(chunk.representativeTarget().module)
|
||||
|
||||
private fun doCompileModuleChunk(
|
||||
allCompiledFiles: MutableSet<File>, chunk: ModuleChunk, commonArguments: CommonCompilerArguments, context: CompileContext,
|
||||
dirtyFilesHolder: DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget>, environment: JpsCompilerEnvironment,
|
||||
@@ -902,3 +915,5 @@ private fun hasKotlinDirtyOrRemovedFiles(
|
||||
return chunk.targets.any { KotlinSourceFileCollector.getRemovedKotlinFiles(dirtyFilesHolder, it).isNotEmpty() }
|
||||
}
|
||||
|
||||
fun jvmBuildMetaInfoFile(target: ModuleBuildTarget, dataManager: BuildDataManager): File =
|
||||
File(dataManager.dataPaths.getTargetDataRoot(target), KotlinBuilder.JVM_BUILD_META_INFO_FILE_NAME)
|
||||
|
||||
+4
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module1' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
class-fq-name-to-source.tab
|
||||
internal-name-to-source.tab
|
||||
proto.tab
|
||||
@@ -15,6 +16,7 @@ Module 'module1' tests
|
||||
Module 'module2' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
class-fq-name-to-source.tab
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
@@ -26,6 +28,7 @@ Module 'module2' tests
|
||||
Module 'module3' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
class-fq-name-to-source.tab
|
||||
internal-name-to-source.tab
|
||||
proto.tab
|
||||
@@ -34,6 +37,7 @@ Module 'module3' tests
|
||||
Module 'module4' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
class-fq-name-to-source.tab
|
||||
internal-name-to-source.tab
|
||||
proto.tab
|
||||
|
||||
+3
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module1' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
@@ -15,6 +16,7 @@ Module 'module1' tests
|
||||
Module 'module2' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
@@ -23,6 +25,7 @@ Module 'module2' tests
|
||||
Module 'module3' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
|
||||
+4
@@ -1,22 +1,26 @@
|
||||
kotlin-data-container
|
||||
Module 'module1' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module1' tests
|
||||
Module 'module2' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module2' tests
|
||||
Module 'module3' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module3' tests
|
||||
Module 'module4' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module4' tests
|
||||
+4
@@ -1,9 +1,13 @@
|
||||
kotlin-data-container
|
||||
Module 'module1' production
|
||||
jvm-build-meta-info.txt
|
||||
Module 'module1' tests
|
||||
Module 'module2' production
|
||||
jvm-build-meta-info.txt
|
||||
Module 'module2' tests
|
||||
Module 'module3' production
|
||||
jvm-build-meta-info.txt
|
||||
Module 'module3' tests
|
||||
Module 'module4' production
|
||||
jvm-build-meta-info.txt
|
||||
Module 'module4' tests
|
||||
+4
@@ -1,11 +1,13 @@
|
||||
kotlin-data-container
|
||||
Module 'module1' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module1' tests
|
||||
Module 'module2' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
inline-functions.tab
|
||||
inlined-to.tab
|
||||
package-parts.tab
|
||||
@@ -14,11 +16,13 @@ Module 'module2' production
|
||||
Module 'module2' tests
|
||||
Module 'module3' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module3' tests
|
||||
Module 'module4' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module4' tests
|
||||
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module' tests
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
class-fq-name-to-source.tab
|
||||
internal-name-to-source.tab
|
||||
proto.tab
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
Module 'module' tests
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
class-fq-name-to-source.tab
|
||||
internal-name-to-source.tab
|
||||
proto.tab
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
constants.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
constants.tab
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
inline-functions.tab
|
||||
inlined-to.tab
|
||||
package-parts.tab
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
inline-functions.tab
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
inline-functions.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
inline-functions.tab
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
kotlin-data-container
|
||||
Module 'module' production
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
source-to-classes.tab
|
||||
|
||||
+1
@@ -7,6 +7,7 @@ kotlin-data-container
|
||||
Module 'module' production
|
||||
experimental-format-version.txt
|
||||
format-version.txt
|
||||
jvm-build-meta-info.txt
|
||||
internal-name-to-source.tab
|
||||
package-parts.tab
|
||||
proto.tab
|
||||
|
||||
Reference in New Issue
Block a user