@@ -10,9 +10,8 @@ group 'io.github.jopenlibs'
1010archivesBaseName = ' vault-java-driver'
1111version ' 5.4.0'
1212
13- // This project is actually limited to Java 8 compatibility. See below.
14- sourceCompatibility = 9
15- targetCompatibility = 9
13+ sourceCompatibility = 11
14+ targetCompatibility = 11
1615
1716repositories {
1817 mavenCentral()
@@ -31,46 +30,14 @@ dependencies {
3130 testRuntimeOnly(' org.slf4j:slf4j-simple:2.0.3' )
3231}
3332
34- // Beginning of Java 9 compatibility config
35- //
36- // Allowing a library to support Java 9+ modularity, while also maintaining backwards-compatibility for Java 8 users, is WAY more
37- // tricky than expected! The lines below are adapted from a blog article (https://dzone.com/articles/building-java-6-8-libraries-for-jpms-in-gradle),
38- // and cause the built classes to support a Java 8 JRE, while also including a module definition suitable for use with Java 9. There are a
39- // few considerations that come with this:
40- //
41- // * You now need JDK 9 or higher to BUILD this library. You can still USE the built artifact as a dependency in a Java 8 project.
42- // * Although "sourceCompatibility" and "targetCompatability" above are set for Java 9, the "compileJava" settings below will not
43- // allow you to build with any code changes that are not Java 8 compatible.
44- // * Unfortunately, IntelliJ (and perhaps other IDE's?) will show syntax highlighting, code completion tips, etc for Java 9. Sorry for
45- // the inconvenience. In any case, you should not commit changes to source control without confirming that the project builds.
4633compileJava {
47- exclude ' module-info.java'
48-
49- options. compilerArgs = [' --release' , ' 8' ]
34+ options. compilerArgs = [' --release' , targetCompatibility. toString()]
5035}
5136
5237tasks. withType(JavaCompile ). configureEach {
5338 options. encoding = ' UTF-8'
5439}
5540
56- tasks. register(' compileModuleInfoJava' , JavaCompile ) {
57- classpath = files()
58- source = ' src/main/java/module-info.java'
59- destinationDir = compileJava. destinationDir
60- options. encoding = compileJava. options. encoding
61-
62- doFirst {
63- options. compilerArgs = [
64- ' --release' , ' 9' ,
65- ' --module-path' , compileJava. classpath. asPath,
66- ]
67- }
68- }
69-
70- compileModuleInfoJava. dependsOn compileJava
71- classes. dependsOn compileModuleInfoJava
72- // End of Java 9 compatibility config
73-
7441tasks. register(' javadocJar' , Jar ) {
7542 dependsOn tasks. named(" javadoc" )
7643 archiveClassifier. set(' javadoc' )
@@ -115,8 +82,14 @@ tasks.named('test') {
11582 events " passed" , " skipped" , " failed"
11683 }
11784
118- reports. html. enabled = false
119- reports. junitXml. enabled = true
85+ reports {
86+ html {
87+ required = false
88+ }
89+ junitXml {
90+ required = true
91+ }
92+ }
12093}
12194
12295def integrationTestTask = tasks. register(' integrationTest' , Test ) {
@@ -127,8 +100,14 @@ def integrationTestTask = tasks.register('integrationTest', Test) {
127100 events " passed" , " skipped" , " failed"
128101 }
129102
130- reports. html. enabled = false
131- reports. junitXml. enabled = true
103+ reports {
104+ html {
105+ required = false
106+ }
107+ junitXml {
108+ required = true
109+ }
110+ }
132111}
133112
134113//
0 commit comments