blob: 7f5d0ab3e3bf3f796e01f47b05b84044906a57bf (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
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
* @return the generator task
*/
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
}
}
|