39 lines
893 B
Groovy
39 lines
893 B
Groovy
plugins {
|
|
id 'java'
|
|
id 'application'
|
|
id 'com.github.ben-manes.versions' version '0.39.0'
|
|
}
|
|
|
|
// ./gradlew run
|
|
// ./gradlew runExample
|
|
|
|
defaultTasks 'run'
|
|
|
|
final def semverProcessor = 'net.thauvin.erik:semver:1.2.1-SNAPSHOT'
|
|
|
|
sourceCompatibility = 1.8
|
|
targetCompatibility = 1.8
|
|
|
|
mainClassName = 'com.example.App'
|
|
|
|
repositories {
|
|
mavenLocal()
|
|
mavenCentral()
|
|
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots") }
|
|
}
|
|
|
|
dependencies {
|
|
annotationProcessor semverProcessor
|
|
implementation semverProcessor
|
|
}
|
|
|
|
tasks.withType(JavaCompile) {
|
|
options.generatedSourceOutputDirectory.set(file("${projectDir}/src/generated/java"))
|
|
options.compilerArgs += ["-Asemver.project.dir=$projectDir"]
|
|
}
|
|
|
|
task runExample(type: JavaExec) {
|
|
group = 'application'
|
|
classpath = sourceSets.main.runtimeClasspath
|
|
mainClass.set('com.example.Example')
|
|
}
|