From 6a7cb9bf9f454abbe63a5ea21f323114fd6df718 Mon Sep 17 00:00:00 2001 From: ravinperera00 Date: Mon, 30 Sep 2024 13:16:11 +0530 Subject: [PATCH 1/3] Migrate to Java 21 --- .github/workflows/build-timestamped-master.yml | 2 +- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- README.md | 2 +- build-config/resources/Ballerina.toml | 12 ++++++------ gradle.properties | 4 ++-- native/build.gradle | 7 +++++-- .../stdlib/crypto/PgpDecryptionGenerator.java | 2 +- 11 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index c8e42fa..86da481 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -12,5 +12,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 diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 000baac..3d5d2e9 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -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 }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 11922b5..ebe213e 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -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 }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 460928f..f84a847 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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: crypto diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 3b7c146..c534e2f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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 diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index 458aab5..d91a5f3 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -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 diff --git a/README.md b/README.md index 8cdcb70..0ab9206 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ This repository only contains the source code for the module. ### 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/) diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index 2f59bda..06f57fe 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -9,34 +9,34 @@ icon = "icon.png" license = ["Apache-2.0"] distribution = "2201.9.0" -[platform.java17] +[platform.java21] graalvmCompatible = true -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "io.ballerina.stdlib" artifactId = "crypto-native" version = "@toml.version@" path = "../native/build/libs/crypto-native-@project.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.bouncycastle" artifactId = "bcpkix-jdk18on" version = "@bouncycastle.version@" path = "./lib/bcpkix-jdk18on-@bouncycastle.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.bouncycastle" artifactId = "bcprov-jdk18on" version = "@bouncycastle.version@" path = "./lib/bcprov-jdk18on-@bouncycastle.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.bouncycastle" artifactId = "bcutil-jdk18on" version = "@bouncycastle.version@" path = "./lib/bcutil-jdk18on-@bouncycastle.version@.jar" -[[platform.java17.dependency]] +[[platform.java21.dependency]] groupId = "org.bouncycastle" artifactId = "bcpg-jdk18on" version = "@bouncycastle.version@" diff --git a/gradle.properties b/gradle.properties index ac5ea3e..af8d0c8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,12 +3,12 @@ group=io.ballerina.stdlib version=2.7.3-SNAPSHOT puppycrawlCheckstyleVersion=10.12.0 bouncycastleVersion=1.78 -githubSpotbugsVersion=5.0.14 +githubSpotbugsVersion=6.0.18 githubShadowVersion=7.1.2 undercouchDownloadVersion=5.4.0 researchgateReleaseVersion=2.8.0 ballerinaGradlePluginVersion=2.0.1 nativeImageVersion=22.2.0 -ballerinaLangVersion=2201.9.0 +ballerinaLangVersion=2201.10.0-20240926-231800-8a5a4343 stdlibTimeVersion=2.4.0 diff --git a/native/build.gradle b/native/build.gradle index ed24295..55e1105 100644 --- a/native/build.gradle +++ b/native/build.gradle @@ -45,8 +45,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 diff --git a/native/src/main/java/io/ballerina/stdlib/crypto/PgpDecryptionGenerator.java b/native/src/main/java/io/ballerina/stdlib/crypto/PgpDecryptionGenerator.java index 3b18829..3a4a7bf 100644 --- a/native/src/main/java/io/ballerina/stdlib/crypto/PgpDecryptionGenerator.java +++ b/native/src/main/java/io/ballerina/stdlib/crypto/PgpDecryptionGenerator.java @@ -53,7 +53,7 @@ * * @since 2.7.0 */ -public class PgpDecryptionGenerator { +public final class PgpDecryptionGenerator { static { if (Objects.isNull(Security.getProvider(BouncyCastleProvider.PROVIDER_NAME))) { From 4d832775202902daac2895016cbbc506081742b1 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Wed, 13 Nov 2024 07:41:22 +0530 Subject: [PATCH 2/3] Bump lang and other stdlib versions --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index af8d0c8..a46f215 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,5 +10,5 @@ researchgateReleaseVersion=2.8.0 ballerinaGradlePluginVersion=2.0.1 nativeImageVersion=22.2.0 -ballerinaLangVersion=2201.10.0-20240926-231800-8a5a4343 -stdlibTimeVersion=2.4.0 +ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 +stdlibTimeVersion=2.6.0-20241113-073800-201b904 From 643720ad4816a09d804582aae68a300aacb13de6 Mon Sep 17 00:00:00 2001 From: warunalakshitha Date: Mon, 18 Nov 2024 10:10:58 +0530 Subject: [PATCH 3/3] Use main branch for github actions --- .github/workflows/build-timestamped-master.yml | 2 +- .github/workflows/build-with-bal-test-graalvm.yml | 2 +- .github/workflows/central-publish.yml | 2 +- .github/workflows/publish-release.yml | 2 +- .github/workflows/pull-request.yml | 2 +- .github/workflows/trivy-scan.yml | 2 +- gradle.properties | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index 86da481..c8e42fa 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -12,5 +12,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@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-timestamp-master-template.yml@main secrets: inherit diff --git a/.github/workflows/build-with-bal-test-graalvm.yml b/.github/workflows/build-with-bal-test-graalvm.yml index 3d5d2e9..000baac 100644 --- a/.github/workflows/build-with-bal-test-graalvm.yml +++ b/.github/workflows/build-with-bal-test-graalvm.yml @@ -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@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main with: lang_tag: ${{ inputs.lang_tag }} lang_version: ${{ inputs.lang_version }} diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index ebe213e..11922b5 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -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@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/central-publish-template.yml@main secrets: inherit with: environment: ${{ github.event.inputs.environment }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index f84a847..460928f 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/release-package-template.yml@main secrets: inherit with: package-name: crypto diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index c534e2f..3b7c146 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/pull-request-build-template.yml@main secrets: inherit diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index d91a5f3..458aab5 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -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@java21 + uses: ballerina-platform/ballerina-library/.github/workflows/trivy-scan-template.yml@main secrets: inherit diff --git a/gradle.properties b/gradle.properties index a46f215..34ec681 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,5 +10,5 @@ researchgateReleaseVersion=2.8.0 ballerinaGradlePluginVersion=2.0.1 nativeImageVersion=22.2.0 -ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87 +ballerinaLangVersion=2201.11.0-20241117-133400-a3054b77 stdlibTimeVersion=2.6.0-20241113-073800-201b904