Skip to content

Commit

Permalink
Upgrade gradle build
Browse files Browse the repository at this point in the history
This commit upgrades the gradle build so that
- Java 21 is used in the build chain
- Upgrade graalvm plugin
- Use Oracle as Java vendor
- Add toolchain resolver to automatically download requires Java runtime
- Bump Gradle 8.10

Signed-off-by: Paolo Di Tommaso <[email protected]>
  • Loading branch information
pditommaso committed Sep 4, 2024
1 parent 26d9ab3 commit 4dd2527
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
13 changes: 10 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ plugins {
id 'application'
id 'jacoco'
id 'org.cadixdev.licenser' version '0.6.1'
id 'org.graalvm.buildtools.native'
id 'org.graalvm.buildtools.native' version '0.10.2'
id 'com.github.johnrengelman.shadow' version '7.1.2'
}

Expand Down Expand Up @@ -67,6 +67,12 @@ task buildInfo {
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

compileJava {
sourceCompatibility = JavaVersion.toVersion("11")
targetCompatibility = JavaVersion.toVersion("11")
Expand All @@ -93,6 +99,7 @@ test {
}

graalvmNative {
toolchainDetection = true
binaries {
main {
imageName = 'tw'
Expand All @@ -109,14 +116,14 @@ graalvmNative {
buildArgs.add('-H:+ReportExceptionStackTraces')

javaLauncher = javaToolchains.launcherFor {
languageVersion = JavaLanguageVersion.of(17)
languageVersion = JavaLanguageVersion.of(21)
vendor = JvmVendorSpec.matching("Oracle Corporation")
}

}

test {
verbose = true
agent = false
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
7 changes: 7 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@ pluginManagement {
}
}

plugins {
// required to download the toolchain (jdk) from a remote repository
// https://github.com/gradle/foojay-toolchains
// https://docs.gradle.org/current/userguide/toolchains.html#sub:download_repositories
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

rootProject.name = 'tower-cli'

0 comments on commit 4dd2527

Please sign in to comment.