Skip to content

Commit

Permalink
JDK 18 support
Browse files Browse the repository at this point in the history
  • Loading branch information
tkyc committed Apr 19, 2022
1 parent bec8717 commit 57e422d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: actions/setup-java@v2
with:
distribution: microsoft
java-version: '17'
java-version: '18'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ test {
}
}

if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre17")){
if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile == "jre18")) {

jreVersion = "jre18"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
jar {
manifest {
attributes 'Automatic-Module-Name': 'com.microsoft.sqlserver.jdbc'
}
}
sourceCompatibility = 18
targetCompatibility = 18
}

if (hasProperty('buildProfile') && buildProfile == "jre17") {

jreVersion = "jre17"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
Expand All @@ -45,7 +58,7 @@ if (!hasProperty('buildProfile') || (hasProperty('buildProfile') && buildProfile
targetCompatibility = 17
}

if (hasProperty('buildProfile') && buildProfile == "jre11"){
if (hasProperty('buildProfile') && buildProfile == "jre11") {

jreVersion = "jre11"
excludedFile = 'com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java'
Expand Down
41 changes: 37 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,6 @@
</profile>
<profile>
<id>jre17</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<finalName>${project.artifactId}-${project.version}.jre17${releaseExt}</finalName>
<plugins>
Expand Down Expand Up @@ -356,6 +353,42 @@
</plugins>
</build>
</profile>
<profile>
<id>jre18</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<finalName>${project.artifactId}-${project.version}.jre18${releaseExt}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<excludes>
<exclude>**/com/microsoft/sqlserver/jdbc/SQLServerJdbc42.java</exclude>
</excludes>
<source>18</source>
<target>18</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.1.1</version>
<configuration>
<archive>
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
<manifestEntries>
<Automatic-Module-Name>com.microsoft.sqlserver.jdbc</Automatic-Module-Name>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<build>
<resources>
Expand Down Expand Up @@ -497,7 +530,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<version>0.8.8</version>
<executions>
<execution>
<id>pre-test</id>
Expand Down

0 comments on commit 57e422d

Please sign in to comment.