Skip to content

Commit

Permalink
Merge pull request #33 from ballerina-platform/java_17_migration
Browse files Browse the repository at this point in the history
Sync Java 17 migration branch with main
  • Loading branch information
warunalakshitha committed Jul 31, 2023
2 parents 2b2c5b7 + 61dc283 commit af20694
Show file tree
Hide file tree
Showing 21 changed files with 321 additions and 249 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ensure all Java files use LF.
*.java eol=lf
4 changes: 2 additions & 2 deletions .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Change to Timestamped Version
run: |
initialVersion=$((grep -w 'version' | cut -d= -f2) < gradle.properties )
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-with-bal-test-graalvm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
lang_tag:
description: Branch/Release Tag of the Ballerina Lang
required: true
default: master
default: java_17_migration
lang_version:
description: Ballerina Lang Version (If given ballerina lang buid will be skipped)
required: false
Expand All @@ -30,7 +30,7 @@ jobs:
call_stdlib_workflow:
name: Run StdLib Workflow
if: ${{ github.event_name != 'schedule' || (github.event_name == 'schedule' && github.repository_owner == 'ballerina-platform') }}
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-template.yml@main
uses: ballerina-platform/ballerina-standard-library/.github/workflows/build-with-bal-test-graalvm-template.yml@java_17_migration
with:
lang_tag: ${{ inputs.lang_tag }}
lang_version: ${{ inputs.lang_version }}
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 @@ -18,11 +18,11 @@ jobs:
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
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 @@ -11,11 +11,11 @@ jobs:
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot-nexus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Gradle
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
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 @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand All @@ -35,11 +35,11 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: 11
java-version: 17
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ This repository only contains the source code for the package.

### Set up the prerequisites

1. Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)
1. Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).
* [Oracle](https://www.oracle.com/java/technologies/downloads/)
* [OpenJDK](https://adoptium.net/)

2. Download and install [Docker](https://www.docker.com/get-started)
Expand Down
6 changes: 3 additions & 3 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.7.0"

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

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "1.1.1"
path = "../native/build/libs/persist.sql-native-1.1.1-SNAPSHOT.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist-native"
version = "1.1.1"
Expand Down
18 changes: 10 additions & 8 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ publishing {
}
}

static def checkExecResult(execResult, failText, standardOutput) {
if (execResult) {
if (execResult.getExitValue() != 0) {
throw new GradleException('Non-zero exit value: ' + execResult.getExitValue())
static def checkExecResult(executionResult, failText, standardOutput) {
if (executionResult != null) {
Provider<ExecResult> execResultProvider = executionResult.getProvider()
int exitCode = execResultProvider.get().getExitValue()
if (exitCode != 0) {
throw new GradleException('Non-zero exit value: ' + exitCode)
}
if (standardOutput.toString().contains(failText)) {
throw new GradleException('"' + failText + '" string in output: ' + standardOutput.toString())
Expand All @@ -131,7 +133,7 @@ task createMySQLTestDockerImage(type: Exec) {
commandLine 'sh', '-c', "docker build --platform linux/amd64 -f $project.projectDir/tests/resources/mysql/Dockerfile -t ballerina-persist-mysql" +
" -q $project.projectDir/tests/resources/mysql/"
doLast {
checkExecResult(execResult, 'Error', standardOutput)
checkExecResult(executionResult, 'Error', standardOutput)
sleep(10 * 1000)
}
}
Expand All @@ -157,7 +159,7 @@ task startMySQLTestDockerContainer(type: Exec) {
def healthCheck = 1
def counter = 0
doLast {
checkExecResult(execResult, 'Error', standardOutput)
checkExecResult(executionResult, 'Error', standardOutput)
while (healthCheck != 0 && counter < 12) {
sleep(5 * 1000)
healthCheck = checkMySQLTestDockerContainerStatus('ballerina-persist-mysql')
Expand Down Expand Up @@ -192,7 +194,7 @@ task createMSSQLTestDockerImage(type: Exec) {
commandLine 'sh', '-c', "docker build -f $project.projectDir/tests/resources/mssql/Dockerfile -t ballerina-persist-mssql" +
" -q $project.projectDir/tests/resources/mssql/"
doLast {
checkExecResult(execResult, 'Error', standardOutput)
checkExecResult(executionResult, 'Error', standardOutput)
sleep(10 * 1000)
}
}
Expand All @@ -219,7 +221,7 @@ task startMSSQLTestDockerContainer(type: Exec) {
def healthCheck = 1;
def counter = 0;
doLast {
checkExecResult(execResult, 'Error', standardOutput)
checkExecResult(executionResult, 'Error', standardOutput)
while (healthCheck != 0 && counter < 12) {
sleep(5 * 1000)
healthCheck = checkMSSQLTestDockerContainerStatus("ballerina-persist-mssql")
Expand Down
4 changes: 2 additions & 2 deletions build-config/checkstyle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ apply plugin: 'java'

task downloadCheckstyleRuleFiles(type: Download) {
src([
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.3/checkstyle/checkstyle.xml',
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.3/checkstyle/suppressions.xml'
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.4/checkstyle/jdk-17/checkstyle.xml',
'https://raw.githubusercontent.com/wso2/code-quality-tools/v1.4/checkstyle/jdk-17/suppressions.xml'
])
overwrite false
onlyIfNewer true
Expand Down
6 changes: 3 additions & 3 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ icon = "icon.png"
license = ["Apache-2.0"]
distribution = "2201.7.0"

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

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist.sql-native"
version = "@toml.version@"
path = "../native/build/libs/persist.sql-native-@project.version@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "persist-native"
version = "@persist.version@"
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ subprojects {
ballerinaStdLibs "org.ballerinalang:transaction-ballerina:${stdlibTransactionVersion}"
ballerinaStdLibs "io.ballerina.stdlib:sql-ballerina:${stdlibSqlVersion}"
ballerinaStdLibs "io.ballerina.stdlib:persist-ballerina:${stdlibPersistVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mysql-ballerina:${testStdlibMysqlVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mssql-ballerina:${testStdlibMssqlVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mysql-ballerina:${stdlibMysqlVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mssql-ballerina:${stdlibMssqlVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mysql.driver-ballerina:${stdlibMysqlDriverVersion}"
ballerinaStdLibs "io.ballerina.stdlib:mssql.driver-ballerina:${stdlibMssqlDriverVersion}"
ballerinaStdLibs "io.ballerina.stdlib:observe-ballerina:${observeVersion}"
Expand Down
22 changes: 11 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
group=io.ballerina.stdlib
version=1.1.1-SNAPSHOT

puppycrawlCheckstyleVersion=8.18
checkstyleToolVersion=7.8.2
githubSpotbugsVersion=4.0.5
githubJohnrengelmanShadowVersion=5.2.0
underCouchDownloadVersion=4.0.4
puppycrawlCheckstyleVersion=10.12.1
checkstyleToolVersion=10.12.1
githubSpotbugsVersion=5.0.14
githubJohnrengelmanShadowVersion=8.1.1
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
testngVersion=7.4.0
testngVersion=7.6.1
gsonVersion=2.10
ballerinaGradlePluginVersion=1.1.0
ballerinaGradlePluginVersion=2.0.1-SNAPSHOT

ballerinaLangVersion= 2201.7.0
ballerinaLangVersion=2201.8.0-20230726-145300-b2bdf796

# Direct Dependencies
# Level 01
Expand All @@ -20,7 +20,7 @@ stdlibTimeVersion=2.3.0
stdlibUrlVersion=2.3.0

# Level 02
stdlibLogVersion=2.8.0
stdlibLogVersion=2.8.1-20230718-085900-36c385c
stdlibOsVersion=1.7.0

# Level 03
Expand Down Expand Up @@ -65,8 +65,8 @@ stdlibOAuth2Version=2.9.0
stdlibTransactionVersion=1.7.0-20230718-132200-1b8ada6

# Test Dependencies
testStdlibMysqlVersion=1.10.0-20230622-110800-e226d3f
testStdlibMssqlVersion=1.10.0-20230622-110800-95caa63
stdlibMysqlVersion=1.10.0-20230622-110800-e226d3f
stdlibMssqlVersion=1.10.0-20230622-110800-95caa63


# Enabled publishing insecure checksums, due to fail to publish to maven central
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit af20694

Please sign in to comment.