@@ -4,6 +4,21 @@ import org.asciidoctor.gradle.jvm.AsciidoctorTask
44/*
55 Gradle build script for Jaybird - Firebird JDBC driver.
66
7+ Define target Java version:
8+ - -PbuildProfile=17 : Java 17 (supported)
9+ or not specified
10+ - -PbuildProfile=NN : Java NN (not publishable)
11+ with NN > 17
12+
13+ Build profiles other than 17 will not be published to Maven.
14+
15+ Define (other) Java version to test:
16+ - -PtestProfile=NN with NN >= 17
17+
18+ If not specified, the test profile is the same as buildProfile.
19+
20+ For historic reasons, both buildProfile and testProfile also accept javaNN.
21+
722 Uploading archives:
823
924 publish -PcredentialsPassphrase=<credentials password>
@@ -27,9 +42,21 @@ version = project.'version.maven'
2742allprojects {
2843 tasks. withType(JavaCompile ). configureEach {
2944 options. encoding = ' UTF-8'
45+ options. release = project. buildJava
46+ javaCompiler = javaToolchains. compilerFor {
47+ languageVersion = JavaLanguageVersion . of((int ) project. buildJava)
48+ }
3049 }
3150 tasks. withType(Test ). configureEach {
3251 systemProperty ' file.encoding' , ' UTF-8'
52+ javaLauncher = javaToolchains. launcherFor {
53+ languageVersion = JavaLanguageVersion . of((int ) project. testJava)
54+ }
55+ }
56+ tasks. withType(Javadoc ). configureEach {
57+ javadocTool = javaToolchains. javadocToolFor {
58+ languageVersion = JavaLanguageVersion . of((int ) project. buildJava)
59+ }
3360 }
3461}
3562
3865}
3966
4067java {
41- sourceCompatibility = JavaVersion . VERSION_17
42- targetCompatibility = JavaVersion . VERSION_17
68+ def javaVersion = JavaLanguageVersion . of((int ) project. buildJava)
69+ sourceCompatibility = javaVersion
70+ targetCompatibility = javaVersion
4371 withJavadocJar()
4472 withSourcesJar()
4573}
@@ -158,13 +186,12 @@ tasks.named('assemble') {
158186jar {
159187 manifest {
160188 attributes(
161- ' Created-By' : " ${ System.getProperty('java.vm.version')} (${ System.getProperty('java.vm.vendor')} )" ,
162189 ' Specification-Title' : project. ' specification.title' ,
163190 ' Specification-Version' : project. ' specification.version' ,
164191 ' Specification-Vendor' : project. ' specification.vendor' ,
165192 ' Implementation-Title' : project. ' implementation.title' ,
166193 ' Implementation-Url' : project. ' implementation.url' ,
167- ' Implementation-Version' : " $project . version (build: variant=$project . mavenName tag=${ project.'version.svntag'} date=${ project.'build.id'} )" ,
194+ ' Implementation-Version' : " $project . version (build: variant=$project . mavenName tag=${ project.'version.svntag'} date=${ project.'build.id'} java= ${ project.buildJava } )" ,
168195 ' Implementation-Vendor' : project. ' implementation.vendor' ,
169196 ' Implementation-Vendor-Id' : project. ' implementation.vendor.id'
170197 )
0 commit comments