Minor: re-sort statements in KotlinBuilder::doBuild
This commit is contained in:
@@ -178,6 +178,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
|||||||
val compilationErrors = Utils.ERRORS_DETECTED_KEY[context, false]
|
val compilationErrors = Utils.ERRORS_DETECTED_KEY[context, false]
|
||||||
if (compilationErrors) {
|
if (compilationErrors) {
|
||||||
LOG.info("Compiled with errors")
|
LOG.info("Compiled with errors")
|
||||||
|
return ABORT
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LOG.info("Compiled successfully")
|
LOG.info("Compiled successfully")
|
||||||
@@ -187,32 +188,22 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
|||||||
|
|
||||||
registerOutputItems(outputConsumer, generatedFiles)
|
registerOutputItems(outputConsumer, generatedFiles)
|
||||||
|
|
||||||
context.checkCanceled()
|
if (JpsUtils.isJsKotlinModule(chunk.representativeTarget())) {
|
||||||
|
|
||||||
val isJsModule = JpsUtils.isJsKotlinModule(chunk.representativeTarget())
|
|
||||||
val changesInfo: ChangesInfo = when {
|
|
||||||
isJsModule -> ChangesInfo.NO_CHANGES
|
|
||||||
else -> {
|
|
||||||
val generatedClasses = generatedFiles.filterIsInstance<GeneratedJvmClass>()
|
|
||||||
val info = updateKotlinIncrementalCache(compilationErrors, incrementalCaches, generatedFiles, chunk)
|
|
||||||
updateJavaMappings(chunk, compilationErrors, context, dirtyFilesHolder, filesToCompile, generatedClasses)
|
|
||||||
updateLookupStorage(chunk, lookupTracker, dataManager, dirtyFilesHolder, filesToCompile)
|
|
||||||
info
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (compilationErrors) {
|
|
||||||
return ABORT
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isJsModule) {
|
|
||||||
copyJsLibraryFilesIfNeeded(chunk, project)
|
copyJsLibraryFilesIfNeeded(chunk, project)
|
||||||
|
return OK
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IncrementalCompilation.isEnabled()) {
|
if (!IncrementalCompilation.isEnabled()) {
|
||||||
return OK
|
return OK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
context.checkCanceled()
|
||||||
|
|
||||||
|
val generatedClasses = generatedFiles.filterIsInstance<GeneratedJvmClass>()
|
||||||
|
val changesInfo = updateKotlinIncrementalCache(compilationErrors, incrementalCaches, generatedFiles, chunk)
|
||||||
|
updateJavaMappings(chunk, compilationErrors, context, dirtyFilesHolder, filesToCompile, generatedClasses)
|
||||||
|
updateLookupStorage(chunk, lookupTracker, dataManager, dirtyFilesHolder, filesToCompile)
|
||||||
|
|
||||||
val caches = filesToCompile.keySet().map { incrementalCaches[it]!! }
|
val caches = filesToCompile.keySet().map { incrementalCaches[it]!! }
|
||||||
processChanges(context, chunk, allCompiledFiles, caches, changesInfo)
|
processChanges(context, chunk, allCompiledFiles, caches, changesInfo)
|
||||||
return ADDITIONAL_PASS_REQUIRED
|
return ADDITIONAL_PASS_REQUIRED
|
||||||
@@ -393,9 +384,7 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
|||||||
return sources
|
return sources
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IncrementalCompilation.isEnabled()) {
|
assert(IncrementalCompilation.isEnabled()) { "updateJavaMappings should not be called when incremental compilation disabled" }
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
val previousMappings = context.getProjectDescriptor().dataManager.getMappings()
|
val previousMappings = context.getProjectDescriptor().dataManager.getMappings()
|
||||||
val delta = previousMappings.createDelta()
|
val delta = previousMappings.createDelta()
|
||||||
@@ -431,9 +420,8 @@ public class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR
|
|||||||
generatedFiles: List<GeneratedFile>,
|
generatedFiles: List<GeneratedFile>,
|
||||||
chunk: ModuleChunk
|
chunk: ModuleChunk
|
||||||
): ChangesInfo {
|
): ChangesInfo {
|
||||||
if (!IncrementalCompilation.isEnabled()) {
|
|
||||||
return ChangesInfo.NO_CHANGES
|
assert(IncrementalCompilation.isEnabled()) { "updateKotlinIncrementalCache should not be called when incremental compilation disabled" }
|
||||||
}
|
|
||||||
|
|
||||||
chunk.targets.forEach { incrementalCaches[it]!!.saveCacheFormatVersion() }
|
chunk.targets.forEach { incrementalCaches[it]!!.saveCacheFormatVersion() }
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user