blob: 423528b991e51a5e2bf17f95cac9d0855ea586ba [file] [log] [blame]
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')
etrice_c project(':plugins:org.eclipse.etrice.generator.contractmonitor')
etrice_cpp project(':plugins:org.eclipse.etrice.generator.contractmonitor')
etrice_java project(':plugins:org.eclipse.etrice.generator.contractmonitor')
}
/**
* 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) {
// accessible for later use
ext.lang = lang
ext.modelpath = configurations."modelpath_$lang"
main = "org.eclipse.etrice.generator.${lang}.Main"
classpath = configurations."etrice_$lang"
args '-clean', '-msc_instr'
args '-genDir', genDir
args options
if(!modelpath.isEmpty()) {
args '-modelpath', modelpath.asPath
}
args models
}
}