Skip to content

Commit

Permalink
Merge pull request #520 from HindujaB/java21
Browse files Browse the repository at this point in the history
Migrate to Java21
  • Loading branch information
warunalakshitha authored Nov 18, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
2 parents 76ec59f + 6757a26 commit 3fa45fe
Showing 10 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -22,7 +22,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/)
14 changes: 7 additions & 7 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[package]
org = "ballerina"
name = "os"
version = "1.8.1"
version = "1.8.2"
authors = ["Ballerina"]
keywords = ["environment"]
repository = "https://github.com/ballerina-platform/module-ballerina-os"
icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.8.0"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "os-native"
version = "1.8.1"
path = "../native/build/libs/os-native-1.8.1-SNAPSHOT.jar"
version = "1.8.2"
path = "../native/build/libs/os-native-1.8.2-SNAPSHOT.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "io-native"
version = "1.6.0"
path = "./lib/io-native-1.6.0.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "os-test-utils"
version = "1.8.1"
2 changes: 1 addition & 1 deletion ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.8.0"
distribution-version = "2201.10.0-20240926-231800-8a5a4343"

[[package]]
org = "ballerina"
8 changes: 4 additions & 4 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -9,22 +9,22 @@ icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.8.0"

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

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "io-native"
version = "@io.version@"
path = "./lib/[email protected]@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "os-test-utils"
version = "@toml.version@"
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -3,11 +3,11 @@ group=io.ballerina.stdlib
version=1.8.1-SNAPSHOT

ballerinaGradlePluginVersion=2.0.1
githubSpotBugsVersion=5.0.14
githubSpotBugsVersion=6.0.18
shadowJarVersion=7.1.2
undercouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
puppycrawlCheckstyleVersion=10.12.0

ballerinaLangVersion=2201.8.0
stdlibIoVersion=1.6.0
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
7 changes: 5 additions & 2 deletions native/build.gradle
Original file line number Diff line number Diff line change
@@ -30,9 +30,12 @@ dependencies {
}

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()) {
Original file line number Diff line number Diff line change
@@ -18,11 +18,11 @@

package io.ballerina.stdlib.os.nativeimpl;

import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.creators.ErrorCreator;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BArray;
import io.ballerina.runtime.api.values.BObject;
Original file line number Diff line number Diff line change
@@ -18,10 +18,10 @@
package io.ballerina.stdlib.os.utils;

import io.ballerina.runtime.api.Environment;
import io.ballerina.runtime.api.PredefinedTypes;
import io.ballerina.runtime.api.creators.TypeCreator;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.MapType;
import io.ballerina.runtime.api.types.PredefinedTypes;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.values.BMap;
import io.ballerina.runtime.api.values.BObject;
@@ -63,7 +63,7 @@ public static BString getSystemProperty(BString key) {
String value = System.getProperty(key.toString());
if (value == null) {
return StringUtils.fromString(
io.ballerina.runtime.api.PredefinedTypes.TYPE_STRING.getZeroValue().toString());
io.ballerina.runtime.api.types.PredefinedTypes.TYPE_STRING.getZeroValue().toString());
}
return StringUtils.fromString(value);
}
7 changes: 5 additions & 2 deletions test-utils/build.gradle
Original file line number Diff line number Diff line change
@@ -30,9 +30,12 @@ dependencies {
}

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()) {
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ public final class OSTestUtils {
private OSTestUtils() {}

public static BString testValidEnv() {
return StringUtils.fromString(System.getenv("JAVA_HOME"));
return StringUtils.fromString(System.getenv("java.home"));
}

public static BString testGetUserHome() {

0 comments on commit 3fa45fe

Please sign in to comment.