Skip to content

Commit

Permalink
Merge pull request #193 from NipunaMadhushan/java21
Browse files Browse the repository at this point in the history
Migrate to Java 21
  • Loading branch information
keizer619 authored Jan 29, 2025
2 parents 6ac27e2 + 59f3860 commit 3122bbb
Show file tree
Hide file tree
Showing 14 changed files with 70 additions and 58 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build-dev-branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:
steps:
- name: Checkout Repository
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
distribution: 'temurin'
java-version: 21.0.3
- name: Set up Ballerina
if: github.event_name == 'workflow_dispatch'
uses: ballerina-platform/[email protected]
Expand Down Expand Up @@ -57,11 +57,11 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17.0.7
distribution: 'temurin'
java-version: 21.0.3
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Download Jaeger server executable
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
steps:
- name: Checkout Repository
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: Set up Ballerina
if: github.event_name == 'workflow_dispatch'
uses: ballerina-platform/[email protected]
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 @@ -22,11 +22,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: Set up Ballerina
uses: ballerina-platform/[email protected]
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ jobs:
steps:
- name: Checkout Repository
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: Set up Ballerina
if: github.event_name == 'workflow_dispatch'
uses: ballerina-platform/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/graalvm-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
uses: graalvm/setup-graalvm@v1
with:
version: 'latest'
java-version: '17.0.7'
java-version: '21.0.3'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Check GraalVM installation
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 @@ -15,11 +15,11 @@ jobs:
steps:
- name: Checkout Repository
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: Set up Ballerina
uses: ballerina-platform/[email protected]
with:
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 @@ -3,19 +3,19 @@ name: Validate Pull Request
on: pull_request

env:
BALLERINA_DISTRIBUTION_VERSION: 2201.10.0 # Update this with the latest Ballerina version
BALLERINA_DISTRIBUTION_VERSION: nightly-2201.11.x # Update this with the latest Ballerina version

jobs:
ubuntu-build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17.0.7
distribution: 'temurin'
java-version: 21.0.3
- name: Set up Ballerina
uses: ballerina-platform/[email protected]
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

### Setting 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/)

Expand Down
4 changes: 2 additions & 2 deletions ballerina-tests/jaeger-server-tests/tests/test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ function testHttpCachingClientSpanTags() returns error? {
test:assertTrue(containsTag("src.object.name", httpCachingClientSpanTagKeys));
test:assertEquals(httpCachingClientSpanTags["src.object.name"], "ballerina/http/HttpCachingClient");
test:assertTrue(containsTag("src.position", httpCachingClientSpanTagKeys));
test:assertEquals(httpCachingClientSpanTags["src.position"], "http_client_endpoint.bal:282:41");
test:assertEquals(httpCachingClientSpanTags["src.position"], "http_client_endpoint.bal:285:41");
}

@test:Config
Expand Down Expand Up @@ -394,7 +394,7 @@ function testHttpClientSpanTags() returns error? {
test:assertTrue(containsTag("src.object.name", httpClientSpanTagKeys));
test:assertEquals(httpClientSpanTags["src.object.name"], "ballerina/http/HttpClient");
test:assertTrue(containsTag("src.position", httpClientSpanTagKeys));
test:assertEquals(httpClientSpanTags["src.position"], "caching_http_caching_client.bal:371:16");
test:assertEquals(httpClientSpanTags["src.position"], "caching_http_caching_client.bal:372:16");
}

