From 96d0721bb52e804dae899fd5c9be71f256d6eab9 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Sun, 17 Nov 2024 10:50:11 +0530 Subject: [PATCH 1/2] [Automated] Update the native jar versions --- copybook-tool/Ballerina.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/copybook-tool/Ballerina.toml b/copybook-tool/Ballerina.toml index 1c9c113..f325113 100644 --- a/copybook-tool/Ballerina.toml +++ b/copybook-tool/Ballerina.toml @@ -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"] From cc21f28c833be0c05fdb0fb2761c4fc1ae15d521 Mon Sep 17 00:00:00 2001 From: hindujaB Date: Sun, 17 Nov 2024 12:47:24 +0530 Subject: [PATCH 2/2] Migrate to java 21 --- .github/workflows/build-timestamped-master.yml | 4 ++-- .github/workflows/central-publish.yml | 4 ++-- .github/workflows/dev-stage-central-publish.yml | 4 ++-- .github/workflows/publish-release.yml | 4 ++-- .github/workflows/pull-request.yml | 8 ++++---- README.md | 2 +- copybook-cli/build.gradle | 7 +++++-- gradle.properties | 4 ++-- gradle/javaProject.gradle | 10 ++++++---- 9 files changed, 26 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build-timestamped-master.yml b/.github/workflows/build-timestamped-master.yml index c5a2a38..a973cff 100644 --- a/.github/workflows/build-timestamped-master.yml +++ b/.github/workflows/build-timestamped-master.yml @@ -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') diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 165f4c2..508171d 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -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 diff --git a/.github/workflows/dev-stage-central-publish.yml b/.github/workflows/dev-stage-central-publish.yml index 439d9ea..3f8d1b9 100644 --- a/.github/workflows/dev-stage-central-publish.yml +++ b/.github/workflows/dev-stage-central-publish.yml @@ -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 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 7fa0fe9..6134ff1 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -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 diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 29ff777..dd8608c 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -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 }} @@ -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 }} diff --git a/README.md b/README.md index a263533..123b4b1 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/copybook-cli/build.gradle b/copybook-cli/build.gradle index d063114..3ebd949 100644 --- a/copybook-cli/build.gradle +++ b/copybook-cli/build.gradle @@ -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 diff --git a/gradle.properties b/gradle.properties index f8ea8ff..766778e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/gradle/javaProject.gradle b/gradle/javaProject.gradle index da6cfd9..242a046 100644 --- a/gradle/javaProject.gradle +++ b/gradle/javaProject.gradle @@ -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) { @@ -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()) {