Skip to content

Commit

Permalink
Merge pull request #753 from warunalakshitha/syncJava21
Browse files Browse the repository at this point in the history
Migrate to Java21
  • Loading branch information
warunalakshitha authored Nov 19, 2024
2 parents c341eb2 + 8552401 commit d25996e
Show file tree
Hide file tree
Showing 25 changed files with 120 additions and 219 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ 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).
1. Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)

Expand Down
12 changes: 6 additions & 6 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,27 @@ keywords = ["database", "client", "network", "SQL", "RDBMS"]
repository = "https://github.com/ballerina-platform/module-ballerina-sql"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.10.0-20241019-091600-89e54c08"

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

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "../test-utils/build/libs/sql-test-utils-1.14.2-SNAPSHOT.jar"
scope = "testOnly"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.zaxxer"
artifactId = "HikariCP"
version = "3.3.1"
path = "./lib/HikariCP-3.3.1.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/hsqldb-2.7.1.jar"
scope = "testOnly"
43 changes: 20 additions & 23 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.10.0"
distribution-version = "2201.10.0-20241019-091600-89e54c08"

[[package]]
org = "ballerina"
name = "auth"
version = "2.12.0"
version = "2.12.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "crypto"},
Expand All @@ -23,19 +23,18 @@ dependencies = [
[[package]]
org = "ballerina"
name = "cache"
version = "3.8.0"
version = "3.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "constraint"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "task"},
{org = "ballerina", name = "time"}
{org = "ballerina", name = "task"}
]

[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.0"
version = "1.5.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -44,7 +43,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.2"
version = "2.7.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -54,7 +53,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "file"
version = "1.10.0"
version = "1.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -69,7 +68,7 @@ modules = [
[[package]]
org = "ballerina"
name = "http"
version = "2.12.1"
version = "2.13.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "auth"},
Expand Down Expand Up @@ -98,7 +97,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.2"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand All @@ -118,7 +117,7 @@ modules = [
[[package]]
org = "ballerina"
name = "jwt"
version = "2.13.0"
version = "2.13.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "cache"},
Expand All @@ -127,8 +126,7 @@ dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.int"},
{org = "ballerina", name = "lang.string"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "time"}
{org = "ballerina", name = "log"}
]

[[package]]
Expand Down Expand Up @@ -245,7 +243,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.10.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -257,7 +255,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "mime"
version = "2.10.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -269,21 +267,20 @@ dependencies = [
[[package]]
org = "ballerina"
name = "oauth2"
version = "2.12.0"
version = "2.12.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "cache"},
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "time"},
{org = "ballerina", name = "url"}
]

[[package]]
org = "ballerina"
name = "observe"
version = "1.3.0"
version = "1.3.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -292,7 +289,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "os"
version = "1.8.0"
version = "1.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand Down Expand Up @@ -322,7 +319,7 @@ modules = [
[[package]]
org = "ballerina"
name = "task"
version = "2.5.0"
version = "2.5.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -346,7 +343,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.5.1"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -357,7 +354,7 @@ modules = [
[[package]]
org = "ballerina"
name = "url"
version = "2.4.0"
version = "2.4.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -366,7 +363,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "uuid"
version = "1.8.0"
version = "1.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "crypto"},
Expand Down
10 changes: 5 additions & 5 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.11.0"

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

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "../test-utils/build/libs/[email protected]@.jar"
scope = "testOnly"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.zaxxer"
artifactId = "HikariCP"
version = "@hikkaricp.lib.version@"
path = "./lib/[email protected]@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
scope = "testOnly"
12 changes: 12 additions & 0 deletions build-config/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,16 @@
<Method name="getInnerFields"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.datasource.SQLDatasource"/>
<Bug pattern="CT_CONSTRUCTOR_THROW"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.parameterprocessor.DefaultResultParameterProcessor"/>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.parameterprocessor.DefaultStatementParameterProcessor"/>
<Bug pattern="SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR"/>
</Match>
</FindBugsFilter>
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

jacoco {
toolVersion = "0.8.10"
Expand Down Expand Up @@ -83,9 +83,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
45 changes: 23 additions & 22 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,54 @@ hsqlDriverVersion=2.7.1
h2Version=1.4.200
atomikosLibVersion=5.0.8
checkstyleToolVersion=10.12.1
githubSpotbugsVersion=5.0.14
githubSpotbugsVersion=6.0.18
githubJohnrengelmanShadowVersion=8.1.1
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
testngVersion=7.6.1
ballerinaGradlePluginVersion=2.0.1

ballerinaLangVersion=2201.11.0-20241008-112400-81975006
ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77


# 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
stdlibDataJsonDataVersion=0.3.0-20241105-101100-661d11f
stdlibJwtVersion=2.13.0
stdlibOAuth2Version=2.12.0
stdlibAuthVersion=2.12.1-20241113-162300-ded40eb
stdlibDataJsonDataVersion=0.3.0-20241114-143900-285d739
stdlibJwtVersion=2.13.1-20241113-162400-b59ccfa
stdlibOAuth2Version=2.12.1-20241113-162400-4c6ddfe

# Level 05
stdlibHttpVersion=2.13.0-20241106-120000-d375c3b
stdlibHttpVersion=2.13.0-20241114-182900-7e9f66a

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

0 comments on commit d25996e

Please sign in to comment.