Skip to content

Commit

Permalink
fix: upgrade to graal-vm 21, kotlin 1.9.20-RC gradle 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
xmlking committed Oct 22, 2023
1 parent 1fe65eb commit 8dc2882
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 51 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ sdk i springboot
sdk i quarkus

# optional
sdk i java 20.0.1-graal
# Do you want java 20.0.2-graalce to be set as default? (Y/n): n
# and add GRAALVM_HOME environment variable to ~/my/exports.zsh
export GRAALVM_HOME=$HOME/.sdkman/candidates/java/20.0.2-graalce
sdk i java 21-graal
# Do you want java 21-graal to be set as default? (Y/n): n
```

[Oracle GraalVM Container Images](https://blogs.oracle.com/java/post/new-oracle-graalvm-container-images)

### IntelliJ Plugins

1. [Spotless](https://plugins.jetbrains.com/plugin/18321-spotless-gradle)
Expand Down
22 changes: 14 additions & 8 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ affectedModuleDetector {
baseDir = "${project.rootDir}"
pathsAffectingAllModules = setOf("gradle/libs.versions.toml")
logFilename = "output.log"
logFolder = "${rootProject.buildDir}/affectedModuleDetector"
logFolder = "${rootProject}/build/affectedModuleDetector"
specifiedBranch = "main"
compareFrom = "SpecifiedBranchCommit" // default is PreviousCommit
}
Expand Down Expand Up @@ -225,14 +225,20 @@ subprojects {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
languageVersion.set(JavaLanguageVersion.of(21))
}
withSourcesJar()
withJavadocJar()
}

kotlin {
jvmToolchain(17)
sourceSets.all {
languageSettings {
languageVersion = "2.0"
apiVersion = "2.0"
}
}
jvmToolchain(21)
}

spotless {
Expand All @@ -258,7 +264,7 @@ subprojects {
kotlinOptions {
// TODO: Ultimately we need allWarningsAsErrors = true
// allWarningsAsErrors = true // Treat all Kotlin warnings as errors
jvmTarget = JavaVersion.VERSION_17.toString()
jvmTarget = JavaVersion.VERSION_21.toString()
javaParameters = true
freeCompilerArgs = listOf(
// "-Xjvm-enable-preview",
Expand All @@ -271,7 +277,7 @@ subprojects {

compileTestKotlin {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_17.toString()
jvmTarget = JavaVersion.VERSION_21.toString()
javaParameters = true
freeCompilerArgs = listOf(
// "-Xjvm-enable-preview",
Expand Down Expand Up @@ -417,8 +423,8 @@ subprojects {
}
} else {
maven {
val releasesRepoUrl = "$buildDir/repos/releases"
val snapshotsRepoUrl = "$buildDir/repos/snapshots"
val releasesRepoUrl = "$projectDir/build/repos/releases"
val snapshotsRepoUrl = "$projectDir/build/repos/snapshots"
url = if (isSnapshot) uri(snapshotsRepoUrl) else uri(releasesRepoUrl)
}
}
Expand All @@ -442,7 +448,7 @@ tasks {
}

// optional parameters
outputDir = "$buildDir/dependencyUpdates"
outputDir = "$projectDir/build/dependencyUpdates"
checkForGradleUpdate = true
revision = "release"
gradleReleaseChannel = "current"
Expand Down
7 changes: 7 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
kotlin("jvm") version "1.9.20-RC" // TODO: remove after stable
`kotlin-dsl`
}

Expand All @@ -8,6 +9,12 @@ repositories {
gradlePluginPortal()
}

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

dependencies {
// add plugin artifacts, so we can reference them in plugins block in the precompiled script
// in the future maybe we could update below to <plugin id>:<plugin id>.gradle.plugin:<plugin version> coordinates
Expand Down
4 changes: 2 additions & 2 deletions docs/advanced/opentelemetry.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ Gradle setup
jvmArgs = listOf(
// This will set logs level DEBUG only for local development.
"-Dlogging.level.micro.apps=DEBUG",
"-javaagent:$buildDir/agent/opentelemetry-javaagent-all.jar",
"-javaagent:$projectDir/build/agent/opentelemetry-javaagent-all.jar",
// "-Dotel.javaagent.debug=true",
"-Dotel.traces.exporter=logging",
// "-Dotel.traces.exporter=jaeger",
Expand All @@ -81,7 +81,7 @@ Gradle setup
/*** copy oTel agent ***/
val copyOpenTelemetryAgent = tasks.register<Sync>("copyOpenTelemetryAgent") {
from(openTelemetry.asPath)
into("$buildDir/agent")
into("$projectDir/build/agent")
rename("opentelemetry-javaagent-(.+?)-all.jar", "opentelemetry-javaagent-all.jar")
}
tasks.named("processResources") {
Expand Down
16 changes: 8 additions & 8 deletions docs/introduction/java-prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@

> you need following tools. versions listed here are minimal versions tested.
| Software | Version | Optional |
|-------------------------------|------------|----------|
| Java | 21-graal | 17-graal |
| Kotlin | 1.9.0 | |
| Gradle | 8.4-rc-1 | |
| IntelliJ | | 2021.1 |
| Docker for Mac | latest | |
| SDKMan | latest | |
| Software | Version | Optional |
|-------------------------------|----------|----------|
| Java | 21-graal | 17-graal |
| Kotlin | 1.9.20 | |
| Gradle | 8.4 | |
| IntelliJ | 2023.2.3 | |
| Docker for Mac | latest | |
| SDKMan | latest | |


### Install Prerequisites
Expand Down
38 changes: 19 additions & 19 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
[versions]

# plugins
kotlin = "1.9.0"
lombok-plugin = "8.0.1"
kotlin = "1.9.20-RC"
lombok-plugin = "8.4"
kover = "0.6.1"
benchmark = "0.4.7"
benchmark = "0.4.9"
spotless = "6.18.0"
versions = "0.46.0"
update = "0.8.0"
release = "1.15.0"
versions = "0.49.0"
update = "0.8.1"
release = "1.15.5"
shadow = "8.1.1"
jib = "3.3.1"
logging = "0.11.0"
protobufPlugin = "0.9.2"
quarkus = "2.16.6.Final"
spring-boot = "3.2.0-M1"
spring-dependencyManagement = "1.1.2"
jib = "3.4.0"
logging = "0.11.1"
protobufPlugin = "0.9.4"
quarkus = "3.5.0.CR1"
spring-boot = "3.2.0-RC1"
spring-dependencyManagement = "1.1.3"
spring-aot = "0.12.2"
flyway = "9.17.0"
flyway = "9.22.3"
flywayTest = "9.5.0"
native = "0.9.23"
native = "0.9.28"
amd = "0.2.1"
dependencycheck = "8.2.1"
dependencycheck = "8.4.2"
dotenv = "2.0.0"
graphql-generator = "1.18.9"
#graphql-generator = "2.0RC1"
graphql-kotlin = "7.0.0-alpha.4"
#graphql-generator = "2.3.1"
graphql-kotlin = "7.0.1"

# kotlin
spek = "2.0.11"
Expand All @@ -50,7 +50,7 @@ jakartaPersistence = "3.1.0"
kotlinRetry = "1.0.9"

# gradle
gradleTool = "8.4-rc-1"
gradleTool = "8.4"

# test matchers
hamcrest = "1.3"
Expand Down Expand Up @@ -104,7 +104,7 @@ springKotest = "1.1.2"
springMockk = "4.0.2"
snakeyaml = "1.33"
springGrpc = "5.0.0"
springCloud = "2022.0.2"
springCloud = "2023.0.0-M2"
springCloudGcp = "4.0.0"
querydsl = "5.0.0"
lombok = "1.18.26"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-rc-1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion services/redis/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ tasks {
bindings.set(
listOf(
// "${rootDir}/infra/bindings/ca-certificates:/platform/bindings/ca-certificates",
// "$buildDir/agent:/workspace/agent:ro"
// "$projectDir/build/agent:/workspace/agent:ro"
)
)

Expand Down
2 changes: 1 addition & 1 deletion services/spring-demo/build.gradle.aot.kts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ springAot {
val copyOpenTelemetryAgent = tasks.register<Sync>("copyOpenTelemetryAgent") {
println(openTelemetry.asPath)
from(openTelemetry.asPath)
into("$buildDir/agent")
into("$projectDir/build/agent")
rename("opentelemetry-javaagent-(.+?).jar", "opentelemetry-javaagent.jar")
}
tasks.named("processAotResources") {
Expand Down
6 changes: 3 additions & 3 deletions services/spring-demo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ tasks {
bindings.set(
listOf(
// "${rootDir}/infra/bindings/ca-certificates:/platform/bindings/ca-certificates",
"$buildDir/agent:/workspace/agent:ro"
"$projectDir/build/agent:/workspace/agent:ro"
)
)

Expand Down Expand Up @@ -150,7 +150,7 @@ tasks {
jvmArgs = listOf(
// This will set logs level DEBUG only for local development.
"-Dlogging.level.micro.apps=DEBUG",
"-javaagent:$buildDir/agent/opentelemetry-javaagent.jar",
"-javaagent:$projectDir/build/agent/opentelemetry-javaagent.jar",
// "-Dotel.javaagent.debug=true",
"-Dotel.traces.exporter=logging",
// "-Dotel.traces.exporter=jaeger",
Expand All @@ -167,7 +167,7 @@ tasks {
val copyOpenTelemetryAgent = tasks.register<Sync>("copyOpenTelemetryAgent") {
println(openTelemetry.asPath)
from(openTelemetry.asPath)
into("$buildDir/agent")
into("$projectDir/build/agent")
rename("opentelemetry-javaagent-(.+?).jar", "opentelemetry-javaagent.jar")
}
tasks.named("processResources") {
Expand Down
2 changes: 1 addition & 1 deletion services/spring-graphql-jpa/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ configurations {
/*
idea {
module {
val kaptMain = file("$buildDir/generated/source/kapt/main")
val kaptMain = file("projectDir/build/generated/source/kapt/main")
sourceDirs.plusAssign(kaptMain)
generatedSourceDirs.plusAssign(kaptMain)
}
Expand Down
4 changes: 2 additions & 2 deletions services/spring-graphql-r2dbc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ noArg {
// Let's configure the GraphQL Gradle Plugin, for the code generation, for both the client and the server pojo
// (the plugin will automatically add it as a dependency to compileJava and processResources)
// The line below adds the generated sources as a java source folder
// sourceSets.main.java.srcDirs += "$buildDir/generated/sources/graphqlGradlePlugin"
// sourceSets.main.resources.srcDirs += "$buildDir/generated/resources/graphqlGradlePlugin"
// sourceSets.main.java.srcDirs += "$projectDir/build/generated/sources/graphqlGradlePlugin"
// sourceSets.main.resources.srcDirs += "$projectDir/build/generated/resources/graphqlGradlePlugin"
// generatePojoConf {
// isAddRelayConnections = true
// javaTypeForIDType = "java.lang.String"
Expand Down
2 changes: 1 addition & 1 deletion services/spring-graphql-redis/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ tasks {
bindings.set(
listOf(
// "${rootDir}/infra/bindings/ca-certificates:/platform/bindings/ca-certificates",
// "$buildDir/agent:/workspace/agent:ro"
// "$projectDir/build/agent:/workspace/agent:ro"
)
)

Expand Down

0 comments on commit 8dc2882

Please sign in to comment.