Skip to content

Commit

Permalink
Merge pull request #23 from HindujaB/java21
Browse files Browse the repository at this point in the history
Migrate to Java 21
  • Loading branch information
warunalakshitha authored Nov 17, 2024
2 parents 3b817bb + cc21f28 commit 7a717bb
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
if: github.repository_owner == 'ballerina-platform'
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
- name: Change to Timestamped Version
run: |
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00')
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,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
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev-stage-central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,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
java-version: 21

- name: Grant execute permission for gradlew
run: chmod +x gradlew
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ jobs:
runs-on: ubuntu-latest
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
java-version: 21
- name: Set version env variable
run: echo "VERSION=$((grep -w "version" | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV
- name: Pre release dependency version update
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,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
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand All @@ -32,11 +32,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
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ The Copybook tool simplifies the process of transforming Copybook definitions in

### Setting Up the Prerequisites

1. Download and install Java SE Development Kit (JDK) version 17. You can install either [OpenJDK](https://adoptopenjdk.net/) or [Oracle](https://www.oracle.com/java/technologies/downloads/).
1. Download and install Java SE Development Kit (JDK) version 21. You can install either [OpenJDK](https://adoptopenjdk.net/) or [Oracle](https://www.oracle.com/java/technologies/downloads/).

> **Note:** Set the JAVA_HOME environment variable to the path name of the directory into which you installed JDK.
Expand Down
7 changes: 5 additions & 2 deletions copybook-cli/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ test {
}

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
2 changes: 1 addition & 1 deletion copybook-tool/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
org = "ballerina"
name = "copybook"
version = "1.0.0"
version = "1.0.1"
authors = ["Ballerina"]
keywords = ["copybook", "copybook tool"]
license = ["Apache-2.0"]
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ org.gradle.caching=true
group=io.ballerina
version=1.0.1-SNAPSHOT

spotbugsPluginVersion=5.0.14
spotbugsPluginVersion=6.0.18
releasePluginVersion=2.8.0
checkstylePluginVersion=10.12.0
downloadPluginVersion=5.4.0
ballerinaLangVersion=2201.8.0
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87
picocliVersion=4.7.4
testngVersion=7.7.0
slf4jVersion=2.0.9
Expand Down
10 changes: 6 additions & 4 deletions gradle/javaProject.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ dependencies {
checkstyle "com.puppycrawl.tools:checkstyle:${project.puppycrawlCheckstyleVersion}"
}

sourceCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21

def excludePattern = '**/module-info.java'
tasks.withType(Checkstyle) {
Expand Down Expand Up @@ -135,9 +135,11 @@ checkstyle {
}

spotbugsMain {
ignoreFailures = true
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")
def excludeFile = file("${rootDir}/spotbugs-exclude.xml")
if (excludeFile.exists()) {
Expand Down

0 comments on commit 7a717bb

Please sign in to comment.