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

Upgrade to Java 17 #32

Merged
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
4 changes: 2 additions & 2 deletions .github/workflows/build-timestamped-master.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: 'adopt'
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/publish-release.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: 'adopt'
java-version: 11
java-version: 17.0.7
- 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
8 changes: 4 additions & 4 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,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 @@ -27,10 +27,10 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 11
java-version: 17.0.7
- 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 @@ -40,9 +40,9 @@ For information on how to generate Ballerina code for Protocol Buffers definitio

### Set Up the prerequisites

* Download and install Java SE Development Kit (JDK) version 11 (from one of the following locations).
* Download and install Java SE Development Kit (JDK) version 17 (from one of the following locations).

* [Oracle](https://www.oracle.com/java/technologies/javase-jdk11-downloads.html)
* [Oracle](https://www.oracle.com/java/technologies/downloads/)

* [OpenJDK](https://adoptopenjdk.net/)

Expand Down
6 changes: 3 additions & 3 deletions build-config/checkstyle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ plugins {
id "de.undercouch.download"
}

apply plugin: 'java'
apply plugin: 'java-library'

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
30 changes: 25 additions & 5 deletions 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 'jacoco'
id "com.github.spotbugs" version "${githubSpotbugsVersion}"
id "com.github.johnrengelman.shadow" version "${githubJohnrengelmanShadowVersion}"
Expand Down Expand Up @@ -69,7 +69,7 @@ allprojects {
}

subprojects {
apply plugin: 'java'
apply plugin: 'java-library'
configurations {
externalJars
ballerinaStdLibs
Expand Down Expand Up @@ -101,9 +101,9 @@ task codeCoverageReport(type: JacocoReport) {
sourceSets it.sourceSets.main
}
reports {
xml.enabled(true)
html.enabled(true)
csv.enabled(true)
xml.required = true
html.required = true
csv.required = true
xml.destination(new File("${buildDir}/reports/jacoco/report.xml"))
html.destination(new File("${buildDir}/reports/jacoco/report.html"))
csv.destination(new File("${buildDir}/reports/jacoco/report.csv"))
Expand All @@ -126,6 +126,25 @@ jar {
}

task directoryBuild {
dependsOn(compileJava)
dependsOn(compileTestJava)
dependsOn(":test")
dependsOn(":jar")
dependsOn(":processResources")
dependsOn(":spotbugsMain")
dependsOn(":spotbugsTest")
dependsOn("compileTestJava")
dependsOn("checkstyle:test")
dependsOn("checkstyle:processTestResources")
dependsOn(":tooling-tests:compileJava")
dependsOn(":tooling-tests:compileTestJava")
dependsOn(":tooling-tests:jar")
dependsOn(":tooling-tests:checkstyleTest")
dependsOn(":tooling-tests:spotbugsTest")
dependsOn(":tooling-tests:test")
dependsOn(":tooling-tests:copyStdlibs")
dependsOn(":tooling-tests:jBallerinaPack")
dependsOn(":tooling-tests:jacocoTestReport")
inputs.dir file(project.projectDir)
doLast {
copy {
Expand All @@ -136,6 +155,7 @@ task directoryBuild {

outputs.dir artifactCacheParent
outputs.dir artifactLibParent
doNotTrackState("build needs to run every time")
}

task createArtifactZip(type: Zip) {
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ org.gradle.caching=true
group=io.ballerina
version=0.1.3-SNAPSHOT
#dependency versions
ballerinaLangVersion=2201.7.0
checkstylePluginVersion=8.18
ballerinaLangVersion=2201.8.0-20230726-145300-b2bdf796
checkstylePluginVersion=10.12.1
commonsLang3Version=3.8.1
slf4jVersion=1.7.30
protoGoogleCommonsVersion=1.17.0
protobufJavaVersion=3.20.3
protobufJavaVersion=3.23.4
picocliVersion=4.0.1
githubSpotbugsVersion=4.0.5
githubJohnrengelmanShadowVersion=5.2.0
underCouchDownloadVersion=4.0.4
githubSpotbugsVersion=5.0.14
githubJohnrengelmanShadowVersion=8.1.1
underCouchDownloadVersion=5.4.0
researchgateReleaseVersion=2.8.0
testngVersion=7.4.0
jacocoVersion=0.8.6
testngVersion=7.6.1
jacocoVersion=0.8.10
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
Loading