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
@@ -90,12 +90,6 @@ class AnnotationProcessingCommandLineProcessor : CommandLineProcessor {
listOf(GENERATED_OUTPUT_DIR_OPTION, ANNOTATION_PROCESSOR_CLASSPATH_OPTION, APT_OPTIONS_OPTION,
CLASS_FILES_OUTPUT_DIR_OPTION, INCREMENTAL_DATA_FILE_OPTION, VERBOSE_MODE_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)