Skip to content

Commit

Permalink
Merge pull request #295 from ravinperera00/java21
Browse files Browse the repository at this point in the history
Migrate to Java 21
  • Loading branch information
warunalakshitha authored Oct 1, 2024
2 parents 4638cad + 7149070 commit 2395f0f
Show file tree
Hide file tree
Showing 16 changed files with 38 additions and 48 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 @@ -16,5 +16,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/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: persist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot-nexus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 17.0.7
java-version: 21.0.3
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
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,7 +10,7 @@ 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
with:
additional-windows-test-flags: "-x test"
19 changes: 0 additions & 19 deletions .github/workflows/stale_check.yml

This file was deleted.

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 @@ -179,7 +179,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
10 changes: 5 additions & 5 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
org = "ballerina"
name = "persist"
version = "1.4.0"
version = "1.4.1"
authors = ["Ballerina"]
keywords = ["persist"]
repository = "https://github.com/ballerina-platform/module-ballerina-persist"
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 = "persist-native"
version = "1.4.0"
path = "../native/build/libs/persist-native-1.4.0.jar"
version = "1.4.1"
path = "../native/build/libs/persist-native-1.4.1-SNAPSHOT.jar"
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-20240926-231800-8a5a4343"

[[package]]
org = "ballerina"
Expand All @@ -18,7 +18,7 @@ modules = [
[[package]]
org = "ballerina"
name = "persist"
version = "1.4.0"
version = "1.4.1"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand Down
6 changes: 3 additions & 3 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ keywords = ["persist"]
repository = "https://github.com/ballerina-platform/module-ballerina-persist"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.10.0"
distribution = "2201.10.0-20240926-231800-8a5a4343"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist-native"
version = "@toml.version@"
Expand Down
7 changes: 5 additions & 2 deletions compiler-plugin-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,11 @@ jacocoTestReport {
}

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
7 changes: 5 additions & 2 deletions compiler-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,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
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ version=1.4.1-SNAPSHOT

puppycrawlCheckstyleVersion=10.12.0
checkstyleToolVersion=7.8.2
githubSpotbugsVersion=5.0.14
githubSpotbugsVersion=6.0.18
githubJohnrengelmanShadowVersion=7.1.2
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
testngVersion=7.6.1
gsonVersion=2.10.1
ballerinaGradlePluginVersion=2.0.1

ballerinaLangVersion=2201.10.0
ballerinaLangVersion=2201.10.0-20240926-231800-8a5a4343

# Direct Dependencies

# Level 01
stdlibTimeVersion=2.4.0
stdlibTimeVersion=2.5.1-20240930-120200-e59222b

# Enabled publishing insecure checksums, due to fail to publish to maven central
# Refer https://github.com/gradle/gradle/issues/11308
Expand Down
9 changes: 6 additions & 3 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,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 @@ -75,9 +75,12 @@ jacocoTestReport {
}

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")
ignoreFailures = true
effort = "max"
reportLevel = "low"
effort = SpotBugsEffort.MAX
reportLevel = SpotBugsConfidence.LOW
reportsDir = file("$project.buildDir/reports/spotbugs")
def excludeFile = file("${rootDir}/build-config/spotbugs-exclude.xml")
if (excludeFile.exists()) {
Expand Down

0 comments on commit 2395f0f

Please sign in to comment.