Skip to content

Commit

Permalink
Merge pull request #1248 from warunalakshitha/java21
Browse files Browse the repository at this point in the history
Migrate to Java 21
  • Loading branch information
warunalakshitha authored Oct 17, 2024
2 parents f16f984 + a7c88d5 commit 44d112e
Show file tree
Hide file tree
Showing 29 changed files with 350 additions and 381 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ jobs:
call_workflow:
name: Run Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@java21
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
call_stdlib_workflow:
name: Run StdLib Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java21
with:
lang_tag: ${{ inputs.lang_tag }}
lang_version: ${{ inputs.lang_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
call_workflow:
name: Run Central Publish Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@java21
secrets: inherit
with:
environment: ${{ github.event.inputs.environment }}
2 changes: 1 addition & 1 deletion .github/workflows/process-load-test-result.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
call_stdlib_process_load_test_results_workflow:
name: Run StdLib Process Load Test Results Workflow
uses: ballerina-platform/ballerina-library/.github/workflows/process-load-test-results-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/process-load-test-results-template.yml@java21
with:
results: ${{ toJson(github.event.client_payload.results) }}
secrets:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
call_workflow:
name: Run Release Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@java21
secrets: inherit
with:
package-name: udp
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ jobs:
call_workflow:
name: Run PR Build Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@java21
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/trigger-load-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
call_stdlib_trigger_load_test_workflow:
name: Run StdLib Load Test Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-library/.github/workflows/trigger-load-tests-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/trigger-load-tests-template.yml@java21
with:
repo_name: 'module-ballerina-udp'
runtime_artifacts_url: 'https://api.github.com/repos/ballerina-platform/module-ballerina-udp/actions/artifacts'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ jobs:
call_workflow:
name: Run Trivy Scan Workflow
if: ${{ github.repository_owner == 'ballerina-platform' }}
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main
uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@java21
secrets: inherit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ This repository only contains the source code for the package.

### Setting 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/)

Expand Down
16 changes: 8 additions & 8 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@ icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"

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

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "../test-utils/build/libs/udp-test-utils-1.11.0.jar"
scope = "testOnly"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-handler"
version = "4.1.108.Final"
path = "./lib/netty-handler-4.1.108.Final.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-buffer"
version = "4.1.108.Final"
path = "./lib/netty-buffer-4.1.108.Final.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-transport"
version = "4.1.108.Final"
path = "./lib/netty-transport-4.1.108.Final.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-common"
version = "4.1.108.Final"
path = "./lib/netty-common-4.1.108.Final.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-resolver"
version = "4.1.108.Final"
Expand Down
16 changes: 8 additions & 8 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,44 +9,44 @@ icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"

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

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

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-handler"
version = "@netty.version@"
path = "./lib/netty-handler-@netty.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-buffer"
version = "@netty.version@"
path = "./lib/netty-buffer-@netty.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-transport"
version = "@netty.version@"
path = "./lib/netty-transport-@netty.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-common"
version = "@netty.version@"
path = "./lib/netty-common-@netty.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.netty"
artifactId = "netty-resolver"
version = "@netty.version@"
Expand Down
9 changes: 4 additions & 5 deletions build-config/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@
</Or>
<Bug pattern="SIC_INNER_SHOULD_BE_STATIC_ANON"/>
</Match>

<Match>
<Class name="io.ballerina.stdlib.udp.UdpCallback"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.udp.UdpService"/>
<Bug pattern="EI_EXPOSE_REP, EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.udp.UdpClientHandler"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
</FindBugsFilter>
7 changes: 5 additions & 2 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,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 @@ -48,8 +48,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
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
org.gradle.caching=true
group=io.ballerina.stdlib
version=1.11.1-SNAPSHOT
ballerinaLangVersion=2201.10.0
ballerinaLangVersion=2201.10.0-20241011-161100-51978649

puppycrawlCheckstyleVersion=10.12.0
githubJohnrengelmanShadowVersion=8.1.1
checkstyleToolVersion=7.8.2
githubSpotbugsVersion=5.0.14
githubSpotbugsVersion=6.0.18
testngVersion=7.6.1
nettyVersion=4.1.108.Final
underCouchDownloadVersion=5.4.0
Expand All @@ -16,7 +16,7 @@ ballerinaGradlePluginVersion=2.0.1
gsonVersion=2.8.8

# Dependencies
stdlibIoVersion=1.6.0
stdlibLogVersion=2.10.0
observeVersion=1.3.0
observeInternalVersion=1.3.0
stdlibIoVersion=1.6.2-20240928-084100-656404f
stdlibLogVersion=2.10.1-20240930-154200-5ab2aa4
observeVersion=1.3.1-20241007-161000-645452d
observeInternalVersion=1.3.1-20241007-182700-a5f77a1
7 changes: 5 additions & 2 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ compileJava {
}

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
Loading

0 comments on commit 44d112e

Please sign in to comment.