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