Skip to content

Commit

Permalink
Migrate to Java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
ravinperera00 committed Dec 4, 2024
1 parent a8e6210 commit 242856b
Show file tree
Hide file tree
Showing 25 changed files with 206 additions and 215 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,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

# Build the project with Gradle
- name: Build with Gradle
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ This repository only contains the source code for the library.

### Set up the prerequisites

* Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
* Download and install Java SE Development Kit (JDK) version 21 (from one of the following locations).

* [Oracle](https://www.oracle.com/java/technologies/downloads/)

Expand Down
2 changes: 1 addition & 1 deletion ballerina-tests/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[package]
org = "ballerinax"
name = "nats_tests"
version = "3.1.0"
version = "3.1.1"
16 changes: 8 additions & 8 deletions ballerina-tests/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.11.0-20241117-133400-a3054b77"

[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.2"
version = "2.7.3"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand All @@ -20,7 +20,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -114,7 +114,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.10.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -129,7 +129,7 @@ modules = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.3.0"
version = "1.4.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -152,7 +152,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.6.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -171,7 +171,7 @@ dependencies = [
[[package]]
org = "ballerinax"
name = "nats"
version = "3.1.0"
version = "3.1.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "crypto"},
Expand All @@ -185,7 +185,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "nats_tests"
version = "3.1.0"
version = "3.1.1"
dependencies = [
{org = "ballerina", name = "lang.runtime"},
{org = "ballerina", name = "lang.string"},
Expand Down
22 changes: 11 additions & 11 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[package]
org = "ballerinax"
name = "nats"
version = "3.1.0"
version = "3.1.1"
authors = ["Ballerina"]
keywords = ["service", "client", "messaging", "network", "pubsub"]
repository = "https://github.com/ballerina-platform/module-ballerinax-nats"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.11.0-20241117-133400-a3054b77"

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

[[platform.java17.dependency]]
path = "./lib/jnats-2.16.0.jar"
[[platform.java21.dependency]]
path = "./lib/jnats-2.20.4.jar"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "constraint-native"
version = "1.5.0"
path = "./lib/constraint-native-1.5.0.jar"
version = "1.6.0"
path = "./lib/constraint-native-1.6.0-20241113-090900-d276ad5.jar"

[build-options]
observabilityIncluded=true
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "nats-compiler-plugin"
class = "io.ballerina.stdlib.nats.plugin.NatsCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/nats-compiler-plugin-3.1.0.jar"
path = "../compiler-plugin/build/libs/nats-compiler-plugin-3.1.1-SNAPSHOT.jar"
16 changes: 8 additions & 8 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.11.0-20241117-133400-a3054b77"

[[package]]
org = "ballerina"
name = "constraint"
version = "1.5.0"
version = "1.6.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
Expand All @@ -22,7 +22,7 @@ modules = [
[[package]]
org = "ballerina"
name = "crypto"
version = "2.7.2"
version = "2.7.3"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
Expand All @@ -34,7 +34,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.1"
version = "1.6.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand Down Expand Up @@ -130,7 +130,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.10.0"
version = "2.10.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand All @@ -145,7 +145,7 @@ modules = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.3.0"
version = "1.4.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -167,7 +167,7 @@ modules = [
[[package]]
org = "ballerina"
name = "time"
version = "2.4.0"
version = "2.6.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -187,7 +187,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "nats"
version = "3.1.0"
version = "3.1.1"
dependencies = [
{org = "ballerina", name = "constraint"},
{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 @@ -7,21 +7,21 @@ keywords = ["service", "client", "messaging", "network", "pubsub"]
repository = "https://github.com/ballerina-platform/module-ballerinax-nats"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.11.0-20241117-133400-a3054b77"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "constraint-native"
version = "@constraint.version@"
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
*/

plugins {
id "com.github.spotbugs" version "5.0.14"
id "com.github.johnrengelman.shadow" version "8.1.1"
id "de.undercouch.download" version "5.4.0"
id "net.researchgate.release" version "2.8.0"
id "com.github.spotbugs" version "${spotbugsPluginVersion}"
id "com.github.johnrengelman.shadow" version "${shadowJarPluginVersion}"
id "de.undercouch.download" version "${downloadPluginVersion}"
id "net.researchgate.release" version "${releasePluginVersion}"
}

allprojects {
Expand Down
7 changes: 5 additions & 2 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ checkstyle {
checkstyleTest.dependsOn(":checkstyle:downloadCheckstyleRuleFiles")

spotbugsTest {
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
7 changes: 5 additions & 2 deletions compiler-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,11 @@ tasks.withType(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
22 changes: 13 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,27 @@ org.gradle.caching=true
group=io.ballerina.stdlib

version=3.1.1-SNAPSHOT
ballerinaLangVersion=2201.10.0
ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77
ballerinaGradlePluginVersion=2.0.1
spotbugsPluginVersion=6.0.18
shadowJarPluginVersion=8.1.1
downloadPluginVersion=5.4.0
releasePluginVersion=2.8.0

natsVersion=2.16.0
natsVersion=2.20.4
puppycrawlCheckstyleVersion=10.12.1
testngVersion=7.6.1
gsonVersion=2.8.8
slf4jVersion=1.7.30

stdlibIoVersion=1.6.1
stdlibTimeVersion=2.4.0
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
stdlibTimeVersion=2.6.0-20241113-073800-201b904

stdlibConstraintVersion=1.5.0
stdlibLogVersion=2.10.0
stdlibCryptoVersion=2.7.2
stdlibConstraintVersion=1.6.0-20241113-090900-d276ad5
stdlibLogVersion=2.10.1-20241113-120000-4577868
stdlibCryptoVersion=2.7.3-20241113-081400-d015a39

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

jacocoVersion=0.8.10
7 changes: 5 additions & 2 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,11 @@ tasks.withType(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
29 changes: 29 additions & 0 deletions native/src/main/java/io/ballerina/stdlib/nats/Handler.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2024 WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package io.ballerina.stdlib.nats;

import io.ballerina.runtime.api.values.BError;

/**
* This utility interface will support Classes that depends on notifySuccess and notifyFailure methods.
*/
public interface Handler {
void notifySuccess(Object result);

void notifyFailure(BError bError);
}
Loading

0 comments on commit 242856b

Please sign in to comment.