Edit on GitHub

[Pro] Headless: Gradle


Invoke headless code generation with Gradle.

Integration in Gradle

While both Maven and Ant rely on a xml file to specify the build process, Gradle uses a DSL (domain specific language) based on Groovy. This allows Gradle to have the shortest build configuration file of the three Java build tools mentioned here. Also, keep in mind that Gradle isn’t only a Java build tool, but can be used to build projects such as C/C++ and Android, as well. This script, named build.gradle, is located in the project root. It will allow you to build the project from the Ant and Maven example.

apply plugin: 'java'apply plugin: 'application'mainClassName = 'hello.HelloWorld'jar { baseName = 'sct-gradle-example' version = '0.1.0' manifest { attributes 'Main-Class': 'hello.HelloWorld' }}task generateStatechart(type:Exec) { commandLine 'scc'}compileJava.dependsOn(generateStatechart)

Just like with Ant and Maven, the important part is the task specification (generateStatechart) and defining that compiling the Java depends on that task.

Download examples

Drag to install

Drag to your running YAKINDU Statechart Tools (min. version 2.8.0) workspace.

Back to overview