Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Java21 #31

Merged
merged 11 commits into from
Nov 18, 2024
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ This repository only contains the source code for the package.

### Prerequisites

1. Download and install Java SE Development Kit (JDK) version 17. You can download it from either of the following sources:
1. Download and install Java SE Development Kit (JDK) version 21. You can download it from either of the following sources:

- [Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
- [OpenJDK](https://adoptium.net/)
Expand Down
8 changes: 4 additions & 4 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ distribution = "2201.8.0"
[build-options]
observabilityIncluded = true

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.lib"
artifactId = "avro-native"
version = "1.0.2"
path = "../native/build/libs/avro-native-1.0.2.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "org.apache.avro"
artifactId = "avro"
version = "1.11.4"
path = "./lib/avro-1.11.4.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.fasterxml.jackson.core"
artifactId = "jackson-core"
version = "2.18.0"
Expand Down
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.9.0"
distribution-version = "2201.10.0-20240926-231800-8a5a4343"

[[package]]
org = "ballerina"
Expand All @@ -23,7 +23,7 @@ modules = [
[[package]]
org = "ballerina"
name = "io"
version = "1.6.0"
version = "1.6.2"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
Expand Down
8 changes: 4 additions & 4 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,22 @@ distribution = "2201.8.0"
[build-options]
observabilityIncluded = true

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "io.ballerina.lib"
artifactId = "avro-native"
version = "@toml.version@"
path = "../native/build/libs/avro-native-@project.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "org.apache.avro"
artifactId = "avro"
version = "@avro.version@"
path = "./lib/avro-@avro.version@.jar"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
groupId = "com.fasterxml.jackson.core"
artifactId = "jackson-core"
version = "@jackson.version@"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.caching=true
group=io.ballerina.lib
version=1.0.3-SNAPSHOT
ballerinaLangVersion=2201.9.0
ballerinaLangVersion=2201.11.0-20241112-214900-6b80ab87

checkstylePluginVersion=10.12.0
spotbugsPluginVersion=5.0.14
spotbugsPluginVersion=6.0.18
githubShadowVersion=7.1.2
checkstyleToolVersion=7.8.2
shadowJarPluginVersion=8.1.1
Expand All @@ -13,6 +13,6 @@ releasePluginVersion=2.8.0
ballerinaGradlePluginVersion=2.0.1

# Dependencies
stdlibIoVersion=1.6.0
stdlibIoVersion=1.6.2-20241112-233100-995cf5f
avroVersion=1.11.4
jacksonVersion=2.18.0
7 changes: 5 additions & 2 deletions native/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ compileJava {
}

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 native/src/main/java/io/ballerina/lib/avro/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

package io.ballerina.lib.avro;

import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.ErrorCreator;
import io.ballerina.runtime.api.types.IntersectionType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BError;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@
import io.ballerina.lib.avro.Utils;
import io.ballerina.lib.avro.deserialize.ArrayDeserializer;
import io.ballerina.lib.avro.deserialize.Deserializer;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.values.BArray;
import org.apache.avro.Schema;
import org.apache.avro.generic.GenericData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
import io.ballerina.lib.avro.deserialize.PrimitiveDeserializer;
import io.ballerina.lib.avro.deserialize.RecordDeserializer;
import io.ballerina.lib.avro.deserialize.UnionDeserializer;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.creators.ValueCreator;
import io.ballerina.runtime.api.types.ArrayType;
import io.ballerina.runtime.api.types.Field;
import io.ballerina.runtime.api.types.MapType;
import io.ballerina.runtime.api.types.RecordType;
import io.ballerina.runtime.api.types.ReferenceType;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.utils.ValueUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
import io.ballerina.lib.avro.serialize.UnionSerializer;
import io.ballerina.lib.avro.serialize.visitor.array.ArrayVisitorFactory;
import io.ballerina.lib.avro.serialize.visitor.array.IArrayVisitor;
import io.ballerina.runtime.api.TypeTags;
import io.ballerina.runtime.api.types.Type;
import io.ballerina.runtime.api.types.TypeTags;
import io.ballerina.runtime.api.utils.StringUtils;
import io.ballerina.runtime.api.utils.TypeUtils;
import io.ballerina.runtime.api.values.BArray;
Expand Down
Loading