AllOpen, NoArg: Refactoring, support presets in order to hold special annotations for Spring and JPA in one place

This commit is contained in:
Yan Zhulanow
2017-01-31 19:03:40 +03:00
parent f4690ebff9
commit feb5397f6f
9 changed files with 58 additions and 49 deletions
@@ -116,12 +116,6 @@ class Kapt3CommandLineProcessor : CommandLineProcessor {
listOf(SOURCE_OUTPUT_DIR_OPTION, ANNOTATION_PROCESSOR_CLASSPATH_OPTION, APT_OPTIONS_OPTION,
CLASS_OUTPUT_DIR_OPTION, VERBOSE_MODE_OPTION, STUBS_OUTPUT_DIR_OPTION, APT_ONLY_OPTION, USE_LIGHT_ANALYSIS_OPTION)
private fun <T> CompilerConfiguration.appendList(option: CompilerConfigurationKey<List<T>>, value: T) {
val paths = getList(option).toMutableList()
paths.add(value)
put(option, paths)
}
override fun processOption(option: CliOption, value: String, configuration: CompilerConfiguration) {
when (option) {
ANNOTATION_PROCESSOR_CLASSPATH_OPTION -> configuration.appendList(ANNOTATION_PROCESSOR_CLASSPATH, value)