Skip to content

Commit

Permalink
Merge pull request #378 from ballerina-platform/java_17_migration
Browse files Browse the repository at this point in the history
Sync Java 17 changes into master branch
  • Loading branch information
warunalakshitha authored Jul 31, 2023
2 parents f956715 + b90955b commit 81aa57c
Show file tree
Hide file tree
Showing 14 changed files with 230 additions and 162 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
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/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-version: '17'
- name: Set version env variable
run: echo "VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV
- name: Pre release depenency version update
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request.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@v2
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
java-version: '17'
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
Expand Down
6 changes: 4 additions & 2 deletions build-config/checkstyle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ plugins {

task downloadMultipleFiles(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 All @@ -44,3 +44,5 @@ artifacts.add('default', file("$project.buildDir/checkstyle.xml")) {
artifacts.add('default', file("$project.buildDir/suppressions.xml")) {
builtBy('downloadMultipleFiles')
}

tasks.compileJava.dependsOn(':build-config:checkstyle:downloadMultipleFiles')
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
plugins {
id "base"
id "com.github.spotbugs" version "4.0.5"
id "de.undercouch.download" version "4.0.4"
id 'net.researchgate.release' version '2.6.0'
id "com.github.spotbugs" version "${githubSpotbugsVersion}"
id "de.undercouch.download" version "${downloadVersion}"
id 'net.researchgate.release' version "${researchgateReleaseVersion}"
}

description = 'Ballerinax - DataMapper Extension'

ext.puppycrawlCheckstyleVersion = "8.18"
ext.puppycrawlCheckstyleVersion = project.puppycrawlCheckstyleVersion
ext.ballerinaLangVersion = project.ballerinaLangVersion
ext.dataMapperVersion = project.version

Expand Down
7 changes: 6 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ org.gradle.jvmargs='-Dfile.encoding=UTF-8'
group=org.ballerinax.datamapper
version=2.2.1-SNAPSHOT
systemProp.org.gradle.internal.publish.checksums.insecure=true
ballerinaLangVersion=2201.4.0
ballerinaLangVersion=2201.8.0-20230726-145300-b2bdf796
stdlibIoVersion=1.4.0

puppycrawlCheckstyleVersion=10.12.0
githubSpotbugsVersion=5.0.14
downloadVersion=5.4.0
researchgateReleaseVersion=2.8.0

observeVersion=1.0.7
observeInternalVersion=1.0.6
20 changes: 11 additions & 9 deletions gradle/javaProject.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}

sourceCompatibility = JavaVersion.VERSION_11
sourceCompatibility = JavaVersion.VERSION_17

configurations {
bDistributionDir
Expand All @@ -17,15 +17,16 @@ configurations {
}

dependencies {
jacocoRuntime "org.jacoco:org.jacoco.agent:0.8.5:runtime"
jacocoRuntime "org.jacoco:org.jacoco.agent:0.8.10:runtime"

compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.8.6'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.8.6'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.8.0'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.15.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.15.2'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.15.2'
implementation group: 'org.ballerinalang', name: 'ballerina-lang', version: "${ballerinaLangVersion}"
implementation group: 'org.ballerinalang', name: 'ballerina-test-utils', version: "${ballerinaLangVersion}"
implementation group: 'org.ballerinalang', name: 'ballerina-tools-api', version: "${ballerinaLangVersion}"
testCompile 'org.testng:testng:6.13.1'
implementation group: 'org.ballerinalang', name: 'ballerina-parser', version: "${ballerinaLangVersion}"
testImplementation 'org.testng:testng:7.6.1'

checkstyle project(":build-config:checkstyle")
checkstyle "com.puppycrawl.tools:checkstyle:${puppycrawlCheckstyleVersion}"
Expand Down Expand Up @@ -64,6 +65,7 @@ task unpackStdLibs() {
task copyStdlibs(type: Copy) {
dependsOn unpackStdLibs
into bDistribution
duplicatesStrategy = 'include'

/* Standard Libraries */
configurations.ballerinaStdLibs.resolvedConfiguration.resolvedArtifacts.each { artifact ->
Expand Down Expand Up @@ -95,6 +97,7 @@ task copyStdlibs(type: Copy) {

task copyLib(type: Copy) {
dependsOn unzip
dependsOn jar
into("${bDistribution}/bre/lib/")
from "${project.buildDir}/libs"
}
Expand All @@ -103,7 +106,6 @@ test {
dependsOn copyStdlibs
dependsOn copyLib
systemProperty "java.util.logging.config.file", "src/test/resources/logging.properties"
systemProperty "java.util.logging.manager", "org.ballerinalang.logging.BLogManager"
systemProperty "ballerina.home", "$bDistribution.absolutePath"

useTestNG() {
Expand All @@ -127,7 +129,7 @@ test {
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
xml.required = true
}
}

Expand Down Expand Up @@ -163,7 +165,7 @@ task validateSpotbugs() {
}

checkstyle {
toolVersion '7.8.2'
toolVersion '10.12.0'
configFile rootProject.file("build-config/checkstyle/build/checkstyle.xml")
configProperties = ["suppressionFile" : rootProject.file("build-config/checkstyle/build/suppressions.xml")]
}
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-6.2-all.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 81aa57c

Please sign in to comment.