Skip to content

Commit

Permalink
Merge pull request #763 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 Aug 15, 2023
2 parents 0916fa2 + f427ab2 commit 05d2b4f
Show file tree
Hide file tree
Showing 27 changed files with 280 additions and 200 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.0.7
- name: Change to Timestamped Version
run: |
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00')
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.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
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 @@ -13,11 +13,11 @@ jobs:
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.0.7

- name: Set environment variable
if: github.event.action == 'check_connector_for_breaking_changes'
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.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
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.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand All @@ -32,11 +32,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.0.7
- 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.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,23 @@ Follow one of the following ways to add the JARs in the file:

* Download the JAR and update the path.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "PATH"
```

* Add JAR with the Maven dependency params.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.oracle.database.jdbc"
artifactId = "ojdbc8"
artifactId = "ojdbc11"
version = "12.2.0.1"
[platform.java11.dependency]]
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xdb"
version = "21.1.0.0"
[platform.java11.dependency]]
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xmlparserv2"
version = "12.2.0.1"
Expand Down Expand Up @@ -559,8 +559,8 @@ This repository only contains the source code for the package.

### Set up the prerequisites

1. Download and install the 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 the 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
12 changes: 6 additions & 6 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[package]
org = "ballerinax"
name = "oracledb"
version = "1.10.0"
version = "1.10.1"
authors = ["Ballerina"]
keywords = ["database", "client", "network", "SQL", "RDBMS", "OracleDB", "Oracle"]
repository = "https://github.com/ballerina-platform/module-ballerinax-oracledb"
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 = "oracledb-native"
version = "1.10.0"
path = "../native/build/libs/oracledb-native-1.10.0.jar"
version = "1.10.1"
path = "../native/build/libs/oracledb-native-1.10.1-SNAPSHOT.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "sql-native"
version = "1.10.0"
Expand Down
2 changes: 1 addition & 1 deletion ballerina/CompilerPlugin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ id = "oracledb-compiler-plugin"
class = "io.ballerina.stdlib.oracledb.compiler.OracleDBCompilerPlugin"

[[dependency]]
path = "../compiler-plugin/build/libs/oracledb-compiler-plugin-1.10.0.jar"
path = "../compiler-plugin/build/libs/oracledb-compiler-plugin-1.10.1-SNAPSHOT.jar"
8 changes: 4 additions & 4 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.7.0"
distribution-version = "2201.8.0-20230726-145300-b2bdf796"

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -56,7 +56,7 @@ modules = [
[[package]]
org = "ballerina"
name = "file"
version = "1.8.0"
version = "1.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand Down Expand Up @@ -243,7 +243,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand Down Expand Up @@ -390,7 +390,7 @@ modules = [
[[package]]
org = "ballerinax"
name = "oracledb"
version = "1.10.0"
version = "1.10.1"
dependencies = [
{org = "ballerina", name = "crypto"},
{org = "ballerina", name = "file"},
Expand Down
10 changes: 5 additions & 5 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ Follow one of the following ways to add the JARs in the file:

* Download the JAR and update the path.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "PATH"
```

* Add JAR with the Maven dependency params.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.oracle.database.jdbc"
artifactId = "ojdbc8"
artifactId = "ojdbc11"
version = "12.2.0.1"
[platform.java11.dependency]]
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xdb"
version = "21.1.0.0"
[platform.java11.dependency]]
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xmlparserv2"
version = "12.2.0.1"
Expand Down
10 changes: 5 additions & 5 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ Follow one of the following ways to add the JARs in the file:

* Download the JAR and update the path.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "PATH"
```

* Add JAR with the Maven dependency params.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.oracle.database.jdbc"
artifactId = "ojdbc8"
artifactId = "ojdbc11"
version = "12.2.0.1"
[platform.java11.dependency]]
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xdb"
version = "21.1.0.0"
[platform.java11.dependency]]
[platform.java17.dependency]]
groupId = "com.oracle.database.xml"
artifactId = "xmlparserv2"
version = "12.2.0.1"
Expand Down
6 changes: 3 additions & 3 deletions ballerina/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ publishing {

def checkExecResult(execResult, failText, standardOutput) {
if (execResult) {
if (execResult.getExitValue() != 0) {
throw new GradleException('Non-zero exit value: ' + execResult.getExitValue())
if (execResult.get().getExitValue() != 0) {
throw new GradleException('Non-zero exit value: ' + execResult.get().getExitValue())
}
if (standardOutput.toString().contains(failText)) {
throw new GradleException('"' + failText + '" string in output: ' + standardOutput.toString())
Expand All @@ -139,7 +139,7 @@ task createTestDockerImage(type: Exec) {
commandLine 'sh', '-c', "docker build -f $project.projectDir/tests/resources/Dockerfile -t ballerina-oracledb" +
" -q $project.projectDir/tests/resources/"
doLast {
checkExecResult(execResult, 'Error', standardOutput)
checkExecResult(executionResult, 'Error', standardOutput)
sleep(5 * 1000)
}
}
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 @@ -23,8 +23,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 = "oracledb-native"
version = "@toml.version@"
path = "../native/build/libs/oracledb-native-@project.version@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "sql-native"
version = "@sql.version@"
Expand Down
10 changes: 10 additions & 0 deletions build-config/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,14 @@
~ under the License.
-->
<FindBugsFilter>
<Match>
<Class name="io.ballerina.stdlib.oracledb.parameterprocessor.OracleDBResultParameterProcessor"/>
<Method name="getBalStreamResultIterator"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.oracledb.parameterprocessor.OracleDBStatementParameterProcessor"/>
<Method name="getInstance"/>
<Bug pattern="MS_EXPOSE_REP"/>
</Match>
</FindBugsFilter>
6 changes: 3 additions & 3 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies {
checkstyle project(':checkstyle')
checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}"

jacocoRuntime "org.jacoco:org.jacoco.agent:0.8.6:runtime"
jacocoRuntime "org.jacoco:org.jacoco.agent:0.8.10:runtime"

implementation project(':oracledb-compiler-plugin')

Expand All @@ -48,7 +48,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17

test {
systemProperty "ballerina.offline.flag", "true"
Expand All @@ -73,7 +73,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
xml.required = true
}
sourceSets project(':oracledb-compiler-plugin').sourceSets.main
}
Expand Down
Loading

0 comments on commit 05d2b4f

Please sign in to comment.