Added JDK 12 and Gradle 5.4.1 instructions. Closes #6
This commit is contained in:
parent
0ca574695f
commit
fb593a0a1a
2 changed files with 19 additions and 0 deletions
14
README.md
14
README.md
|
@ -18,6 +18,7 @@ This processor was inspired by Cédric Beust's [version-processor](https://githu
|
||||||
- [Gradle](#gradle)
|
- [Gradle](#gradle)
|
||||||
- [Class Generation](#class-generation)
|
- [Class Generation](#class-generation)
|
||||||
- [Class & Source Generation](#class--source-generation)
|
- [Class & Source Generation](#class--source-generation)
|
||||||
|
- [Java 12](#java-12)
|
||||||
- [Kotlin](#kotlin)
|
- [Kotlin](#kotlin)
|
||||||
- [Kotlin & Gradle](#kotlin--gradle)
|
- [Kotlin & Gradle](#kotlin--gradle)
|
||||||
- [Kobalt](#kobalt)
|
- [Kobalt](#kobalt)
|
||||||
|
@ -222,6 +223,19 @@ compileJava.options.annotationProcessorGeneratedSourcesDirectory = file("${proje
|
||||||
|
|
||||||
The `GeneratedVersion.java` file will now be located in `src/generated`.
|
The `GeneratedVersion.java` file will now be located in `src/generated`.
|
||||||
|
|
||||||
|
|
||||||
|
#### Java 12
|
||||||
|
|
||||||
|
When using properties file (`version.properties`) under Java 12+ and Gradle 5.4.1+, the directory containing the properties file must be specified using the `semver.project.dir` processor argument.
|
||||||
|
|
||||||
|
For example, if the properties file is in the Gradle project directory:
|
||||||
|
|
||||||
|
```gradle
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
Please look at [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle) in the [Java example](https://github.com/ethauvin/semver/tree/master/examples/java) directory for a sample.
|
Please look at [build.gradle](https://github.com/ethauvin/semver/blob/master/examples/java/build.gradle) in the [Java example](https://github.com/ethauvin/semver/tree/master/examples/java) directory for a sample.
|
||||||
|
|
||||||
### Kotlin
|
### Kotlin
|
||||||
|
|
|
@ -28,6 +28,11 @@ dependencies {
|
||||||
implementation semverProcessor
|
implementation semverProcessor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For Java 12+
|
||||||
|
tasks.withType(JavaCompile) {
|
||||||
|
options.compilerArgs += [ "-Asemver.project.dir=$projectDir" ]
|
||||||
|
}
|
||||||
|
|
||||||
task runExample(type: JavaExec) {
|
task runExample(type: JavaExec) {
|
||||||
group = 'application'
|
group = 'application'
|
||||||
classpath = sourceSets.main.runtimeClasspath
|
classpath = sourceSets.main.runtimeClasspath
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue