Implement server side IC

This commit is contained in:
Alexey Tsvetkov
2016-12-06 16:30:17 +03:00
parent f411bb0b4b
commit 51a8f6ee4f
14 changed files with 375 additions and 51 deletions
@@ -49,10 +49,7 @@ fun makeIncrementally(
messageCollector: MessageCollector = MessageCollector.NONE,
reporter: ICReporter = EmptyICReporter
) {
val versions = listOf(normalCacheVersion(cachesDir),
experimentalCacheVersion(cachesDir),
dataContainerCacheVersion(cachesDir),
standaloneCacheVersion(cachesDir))
val versions = commonCacheVersions(cachesDir) + standaloneCacheVersion(cachesDir)
val kotlinExtensions = listOf("kt", "kts")
val allExtensions = kotlinExtensions + listOf("java")
@@ -313,9 +310,6 @@ class IncrementalJvmCompilerRunner(
caches.incrementalCache.removeClassfilesBySources(dirtySources)
val (sourcesToCompile, removedKotlinSources) = dirtySources.partition(File::exists)
if (sourcesToCompile.isNotEmpty()) {
reporter.report { "compile iteration: ${reporter.pathsAsString(sourcesToCompile)}" }
}
// todo: more optimal to save only last iteration, but it will require adding standalone-ic specific logs
// (because jps rebuilds all files from last build if it failed and gradle rebuilds everything)
@@ -22,10 +22,15 @@ import java.io.File
internal const val STANDALONE_CACHE_VERSION = 0
internal const val STANDALONE_VERSION_FILE_NAME = "standalone-ic-format-version.txt"
internal fun standaloneCacheVersion(dataRoot: File): CacheVersion =
fun standaloneCacheVersion(dataRoot: File, forceEnable: Boolean = false): CacheVersion =
CacheVersion(ownVersion = STANDALONE_CACHE_VERSION,
versionFile = File(dataRoot, STANDALONE_VERSION_FILE_NAME),
whenVersionChanged = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOn = CacheVersion.Action.REBUILD_ALL_KOTLIN,
whenTurnedOff = CacheVersion.Action.REBUILD_ALL_KOTLIN,
isEnabled = { IncrementalCompilation.isExperimental() })
isEnabled = { IncrementalCompilation.isExperimental() || forceEnable })
fun commonCacheVersions(cachesDir: File): List<CacheVersion> =
listOf(normalCacheVersion(cachesDir),
experimentalCacheVersion(cachesDir),
dataContainerCacheVersion(cachesDir))