This plugin firmly integrates Dyvil tools into the Gradle ecosystem.
It automatically configures source sets (like src/main/dyvil
and src/test/dyvil
),
adds compilation tasks (like compileDyvil
and compileTestDyvil
),
and wires everything up to work properly with other languages and build tasks.
In addition to Dyvil compiler support, the plugin allows you to use GenSrc in your project.
It adds tasks that invoke the GenSrc compiler on your Java and Dyvil source directories (compileJavaGenSrc
, compileTestJavaGenSrc
, compileDyvilGenSrc
, and compileTestDyvilGenSrc
) and ensures they run before any compilation takes place.
To enable the plugin, add the following line to the plugins
DSL block of your build.gradle
:
plugins {
// ...
id 'org.dyvil.dyvil-gradle' version '0.5.0'
}
The plugin requires the Dyvil compiler and GenSrc artifacts, which are located on the JCenter repository. As such, we need to tell Gradle to use it:
repositories {
// ...
jcenter()
}
Configure the tool versions in the dependencies
DSL block:
dependencies {
// ...
// https://mvnrepository.com/artifact/org.dyvil/compiler
dyvilc group: 'org.dyvil', name: 'compiler', version: '???'
// https://mvnrepository.com/artifact/org.dyvil/gensrc
gensrc group: 'org.dyvil', name: 'gensrc', version: '???'
// ...
}
See build.gradle in the Dyvil Property Format repository for a complete example on how to use the plugin. It makes use of both the Dyvil and GenSrc compiler, with minimal build configuration.