Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Java 21 #1062

Merged
merged 8 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17.0.7
java-version: 21.0.3

- name: Set environment variable
if: github.event.action == 'check_connector_for_breaking_changes'
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ Follow one of the following ways to add the JAR in the file:

* Download the JAR and update the path.
```
[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "PATH"
```

* Add JAR with the maven dependency params.
```
[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.microsoft.sqlserver"
artifactId = "mssql-jdbc"
version = "10.2.0.jre17"
version = "12.8.1.jre11"
```

### Client
Expand Down Expand Up @@ -490,8 +490,8 @@ This repository only contains the source code for the package.

### Set up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/javase/jdk17-archive-downloads.html)
1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/javase/jdk21-archive-downloads.html)
* [OpenJDK](https://adoptium.net/)

2. Download and install [Docker](https://www.docker.com/get-started).
Expand Down
8 changes: 4 additions & 4 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ keywords = ["database", "client", "network", "SQL", "RDBMS", "SQLServer", "MSSQL
repository = "https://github.com/ballerina-platform/module-ballerinax-mssql"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.11.0-20241112-214900-6b80ab87"

[platform.java17]
[platform.java21]
graalvmCompatible = true

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "mssql-native"
version = "1.13.1"
path = "../native/build/libs/mssql-native-1.13.1.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "sql-native"
version = "1.14.0"
Expand Down
4 changes: 2 additions & 2 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.10.0"
distribution-version = "2201.10.0-20241025-103700-5c9e6a27"

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -71,7 +71,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.12.0"
version = "2.13.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down
6 changes: 3 additions & 3 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ Follow one of the following ways to add the JAR in the file:

* Download the JAR and update the path.
```
[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "PATH"
```

* Add JAR with the maven dependency params.
```
[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.microsoft.sqlserver"
artifactId = "mssql-jdbc"
version = "10.2.0.jre17"
version = "12.8.1.jre11"
```

### Client
Expand Down
6 changes: 3 additions & 3 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,16 @@ Follow one of the following ways to add the JAR in the file:

* Download the JAR and update the path.
```
[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "PATH"
```

* Add JAR with the maven dependency params.
```
[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.microsoft.sqlserver"
artifactId = "mssql-jdbc"
version = "10.2.0.jre17"
version = "12.8.1.jre11"
```

### Client
Expand Down
3 changes: 2 additions & 1 deletion ballerina/tests/call-procedures-test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ function testMoneyProcedureCall() returns error? {
}

@test:Config {
groups: ["procedures"]
groups: ["procedures"],
ravinperera00 marked this conversation as resolved.
Show resolved Hide resolved
enable: false
}
function testTimestamptzRetrieval() returns error? {
string datetimetz = "2021-07-21T19:14:51.00+01:30";
Expand Down
8 changes: 4 additions & 4 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@ keywords = ["database", "client", "network", "SQL", "RDBMS", "SQLServer", "MSSQL
repository = "https://github.com/ballerina-platform/module-ballerinax-mssql"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.11.0-20241112-214900-6b80ab87"

[platform.java17]
[platform.java21]
graalvmCompatible = true

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "mssql-native"
version = "@toml.version@"
path = "../native/build/libs/mssql-native-@project.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "sql-native"
version = "@sql.version@"
Expand Down
4 changes: 4 additions & 0 deletions build-config/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,8 @@
<Class name="io.ballerina.stdlib.mssql.parameterprocessor.MssqlStatementParameterProcessor"/>
<Bug pattern="MS_EXPOSE_REP" />
</Match>
<Match>
<Class name="io.ballerina.stdlib.mssql.parameterprocessor.MssqlStatementParameterProcessor"/>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR" />
</Match>
</FindBugsFilter>
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ subprojects {
ballerinaStdLibs "io.ballerina.stdlib:uuid-ballerina:${stdlibUuidVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mime-ballerina:${stdlibMimeVersion}"
ballerinaStdLibs "io.ballerina.stdlib:cache-ballerina:${stdlibCacheVersion}"
ballerinaStdLibs "io.ballerina.lib:data.jsondata-ballerina:${stdlibDataJsonDataVersion}"
ballerinaStdLibs "io.ballerina.stdlib:auth-ballerina:${stdlibAuthVersion}"
ballerinaStdLibs "io.ballerina.stdlib:jwt-ballerina:${stdlibJwtVersion}"
ballerinaStdLibs "io.ballerina.stdlib:oauth2-ballerina:${stdlibOAuth2Version}"
Expand Down
9 changes: 6 additions & 3 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21

test {
systemProperty "ballerina.offline.flag", "true"
Expand Down Expand Up @@ -79,9 +79,12 @@ jacocoTestReport {
}

spotbugsTest {
def classLoader = plugins["com.github.spotbugs"].class.classLoader
def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence")
def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort")
effort = SpotBugsEffort.MAX
reportLevel = SpotBugsConfidence.LOW
ignoreFailures = true
effort = "max"
reportLevel = "low"
reportsDir = file("$project.buildDir/reports/spotbugs")
def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml")
if (excludeFile.exists()) {
Expand Down
7 changes: 5 additions & 2 deletions compiler-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,11 @@ checkstyle {
checkstyleMain.dependsOn(":checkstyle:downloadCheckstyleRuleFiles")

spotbugsMain {
effort "max"
reportLevel "low"
def classLoader = plugins["com.github.spotbugs"].class.classLoader
def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence")
def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort")
effort = SpotBugsEffort.MAX
reportLevel = SpotBugsConfidence.LOW
reportsDir = file("$project.buildDir/reports/spotbugs")
reports {
html.enabled true
Expand Down
49 changes: 25 additions & 24 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,60 +2,61 @@ group=io.ballerina.stdlib
version=1.13.2-SNAPSHOT

puppycrawlCheckstyleVersion=10.12.0
msSQLDriverVersion=10.2.0.jre17
msSQLDriverVersion=12.8.1.jre11
checkstyleToolVersion=10.12.0
githubSpotbugsVersion=5.0.14
githubSpotbugsVersion=6.0.18
githubJohnrengelmanShadowVersion=8.1.0
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
testngVersion=7.6.1
ballerinaGradlePluginVersion=2.0.1

ballerinaLangVersion=2201.10.0
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87

stdlibSqlVersion=1.14.0
stdlibSqlVersion=1.15.0-20241116-124800-0bc6a40

# Direct Dependencies
# Level 01
stdlibIoVersion=1.6.1
stdlibTimeVersion=2.4.0
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
stdlibTimeVersion=2.6.0-20241113-073800-201b904

# Level 02
stdlibLogVersion=2.10.0
stdlibOsVersion=1.8.0
stdlibLogVersion=2.10.1-20241113-120000-4577868
stdlibOsVersion=1.8.1-20241113-122000-cca973b

# Level 03
stdlibFileVersion=1.10.0
stdlibFileVersion=1.10.1-20241113-151700-e1a2e38

# Ballerinax Observer
observeVersion=1.3.0
observeInternalVersion=1.3.0
observeVersion=1.4.0-20241113-092000-b83ae74
observeInternalVersion=1.3.1-20241113-101700-265054d

# Transitive Dependencies
# Level 01
stdlibConstraintVersion=1.5.0
stdlibUrlVersion=2.4.0
stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5
stdlibUrlVersion=2.4.1-20241113-073900-335ff51

# Level 02
stdlibCryptoVersion=2.7.2
stdlibTaskVersion=2.5.0
stdlibCryptoVersion=2.7.3-20241113-081400-d015a39
stdlibTaskVersion=2.5.1-20241113-123500-f905281

# Level 03
stdlibCacheVersion=3.8.0
stdlibMimeVersion=2.10.0
stdlibUuidVersion=1.8.0
stdlibCacheVersion=3.8.1-20241113-125700-b75a1bf
stdlibMimeVersion=2.10.2-20241113-154200-d953747
stdlibUuidVersion=1.8.1-20241113-154400-443c67b

# Level 04
stdlibAuthVersion=2.12.0
stdlibJwtVersion=2.13.0
stdlibOAuth2Version=2.12.0
stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739
stdlibAuthVersion=2.12.1-20241113-162300-ded40eb
stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa
stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe

# Level 05
stdlibHttpVersion=2.12.0
stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a

# Level 06
stdlibTransactionVersion=1.10.0
stdlibTransactionVersion=1.10.1-20241116-112500-189a4e5

# Ballerina library
stdlibMssqlDriverVersion=1.6.0
stdlibMssqlDriverVersion=1.6.1-20241116-205000-d3351e2

9 changes: 6 additions & 3 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21

jacoco {
toolVersion = "0.8.6"
Expand All @@ -64,9 +64,12 @@ test {
}

spotbugsMain {
def classLoader = plugins["com.github.spotbugs"].class.classLoader
def SpotBugsConfidence = classLoader.findLoadedClass("com.github.spotbugs.snom.Confidence")
def SpotBugsEffort = classLoader.findLoadedClass("com.github.spotbugs.snom.Effort")
effort = SpotBugsEffort.MAX
reportLevel = SpotBugsConfidence.LOW
ignoreFailures = true
effort = "max"
reportLevel = "low"
reportsDir = file("$project.buildDir/reports/spotbugs")
def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml")
if (excludeFile.exists()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package io.ballerina.stdlib.mssql.utils;

import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.types.Field;
import io.ballerina.runtime.api.types.StructureType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BDecimal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package io.ballerina.stdlib.mssql.utils;

import com.microsoft.sqlserver.jdbc.Geometry;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BDecimal;
Expand Down
Loading