Skip to content

Commit 9f17ea4

Browse files
authored
Add updated Gradle configuration for JDK 25 support and deprecation fixes (#2827)
* Fix deprecated Gradle syntax and Java compatibility settings for JDK 25 support * Updated configuration
1 parent 08ba857 commit 9f17ea4

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

build.gradle

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
* PS> gradle build -PbuildProfile=jre11 "-PexcludedGroups=['xSQLv15','xGradle']"
1010
****************************************************************/
1111

12-
apply plugin: 'java'
12+
plugins {
13+
id 'java'
14+
}
1315

1416
version = '13.2.0'
1517
def releaseExt = ''
@@ -42,8 +44,10 @@ if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile
4244
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
4345
}
4446
}
45-
sourceCompatibility = 25
46-
targetCompatibility = 25
47+
java {
48+
sourceCompatibility = JavaVersion.VERSION_25
49+
targetCompatibility = JavaVersion.VERSION_25
50+
}
4751
test {
4852
useJUnitPlatform {
4953
excludeTags(hasProperty('excludedGroups') ? excludedGroups : 'vectorTest','JSONTest')
@@ -60,8 +64,10 @@ if (hasProperty('buildProfile') && buildProfile == "jre21") {
6064
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
6165
}
6266
}
63-
sourceCompatibility = 21
64-
targetCompatibility = 21
67+
java {
68+
sourceCompatibility = JavaVersion.VERSION_21
69+
targetCompatibility = JavaVersion.VERSION_21
70+
}
6571
test {
6672
useJUnitPlatform {
6773
excludeTags(hasProperty('excludedGroups') ? excludedGroups : 'vectorTest','JSONTest')
@@ -78,8 +84,10 @@ if (hasProperty('buildProfile') && buildProfile == "jre17") {
7884
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
7985
}
8086
}
81-
sourceCompatibility = 17
82-
targetCompatibility = 17
87+
java {
88+
sourceCompatibility = JavaVersion.VERSION_17
89+
targetCompatibility = JavaVersion.VERSION_17
90+
}
8391
test {
8492
useJUnitPlatform {
8593
excludeTags(hasProperty('excludedGroups') ? excludedGroups : 'vectorTest','JSONTest')
@@ -96,8 +104,10 @@ if (hasProperty('buildProfile') && buildProfile == "jre11") {
96104
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
97105
}
98106
}
99-
sourceCompatibility = 11
100-
targetCompatibility = 11
107+
java {
108+
sourceCompatibility = JavaVersion.VERSION_11
109+
targetCompatibility = JavaVersion.VERSION_11
110+
}
101111
test {
102112
useJUnitPlatform {
103113
excludeTags(hasProperty('excludedGroups') ? excludedGroups : 'vectorTest','JSONTest')
@@ -110,8 +120,11 @@ if(hasProperty('buildProfile') && buildProfile == "jre8") {
110120
jreVersion = "jre8"
111121
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc43.java'
112122

113-
sourceCompatibility = 1.8
114-
targetCompatibility = 1.8
123+
java {
124+
sourceCompatibility = JavaVersion.VERSION_1_8
125+
targetCompatibility = JavaVersion.VERSION_1_8
126+
}
127+
115128
test {
116129
useJUnitPlatform {
117130
excludeTags (hasProperty('excludedGroups') ? excludedGroups : 'xSQLv15','xGradle','NTLM','reqExternalSetup','MSI','clientCertAuth','fedAuth','xJDBC42','vectorTest','JSONTest')

0 commit comments

Comments
 (0)