Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'gradle/etUnitConverter.gradle')
-rw-r--r--gradle/etUnitConverter.gradle22
1 files changed, 22 insertions, 0 deletions
diff --git a/gradle/etUnitConverter.gradle b/gradle/etUnitConverter.gradle
new file mode 100644
index 000000000..cd1369bde
--- /dev/null
+++ b/gradle/etUnitConverter.gradle
@@ -0,0 +1,22 @@
+
+def etUnitConverter = ':plugins:org.eclipse.etrice.etunit.converter'
+evaluationDependsOn(etUnitConverter)
+
+/**
+ * Creates a tasks that converts etu files to xml files
+ * @param name: The name of the new task
+ * @param etuFiles: A list of etu files
+ * @param options: The options passed to the converter
+ */
+ext.createEtUnitConverterTask = { name, etuFiles, options = [] ->
+ def xmlFiles = etuFiles.collect { it.replace('.etu', '.xml') }
+
+ return tasks.create(name: name, type: JavaExec, dependsOn: "$etUnitConverter:classes") {
+ main = project(etUnitConverter).mainClassName
+ classpath = project(etUnitConverter).sourceSets.main.runtimeClasspath
+ args options
+ args etuFiles
+ inputs.files etuFiles
+ outputs.files xmlFiles
+ }
+} \ No newline at end of file

Back to the top