| configurations { |
| etrice_c |
| etrice_cpp |
| etrice_java |
| |
| modelpath_c |
| modelpath_cpp |
| modelpath_java |
| } |
| |
| dependencies { |
| etrice_c project(':plugins:org.eclipse.etrice.generator.c') |
| etrice_cpp project(':plugins:org.eclipse.etrice.generator.cpp') |
| etrice_java project(':plugins:org.eclipse.etrice.generator.java') |
| } |
| |
| /** |
| * Creates an eTrice generator task |
| * @param name: The name of the new task |
| * @param lang: One of the following languages 'c', 'cpp', 'java' |
| * @param models: A list of models passed to the generator |
| * @param genDir: The generation directory |
| * @param options: The eTrice generator options |
| */ |
| ext.createGeneratorTask = { name, lang, models, genDir = 'src-gen', options = [] -> |
| return tasks.create(name: name, type: JavaExec) { |
| main = "org.eclipse.etrice.generator.${lang}.Main" |
| classpath = configurations."etrice_$lang" |
| args '-clean', '-msc_instr' |
| args '-genDir', genDir |
| args options |
| def modelpath = configurations."modelpath_$lang" |
| if(!modelpath.isEmpty()) { |
| args '-modelpath', modelpath.asPath |
| } |
| args models |
| } |
| } |