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

Sync Java 17 migration branch with master #673

Merged
merged 16 commits into from
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -15,12 +15,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
- 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/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
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
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
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
- 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 @@ -15,12 +15,12 @@ jobs:
group: ${{ github.head_ref }}-ubuntu
cancel-in-progress: true
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
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand All @@ -39,12 +39,12 @@ jobs:
group: ${{ github.head_ref }}-windows
cancel-in-progress: true
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
- 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
- name: Build with Gradle
env:
packageUser: ${{ github.actor }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Get current date
id: date
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,8 +429,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
10 changes: 5 additions & 5 deletions ballerina/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ 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 = "sql-native"
version = "1.10.0"
path = "../native/build/libs/sql-native-1.10.0.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "../test-utils/build/libs/sql-test-utils-1.10.0.jar"
scope = "testOnly"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.zaxxer"
artifactId = "HikariCP"
version = "3.3.1"
path = "./lib/HikariCP-3.3.1.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "./lib/hsqldb-2.7.1.jar"
scope = "testOnly"
5 changes: 2 additions & 3 deletions ballerina/tests/error-test.bal
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,8 @@ function TestInvalidDB() {
test:assertTrue(dbClient is ApplicationError);
ApplicationError sqlError = <ApplicationError> dbClient;
test:assertEquals(sqlError.message(), "Error in SQL connector configuration: Failed to initialize pool: " +
"Connection refused (Connection refused) Caused by :Connection refused (Connection refused) Caused by " +
":Connection refused (Connection refused) Caused by :Connection refused (Connection refused)",
sqlError.message());
"Connection refused Caused by :Connection refused Caused by :Connection refused " +
"Caused by :Connection refused", sqlError.message());
}

@test:Config {
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 @@ -24,8 +24,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
10 changes: 5 additions & 5 deletions build-config/resources/Ballerina.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,25 @@ 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 = "sql-native"
version = "@toml.version@"
path = "../native/build/libs/[email protected]@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "../test-utils/build/libs/[email protected]@.jar"
scope = "testOnly"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
groupId = "com.zaxxer"
artifactId = "HikariCP"
version = "@hikkaricp.lib.version@"
path = "./lib/[email protected]@.jar"

[[platform.java11.dependency]]
[[platform.java17.dependency]]
path = "./lib/[email protected]@.jar"
scope = "testOnly"
48 changes: 48 additions & 0 deletions build-config/spotbugs-exclude.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,52 @@
<Class name="io.ballerina.stdlib.sql.ParameterizedQuery"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.datasource.PoolKey"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.datasource.SQLDatasource$SQLDatasourceParams"/>
<Method name="setConnectionPool"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.datasource.SQLDatasource$SQLDatasourceParams"/>
<Method name="setOptions"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.datasource.SQLDatasource$SQLDatasourceParams"/>
<Method name="setPoolProperties"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.parameterprocessor.DefaultStatementParameterProcessor"/>
<Method name="getInstance"/>
<Bug pattern="MS_EXPOSE_REP"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.transaction.SQLTransactionContext"/>
<Method name="getConnection"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.transaction.SQLTransactionContext"/>
<Method name="getXAResource"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.transaction.SQLTransactionContext"/>
<Bug pattern="EI_EXPOSE_REP2"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.utils.ColumnDefinition"/>
<Method name="getBallerinaType"/>
<Bug pattern="EI_EXPOSE_REP"/>
</Match>
<Match>
<Class name="io.ballerina.stdlib.sql.utils.RecordColumnDefinition"/>
<Method name="getInnerFields"/>
<Bug pattern="EI_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 @@ -48,10 +48,10 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17

jacoco {
toolVersion = "0.8.6"
toolVersion = "0.8.10"
}

test {
Expand All @@ -77,7 +77,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
xml.required = true
}
sourceSets project(':sql-compiler-plugin').sourceSets.main
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private OutParameter() {
*/
public static class TimeRecordTypes {

private TimeRecordTypes(){
private TimeRecordTypes() {
}

public static final String PACKAGE_NAME = "ballerina/time";
Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
group=io.ballerina.stdlib
version=1.10.1-SNAPSHOT

puppycrawlCheckstyleVersion=8.18
puppycrawlCheckstyleVersion=10.12.1
hikkariLibVersion=3.3.1
hsqlDriverVersion=2.7.1
h2Version=1.4.200
atomikosLibVersion=5.0.8
checkstyleToolVersion=7.8.2
githubSpotbugsVersion=4.1.0
githubJohnrengelmanShadowVersion=5.2.0
underCouchDownloadVersion=4.0.4
checkstyleToolVersion=10.12.1
githubSpotbugsVersion=5.0.14
githubJohnrengelmanShadowVersion=8.1.1
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
testngVersion=7.4.0
ballerinaGradlePluginVersion=1.1.0
testngVersion=7.6.1
ballerinaGradlePluginVersion=2.0.1-SNAPSHOT

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

# Direct Dependencies
# Level 01
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