@@ -23,6 +23,20 @@ class KotlinExtractorCommandLineProcessor : CommandLineProcessor {
2323 description = " Check whether different invocations produce identical TRAP" ,
2424 required = false ,
2525 allowMultipleOccurrences = false
26+ ),
27+ CliOption (
28+ optionName = OPTION_COMPILATION_STARTTIME ,
29+ valueDescription = " The start time of the compilation as a Unix timestamp" ,
30+ description = " The start time of the compilation as a Unix timestamp" ,
31+ required = false ,
32+ allowMultipleOccurrences = false
33+ ),
34+ CliOption (
35+ optionName = OPTION_EXIT_AFTER_EXTRACTION ,
36+ valueDescription = " Specify whether to call exitProcess after the extraction has completed" ,
37+ description = " Specify whether to call exitProcess after the extraction has completed" ,
38+ required = false ,
39+ allowMultipleOccurrences = false
2640 )
2741 )
2842
@@ -31,18 +45,30 @@ class KotlinExtractorCommandLineProcessor : CommandLineProcessor {
3145 value : String ,
3246 configuration : CompilerConfiguration
3347 ) = when (option.optionName) {
34- " invocationTrapFile" -> configuration.put(KEY_INVOCATION_TRAP_FILE , value)
35- " checkTrapIdentical" ->
36- when (value) {
37- " true" -> configuration.put(KEY_CHECK_TRAP_IDENTICAL , true )
38- " false" -> configuration.put(KEY_CHECK_TRAP_IDENTICAL , false )
39- else -> error(" kotlin extractor: Bad argument $value for checkTrapIdentical" )
40- }
48+ OPTION_INVOCATION_TRAP_FILE -> configuration.put(KEY_INVOCATION_TRAP_FILE , value)
49+ OPTION_CHECK_TRAP_IDENTICAL -> processBooleanOption(value, OPTION_CHECK_TRAP_IDENTICAL , KEY_CHECK_TRAP_IDENTICAL , configuration)
50+ OPTION_EXIT_AFTER_EXTRACTION -> processBooleanOption(value, OPTION_EXIT_AFTER_EXTRACTION , KEY_EXIT_AFTER_EXTRACTION , configuration)
51+ OPTION_COMPILATION_STARTTIME ->
52+ when (val v = value.toLongOrNull()) {
53+ is Long -> configuration.put(KEY_COMPILATION_STARTTIME , v)
54+ else -> error(" kotlin extractor: Bad argument $value for $OPTION_COMPILATION_STARTTIME " )
55+ }
4156 else -> error(" kotlin extractor: Bad option: ${option.optionName} " )
4257 }
58+
59+ private fun processBooleanOption (value : String , optionName : String , configKey : CompilerConfigurationKey <Boolean >, configuration : CompilerConfiguration ) =
60+ when (value) {
61+ " true" -> configuration.put(configKey, true )
62+ " false" -> configuration.put(configKey, false )
63+ else -> error(" kotlin extractor: Bad argument $value for $optionName " )
64+ }
4365}
4466
4567private val OPTION_INVOCATION_TRAP_FILE = " invocationTrapFile"
4668val KEY_INVOCATION_TRAP_FILE = CompilerConfigurationKey <String >(OPTION_INVOCATION_TRAP_FILE )
4769private val OPTION_CHECK_TRAP_IDENTICAL = " checkTrapIdentical"
4870val KEY_CHECK_TRAP_IDENTICAL = CompilerConfigurationKey <Boolean >(OPTION_CHECK_TRAP_IDENTICAL )
71+ private val OPTION_COMPILATION_STARTTIME = " compilationStartTime"
72+ val KEY_COMPILATION_STARTTIME = CompilerConfigurationKey <Long >(OPTION_COMPILATION_STARTTIME )
73+ private val OPTION_EXIT_AFTER_EXTRACTION = " exitAfterExtraction"
74+ val KEY_EXIT_AFTER_EXTRACTION = CompilerConfigurationKey <Boolean >(OPTION_EXIT_AFTER_EXTRACTION )
0 commit comments