Skip to content

Commit

Permalink
Update github workflow to use Java 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Yan Zhou committed Aug 18, 2023
1 parent 5ec76b8 commit 03a3494
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 27 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
java: [8] # TODO: Add 11 once build issues are resolved
java: [11] # TODO: Add 11 once build issues are resolved
name: Java ${{ matrix.java }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
Expand All @@ -20,7 +20,6 @@ jobs:
fetch-depth: 2
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
cache: gradle
- run: ./.github/scripts/build.sh
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ jobs:
strategy:
fail-fast: false
matrix:
java: [8]
java: [11]
name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: zulu
java-version: ${{ matrix.java }}
# Do NOT use caching, since we want to ensure published artifacts are fresh
- run: ./.github/scripts/publish.sh
Expand Down
7 changes: 6 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,12 @@ allprojects {
throw new GradleScriptException("Pegasus required Java 8 or later to build, current version: ${JavaVersion.current()}", null)
}
// for all supported versions that we test build, fail the build if any compilation warnings are reported
compile.options.compilerArgs = ['-Xlint', '-Xlint:-path', '-Xlint:-static' ]
compile.options.compilerArgs = ['-Xlint', '-Xlint:-path', '-Xlint:-static']

if (JavaVersion.current() >= JavaVersion.VERSION_11 && !compile.getName().equals('compileJava11Java')) {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}

tasks.withType(Javadoc)
Expand Down
8 changes: 1 addition & 7 deletions d2-int-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,7 @@ dependencies {
compile externalDependency.commonsIo
compile externalDependency.commonsHttpClient
compile externalDependency.zookeeper
// tools.jar, which is packaged by jdkTools, have been removed after Java 11 and most of the functionalities have been move to JDK internals.
// So using jdkTools after Java 11 will result in "file dose not exist" error. Depending on the error handling, there are 2 possible outcomes:
// 1. falling back to JDK internal implementations.
// 2. not falling back to JDK internal implementations and throwing a build error. This is the case for protobuf plugin.
if (JavaVersion.current() < JavaVersion.VERSION_11) {
compile externalDependency.jdkTools
}
compile externalDependency.jdkTools
compile externalDependency.netty
testCompile externalDependency.testng
testCompile externalDependency.commonsIo
Expand Down
8 changes: 1 addition & 7 deletions d2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ dependencies {
compile externalDependency.zookeeper
compile externalDependency.jacksonCore
compile externalDependency.jacksonDataBind
// tools.jar, which is packaged by jdkTools, have been removed after Java 11 and most of the functionalities have been move to JDK internals.
// So using jdkTools after Java 11 will result in "file dose not exist" error. Depending on the error handling, there are 2 possible outcomes:
// 1. falling back to JDK internal implementations.
// 2. not falling back to JDK internal implementations and throwing a build error. This is the case for protobuf plugin.
if (JavaVersion.current() < JavaVersion.VERSION_11) {
compile externalDependency.jdkTools
}
compile externalDependency.jdkTools
compile externalDependency.zero_allocation_hashing
compile externalDependency.xchart
compileOnly externalDependency.findbugs
Expand Down
10 changes: 2 additions & 8 deletions restli-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {

// This block is only supported and required when building with JDK11+
if (JavaVersion.current() >= JavaVersion.VERSION_11) {
//We need a custom source set for JDK11+ classes
// We need a custom source set for JDK11+ classes
sourceSets {
java11 {
java {
Expand Down Expand Up @@ -52,13 +52,7 @@ dependencies {
compile externalDependency.commonsLang
compile externalDependency.jacksonCore
compile externalDependency.jacksonDataBind
// tools.jar, which is packaged by jdkTools, have been removed after Java 11 and most of the functionalities have been move to JDK internals.
// So using jdkTools after Java 11 will result in "file dose not exist" error. Depending on the error handling, there are 2 possible outcomes:
// 1. falling back to JDK internal implementations.
// 2. not falling back to JDK internal implementations and throwing a build error. This is the case for protobuf plugin.
if (JavaVersion.current() < JavaVersion.VERSION_11) {
compile externalDependency.jdkTools
}
compile externalDependency.jdkTools
compile externalDependency.velocity

testCompile externalDependency.mockito
Expand Down

0 comments on commit 03a3494

Please sign in to comment.