[CHERRY PICKED FROM IJ] KotlinBuilder: cleanup code
GitOrigin-RevId: 156806aed03531438fcafdd8fba325a7101f01d9 Original commit: https://github.com/JetBrains/intellij-community/commit/021d5bc301c91e386ea363389f5d95c25d361531
This commit is contained in:
committed by
Nikita Bobko
parent
1f62859019
commit
0ee7187e3e
@@ -230,7 +230,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
ExpectActualTracker.DoNothing,
|
||||
chunk,
|
||||
messageCollector
|
||||
) ?: return
|
||||
)
|
||||
|
||||
val removedClasses = HashSet<String>()
|
||||
for (target in kotlinChunk.targets) {
|
||||
@@ -278,12 +278,12 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
context: CompileContext,
|
||||
chunk: ModuleChunk,
|
||||
dirtyFilesHolder: DirtyFilesHolder<JavaSourceRootDescriptor, ModuleBuildTarget>,
|
||||
outputConsumer: ModuleLevelBuilder.OutputConsumer
|
||||
): ModuleLevelBuilder.ExitCode {
|
||||
outputConsumer: OutputConsumer
|
||||
): ExitCode {
|
||||
if (chunk.isDummy(context))
|
||||
return NOTHING_DONE
|
||||
|
||||
val kotlinTarget = context.kotlinBuildTargets[chunk.representativeTarget()] ?: return OK
|
||||
val kotlinTarget = context.kotlin.targetsBinding[chunk.representativeTarget()] ?: return OK
|
||||
val messageCollector = MessageCollectorAdapter(context, kotlinTarget)
|
||||
|
||||
// New mpp project model: modules which is imported from sources sets of the compilations shouldn't be compiled for now.
|
||||
@@ -291,7 +291,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
if (chunk.modules.any { it.kotlinKind == KotlinModuleKind.SOURCE_SET_HOLDER }) {
|
||||
if (chunk.modules.size > 1) {
|
||||
messageCollector.report(
|
||||
CompilerMessageSeverity.ERROR,
|
||||
ERROR,
|
||||
"Cyclically dependent modules are not supported in multiplatform projects"
|
||||
)
|
||||
return ABORT
|
||||
@@ -335,7 +335,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
messageCollector: MessageCollectorAdapter,
|
||||
outputConsumer: OutputConsumer,
|
||||
fsOperations: FSOperationsHelper
|
||||
): ModuleLevelBuilder.ExitCode {
|
||||
): ExitCode {
|
||||
// Workaround for Android Studio
|
||||
if (representativeTarget is KotlinJvmModuleBuildTarget && !JavaBuilder.IS_ENABLED[context, true]) {
|
||||
messageCollector.report(INFO, "Kotlin JPS plugin is disabled")
|
||||
@@ -358,7 +358,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
}
|
||||
|
||||
val projectDescriptor = context.projectDescriptor
|
||||
val dataManager = projectDescriptor.dataManager
|
||||
val targets = chunk.targets
|
||||
|
||||
val isChunkRebuilding = JavaBuilderUtil.isForcedRecompilationAllJavaModules(context)
|
||||
@@ -403,7 +402,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
exceptActualTracer,
|
||||
chunk,
|
||||
messageCollector
|
||||
) ?: return ABORT
|
||||
)
|
||||
|
||||
context.testingContext?.buildLogger?.compilingFiles(
|
||||
kotlinDirtyFilesHolder.allDirtyFiles,
|
||||
@@ -591,7 +590,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
exceptActualTracer: ExpectActualTracker,
|
||||
chunk: ModuleChunk,
|
||||
messageCollector: MessageCollectorAdapter
|
||||
): JpsCompilerEnvironment? {
|
||||
): JpsCompilerEnvironment {
|
||||
val compilerServices = with(Services.Builder()) {
|
||||
kotlinModuleBuilderTarget.makeServices(this, incrementalCaches, lookupTracker, exceptActualTracer)
|
||||
build()
|
||||
@@ -646,7 +645,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
|
||||
val sourceToTarget = HashMap<File, ModuleBuildTarget>()
|
||||
if (chunk.targets.size > 1) {
|
||||
for (target in chunk.targets) {
|
||||
context.kotlinBuildTargets[target]?.sourceFiles?.forEach {
|
||||
context.kotlin.targetsBinding[target]?.sourceFiles?.forEach {
|
||||
sourceToTarget[it] = target
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user