[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
This commit is contained in:
Nikita Bobko
2021-10-28 21:50:28 +02:00
parent 93d569d090
commit ebf87a21fe
2 changed files with 0 additions and 51 deletions
@@ -524,8 +524,6 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
environment: JpsCompilerEnvironment,
incrementalCaches: Map<KotlinModuleBuildTarget<*>, 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<String>?, cp: List<String>) = 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<*>,
@@ -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<String>
fun getClasspath(moduleBuildTarget: ModuleBuildTarget, context: CompileContext): List<String>
}