add starter shell script and cleanup jar CLI options

This commit is contained in:
2021-09-27 20:41:51 +02:00
parent 7f09cd6907
commit 6c353eb77c
2 changed files with 51 additions and 6 deletions

View File

@ -89,6 +89,7 @@ class GeneratorMain {
throw new ParseException("error validating " + resource.URI)
}
// Configure and start the generator
resource.runGenerator(params.outputFile)
logger.info('Code generation for ' + file + ' finished')
}
} catch (MalformedParametersException | IllegalArgumentException | ParseException e) {
@ -98,14 +99,14 @@ class GeneratorMain {
return 0
}
def runGenerator(Resource resource, File template, File outputFile){
logger.info('Running generator to generate '+outputFile+' using template '+template)
if(template !== null) System.properties.put("template", template)
def runGenerator(Resource resource, File outputFile){
if(outputFile !== null){
System.properties.put("outputFile", outputFile.name)
fsa.outputPath = outputFile.parentFile.absolutePath
} else
logger.info('Running generator to generate files in '+outputFile)
fsa.outputPath = outputFile.absolutePath
} else {
logger.info('Running generator to generate files')
fsa.outputPath = './'
}
val outputCfg = fsa.outputConfigurations.get(IFileSystemAccess.DEFAULT_OUTPUT)
outputCfg.setOverrideExistingResources(true)
val context = new GeneratorContext => [cancelIndicator = CancelIndicator.NullImpl]