From ebf87a21feaf6f578483c3598cb313bf421a38e9 Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Thu, 28 Oct 2021 21:50:28 +0200 Subject: [PATCH] [CHERRY PICKED FROM IJ] IJ-MR-16150 [Kotlin JPS] Drop unused KotlinJpsCompilerArgumentsProvider * I failed to find any implementations of this interface * API Watcher doesn't show any implementations either * Any meaningful code changes around this extension point hasn't been ever done since it's introduction in 2014 The extension point was once used in Android Extensions, as they supported JPS. Since that time, JPS support was practically dropped in Android projects, and we decided to delete the extension. GitOrigin-RevId: 170c97194b27152189ce05b828a53116b746db38 Original commit: https://github.com/JetBrains/intellij-community/commit/248c9b4947f7ea535d5f70e511554b05851f7ec7 --- .../kotlin/jps/build/KotlinBuilder.kt | 26 ------------------- .../KotlinJpsCompilerArgumentsProvider.kt | 25 ------------------ 2 files changed, 51 deletions(-) delete mode 100644 jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt index 323b9ea91e2..8a845302b86 100644 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt +++ b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinBuilder.kt @@ -524,8 +524,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) { environment: JpsCompilerEnvironment, incrementalCaches: Map, JpsIncrementalCache> ): OutputItemsCollector? { - loadPlugins(representativeTarget, commonArguments, context) - kotlinChunk.targets.forEach { it.nextRound(context) } @@ -562,30 +560,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) { return if (isDoneSomething) environment.outputItemsCollector else null } - private fun loadPlugins( - representativeTarget: KotlinModuleBuildTarget<*>, - commonArguments: CommonCompilerArguments, - context: CompileContext - ) { - fun concatenate(strings: Array?, cp: List) = arrayOf(*strings.orEmpty(), *cp.toTypedArray()) - - for (argumentProvider in ServiceLoader.load(KotlinJpsCompilerArgumentsProvider::class.java)) { - val jpsModuleBuildTarget = representativeTarget.jpsModuleBuildTarget - // appending to pluginOptions - commonArguments.pluginOptions = concatenate( - commonArguments.pluginOptions, - argumentProvider.getExtraArguments(jpsModuleBuildTarget, context) - ) - // appending to classpath - commonArguments.pluginClasspaths = concatenate( - commonArguments.pluginClasspaths, - argumentProvider.getClasspath(jpsModuleBuildTarget, context) - ) - - LOG.debug("Plugin loaded: ${argumentProvider::class.java.simpleName}") - } - } - private fun createCompileEnvironment( context: CompileContext, kotlinModuleBuilderTarget: KotlinModuleBuildTarget<*>, diff --git a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt b/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt deleted file mode 100644 index 20513a1f2cc..00000000000 --- a/jps/jps-plugin/src/org/jetbrains/kotlin/jps/build/KotlinJpsCompilerArgumentsProvider.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2010-2015 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.kotlin.jps.build - -import org.jetbrains.jps.incremental.CompileContext -import org.jetbrains.jps.incremental.ModuleBuildTarget - -interface KotlinJpsCompilerArgumentsProvider { - fun getExtraArguments(moduleBuildTarget: ModuleBuildTarget, context: CompileContext): List - fun getClasspath(moduleBuildTarget: ModuleBuildTarget, context: CompileContext): List -} \ No newline at end of file