Skip to content

Commit

Permalink
[CALCITE-6421] Add support for JDK 22
Browse files Browse the repository at this point in the history
Bump dependencies
forbiddenapis from 3.4to 3.7
gha actions/checkout from v3 to v4
gha actions/setup-java from v2 to v4

 Replaced deprecated `JavaPluginConvention`
and `buildDir` in `build.gradle.kts` files
  • Loading branch information
snuyanzin authored and vijayjogi-dm committed Jun 18, 2024
1 parent 894cb60 commit 38fc457
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
name: "Validation"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
56 changes: 36 additions & 20 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ jobs:
name: 'Windows (JDK 11)'
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Set up JDK 11'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
Expand All @@ -49,11 +49,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Set up JDK 8'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -65,11 +65,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Set up JDK 8'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 8
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Install Avatica to Maven Local'
Expand All @@ -89,11 +89,11 @@ jobs:
TZ: Pacific/Chatham # flips between +12:45 and +13:45
steps:
- name: 'Set up JDK 11'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -108,11 +108,11 @@ jobs:
TZ: America/New_York # flips between −05:00 and −04:00
steps:
- name: 'Set up JDK 11'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -126,11 +126,11 @@ jobs:
GUAVA: '23.0' # a middle-aged Guava version
steps:
- name: 'Set up JDK 11'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -145,11 +145,11 @@ jobs:
GUAVA: 32.1.1-jre # newest supported Guava version
steps:
- name: 'Set up JDK 11'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -161,11 +161,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Set up JDK 17'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -177,11 +177,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Set up JDK 21'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
Expand All @@ -192,14 +192,30 @@ jobs:
name: 'macOS (JDK 21)'
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Set up JDK 21'
uses: actions/setup-java@v2
uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'zulu'
- name: 'Test'
run: |
./gradlew --no-parallel --no-daemon tasks build javadoc
linux-jdk22:
name: 'Linux (JDK 22)'
runs-on: ubuntu-latest
steps:
- name: 'Set up JDK 22'
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'zulu'
- uses: actions/checkout@v4
with:
fetch-depth: 50
- name: 'Test'
run: |
./gradlew --no-parallel --no-daemon build
4 changes: 2 additions & 2 deletions .github/workflows/publish-non-release-website-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ jobs:
publish-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build site
working-directory: site
run: |
docker compose run -e JEKYLL_UID=$(id -u) -e JEKYLL_GID=$(id -g) build-site
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: apache/calcite-site
path: calcite-site
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-site-and-javadocs-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
publish-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build site
working-directory: site
run: |
Expand All @@ -34,7 +34,7 @@ jobs:
working-directory: site
run: |
docker compose run generate-javadoc
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
repository: apache/calcite-site
path: calcite-site
Expand Down
17 changes: 9 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ val javadocAggregate by tasks.registering(Javadoc::class) {

classpath = files(sourceSets.map { set -> set.map { it.output + it.compileClasspath } })
setSource(sourceSets.map { set -> set.map { it.allJava } })
setDestinationDir(file("$buildDir/docs/javadocAggregate"))
setDestinationDir(file(layout.buildDirectory.get().file("docs/javadocAggregate")))
}

/** Similar to {@link #javadocAggregate} but includes tests.
Expand All @@ -161,7 +161,7 @@ val javadocAggregateIncludingTests by tasks.registering(Javadoc::class) {

classpath = files(sourceSets.map { set -> set.map { it.output + it.compileClasspath } })
setSource(sourceSets.map { set -> set.map { it.allJava } })
setDestinationDir(file("$buildDir/docs/javadocAggregateIncludingTests"))
setDestinationDir(file(layout.buildDirectory.get().file("docs/javadocAggregateIncludingTests")))
}

allprojects {
Expand Down Expand Up @@ -267,7 +267,7 @@ allprojects {
}

plugins.withType<JavaPlugin> {
configure<JavaPluginConvention> {
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
Expand Down Expand Up @@ -469,11 +469,12 @@ allprojects {
archives(sourcesJar)
}

val archivesBaseName = when (path) {
":shaded:avatica" -> "avatica"
else -> "avatica-$name"
base {
archivesName.set(when (path) {
":shaded:avatica" -> "avatica"
else -> "avatica-$name"
})
}
setProperty("archivesBaseName", archivesBaseName)

configure<PublishingExtension> {
if (project.path == ":") {
Expand All @@ -483,7 +484,7 @@ allprojects {
extraMavenPublications()
publications {
create<MavenPublication>(project.name) {
artifactId = archivesBaseName
artifactId = base.archivesName.get()
version = rootProject.version.toString()
description = project.description
from(components["java"])
Expand Down
8 changes: 4 additions & 4 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ tasks {
}
}

val generatedProtobufDir = File(buildDir, "generated/source/proto/main/java")
val generatedProtobufDir = layout.buildDirectory.get().file("generated/source/proto/main/java")

val String.v: String get() = rootProject.extra["$this.version"] as String

Expand All @@ -94,16 +94,16 @@ protobuf {
dependsOn(task)
}
ide {
generatedJavaSources(task, generatedProtobufDir)
generatedJavaSources(task, generatedProtobufDir.asFile)
}
}
}
}

val javaFilteredOutput = File(buildDir, "generated/java-filtered")
val javaFilteredOutput = layout.buildDirectory.get().file("generated/java-filtered")

ide {
generatedJavaSources(filterJava.get(), javaFilteredOutput)
generatedJavaSources(filterJava.get(), javaFilteredOutput.asFile)
}

tasks.processResources {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ com.github.johnrengelman.shadow.version=8.0.0
com.github.spotbugs.version=2.0.0
com.github.vlsi.vlsi-release-plugins.version=1.90
com.google.protobuf.version=0.8.12
de.thetaphi.forbiddenapis.version=3.4
de.thetaphi.forbiddenapis.version=3.7
org.jetbrains.gradle.plugin.idea-ext.version=0.5
org.nosphere.apache.rat.version=0.8.0
org.owasp.dependencycheck.version=5.2.2
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
#
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionSha256Sum=544c35d6bd849ae8a5ed0bcea39ba677dc40f49df7d1835561582da2009b961d
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down

0 comments on commit 38fc457

Please sign in to comment.