function isContain(string[] array, string id) returns boolean {
Expand Down
44 changes: 22 additions & 22 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,124 +20,124 @@ name = "jaeger"
version = "@toml.version@"
distribution = "2201.10.0"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "../native/build/libs/[email protected]@.jar"
groupId = "ballerina"
artifactId = "jaeger-extension-native"
version = "@project.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.opentelemetry"
artifactId = "opentelemetry-sdk-trace"
version = "@opentelemetrySDK.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.opentelemetry"
artifactId = "opentelemetry-sdk-common"
version = "@opentelemetrySDK.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.opentelemetry"
groupId = "io.opentelemetry.semconv"
artifactId = "opentelemetry-semconv"
version = "@opentelemetrySemconv.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.opentelemetry"
artifactId = "opentelemetry-proto"
version = "@opentelemetryProto.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.opentelemetry"
artifactId = "opentelemetry-exporter-otlp-trace"
version = "@opentelemetryExporter.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/opentelemetry-exporter-otlp-common-@[email protected]"
groupId = "io.opentelemetry"
artifactId = "opentelemetry-exporter-otlp-common"
version = "@opentelemetryExporter.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.opentelemetry"
artifactId = "opentelemetry-extension-trace-propagators"
version = "@opentelemetry.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "com.google.guava"
artifactId = "guava"
version = "@guava.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "com.google.guava"
artifactId = "failureaccess"
version = "@failureAccess.version@"

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

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

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

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

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.grpc"
artifactId = "grpc-protobuf-lite"
version = "@grpc.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.grpc"
artifactId = "grpc-netty-shaded"
version = "@grpc.version@"

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "com.google.protobuf"
artifactId = "protobuf-java"
version = "@protobuf.version@"

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

[[platform.java17.dependency]]
[[platform.java21.dependency]]
path = "./lib/[email protected]@.jar"
groupId = "io.perfmark"
artifactId = "perfmark-api"
Expand Down
8 changes: 4 additions & 4 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

[ballerina]
dependencies-toml-version = "2"
distribution-version = "2201.9.0"
distribution-version = "2201.11.0"

[[package]]
org = "ballerina"
name = "io"
version = "1.6.0"
version = "1.7.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.value"}
Expand Down Expand Up @@ -38,7 +38,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "observe"
version = "1.2.3"
version = "1.4.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]
Expand All @@ -50,7 +50,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "jaeger"
version = "0.5.3"
version = "1.0.0"
dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ def artifactLibParent = file("${project.buildDir}/lib_parent/")
def tomlVersion = stripBallerinaExtensionVersion("${project.version}")
def ballerinaCentralAccessToken = System.getenv('BALLERINA_CENTRAL_ACCESS_TOKEN')
def originalConfig = ballerinaConfigFile.text
def artifactJar = file("$project.projectDir/target/cache/${packageOrg}/${packageName}/${tomlVersion}/java17/")
def platform = "java17"
def artifactJar = file("$project.projectDir/target/cache/${packageOrg}/${packageName}/${tomlVersion}/java21/")
def platform = "java21"
def skipTests = false

def stripBallerinaExtensionVersion(String extVersion) {
Expand Down
21 changes: 14 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import org.apache.tools.ant.taskdefs.condition.Os

plugins {
id 'checkstyle'
id "com.github.spotbugs" version "5.0.14"
id "net.researchgate.release" version "2.8.0"
id "de.undercouch.download" version "5.4.0"
id "com.github.spotbugs" version "${githubSpotbugsVersion}"
id "com.github.johnrengelman.shadow" version "${githubJohnrengelmanShadowVersion}"
id "de.undercouch.download" version "${underCouchDownloadVersion}"
id "net.researchgate.release" version "${researchgateReleaseVersion}"
id "jacoco"
}

Expand Down Expand Up @@ -75,8 +76,11 @@ subprojects {
}

spotbugsMain {
it.effort "max"
it.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")
it.effort = SpotBugsEffort.MAX
it.reportLevel = SpotBugsConfidence.LOW
it.reports {
xml.enabled false
html.enabled true
Expand All @@ -88,8 +92,11 @@ subprojects {
}

spotbugsTest {
it.effort "max"
it.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")
it.effort = SpotBugsEffort.MAX
it.reportLevel = SpotBugsConfidence.LOW
it.reports {
xml.enabled false
html.enabled true
Expand Down
7 changes: 6 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@

group=org.ballerinalang
version=1.0.0-SNAPSHOT
ballerinaLangVersion=2201.10.0
ballerinaLangVersion=2201.11.0-20241218-101200-109f6cc7
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs='-Dfile.encoding=UTF-8'
org.gradle.workers.max=3

githubSpotbugsVersion=6.0.18
githubJohnrengelmanShadowVersion=8.1.1
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0

# Native Dependency Versions
openTelemetryVersion=1.32.0
openTelemetryExporterVersion=1.14.0
Expand Down

0 comments on commit 3122bbb

Please sign in to comment.