Move kapt compiler plugin classes to BundledCompilerPlugins
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* 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.cli.jvm
|
||||
|
||||
import org.jetbrains.kotlin.annotation.AnnotationCollectorCommandLineProcessor
|
||||
import org.jetbrains.kotlin.annotation.AnnotationCollectorComponentRegistrar
|
||||
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
|
||||
object BundledCompilerPlugins {
|
||||
|
||||
val componentRegistrars: List<ComponentRegistrar>
|
||||
get() = listOf(AnnotationCollectorComponentRegistrar())
|
||||
|
||||
val commandLineProcessors: List<CommandLineProcessor>
|
||||
get() = listOf(AnnotationCollectorCommandLineProcessor())
|
||||
|
||||
}
|
||||
@@ -21,8 +21,6 @@ import java.util.jar.JarFile
|
||||
import java.util.jar.Attributes
|
||||
import java.util.regex.Pattern
|
||||
import com.intellij.util.containers.MultiMap
|
||||
import org.jetbrains.kotlin.annotation.AnnotationCollectorCommandLineProcessor
|
||||
import org.jetbrains.kotlin.annotation.AnnotationCollectorComponentRegistrar
|
||||
import java.net.URLClassLoader
|
||||
import java.net.URL
|
||||
import java.io.File
|
||||
@@ -48,7 +46,7 @@ public object PluginCliParser {
|
||||
)
|
||||
|
||||
val componentRegistrars = ServiceLoader.load(javaClass<ComponentRegistrar>(), classLoader).toArrayList()
|
||||
componentRegistrars.add(AnnotationCollectorComponentRegistrar())
|
||||
componentRegistrars.addAll(BundledCompilerPlugins.componentRegistrars)
|
||||
configuration.addAll(ComponentRegistrar.PLUGIN_COMPONENT_REGISTRARS, componentRegistrars)
|
||||
|
||||
processPluginOptions(arguments, configuration, classLoader)
|
||||
@@ -65,7 +63,7 @@ public object PluginCliParser {
|
||||
} ?: mapOf()
|
||||
|
||||
val commandLineProcessors = ServiceLoader.load(javaClass<CommandLineProcessor>(), classLoader).toArrayList()
|
||||
commandLineProcessors.add(AnnotationCollectorCommandLineProcessor())
|
||||
commandLineProcessors.addAll(BundledCompilerPlugins.commandLineProcessors)
|
||||
|
||||
for (processor in commandLineProcessors) {
|
||||
val declaredOptions = processor.pluginOptions.valuesToMap { it.name }
|
||||
|
||||
Reference in New Issue
Block a user