Skip to content

Commit

Permalink
Merge pull request #996 from ballerina-platform/java_17_migration
Browse files Browse the repository at this point in the history
Sync Java 17 migration branch with master
  • Loading branch information
warunalakshitha committed Aug 10, 2023
2 parents bf99cf7 + 3fd4925 commit 139a4d4
Show file tree
Hide file tree
Showing 30 changed files with 256 additions and 186 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
8 changes: 4 additions & 4 deletions .github/workflows/build-timestamped-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
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
8 changes: 4 additions & 4 deletions .github/workflows/central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17.0.7
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/daily-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- name: Set up JDK 11
uses: actions/setup-java@v2
- name: Set up JDK 17
uses: actions/setup-java@v3
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
8 changes: 4 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
runs-on: ubuntu-latest
if: github.repository_owner == 'ballerina-platform'
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ jobs:
name: Build on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 11
java-version: 17.0.7
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand All @@ -31,12 +31,12 @@ jobs:
name: Build on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
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/trivy-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
name: Build on Ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ Follow one of the following ways to add the corresponding database JAR in the fi

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

* Add JAR with a maven dependency params
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
artifactId = "h2"
version = "2.0.206"
groupId = "com.h2database"
Expand Down Expand Up @@ -468,8 +468,8 @@ This repository only contains the source code for the library.

### 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. Export GitHub personal access token with read package permissions as follows,
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 = "java.jdbc-native"
version = "1.10.1"
path = "../native/build/libs/java.jdbc-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
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.7.0"
distribution-version = "2201.8.0-20230726-145300-b2bdf796"

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -239,7 +239,7 @@ dependencies = [
[[package]]
org = "ballerina"
name = "log"
version = "2.8.0"
version = "2.8.1"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "io"},
Expand Down
4 changes: 2 additions & 2 deletions ballerina/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Follow one of the following ways to add the corresponding database JAR in the fi

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

* Add JAR with a maven dependency params
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
artifactId = "h2"
version = "2.0.206"
groupId = "com.h2database"
Expand Down
4 changes: 2 additions & 2 deletions ballerina/Package.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Follow one of the following ways to add the corresponding database JAR in the fi

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

* Add JAR with a maven dependency params
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
artifactId = "h2"
version = "2.0.206"
groupId = "com.h2database"
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 = "java.jdbc-native"
version = "@toml.version@"
path = "../native/build/libs/java.jdbc-native-@project.version@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "io.ballerina.stdlib"
artifactId = "sql-native"
version = "@sql.version@"
Expand Down
8 changes: 4 additions & 4 deletions compiler-plugin-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

plugins {
id 'java'
id 'java-library'
id 'checkstyle'
id 'com.github.spotbugs'
id 'jacoco'
Expand All @@ -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(':java.jdbc-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(':java.jdbc-compiler-plugin').sourceSets.main
}
Expand Down
2 changes: 1 addition & 1 deletion examples/facebook/posts/Working with Facebook Posts.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This is an HTTP RESTful service that is used to insert, create, and retrieve dat

* Set the driver JAR path in the `Ballerina.toml` file.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "PATH"
```
Sample path format for macOS: `/Applications/CData/CData JDBC Driver for Facebook 2021/lib/cdata.jdbc.facebook.jar`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ It is a simple project, which shows how to get user info by using the username a

* Set the driver JAR path in the `Ballerina.toml` file.
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "PATH"
```
Sample path format for macOS: `/Applications/CData/CData JDBC Driver for Facebook 2021/lib/cdata.jdbc.facebook.jar`
Expand Down
4 changes: 2 additions & 2 deletions examples/snowflake/Working with Snowflake and Ballerina.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ An example of creating the above and populating the table is shown in the [`setu
Follow one of the following ways to add the Snowflake JDBC driver JAR in the `Ballerina.toml` file:
* Download the JAR and update the path
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "PATH"
```

* Replace the above path with a maven dependency parameter
```
[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "net.snowflake"
artifactId = "snowflake-jdbc"
version = "3.13.5"
Expand Down
2 changes: 1 addition & 1 deletion examples/snowflake/service/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org = "jdbc"
name = "snowflake"
version = "0.1.0"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "net.snowflake"
artifactId = "snowflake-jdbc"
version = "3.13.5"
2 changes: 1 addition & 1 deletion examples/snowflake/setup/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org = "jdbc"
name = "snowflake"
version = "0.1.0"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "net.snowflake"
artifactId = "snowflake-jdbc"
version = "3.13.5"
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
group=io.ballerina.stdlib
version=1.10.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
ballerinaGradlePluginVersion=1.1.0
testngVersion=7.4.0
ballerinaGradlePluginVersion=2.0.1
testngVersion=7.6.1
h2DriverVersion=2.2.220

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

stdlibSqlVersion=1.10.0

Expand All @@ -21,7 +21,7 @@ stdlibIoVersion=1.5.0
stdlibTimeVersion=2.3.0

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

# Level 03
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 139a4d4

Please sign in to comment.