Skip to content

Commit

Permalink
[Build] Get ready for Java 23 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Schaka committed Sep 15, 2024
1 parent 890c4dd commit 4a4ee89
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 21 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
- name: Set up JDK 22
uses: actions/setup-java@v4
with:
java-version: '21'
java-version: '22'
distribution: 'temurin'

- name: Log in to Docker Hub
Expand All @@ -37,7 +37,7 @@ jobs:
- name: Setup Gradle for a non-wrapper project
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.9
gradle-version: 8.10.1

- name: Build JVM OCI image
run: gradle jib
Expand All @@ -48,7 +48,7 @@ jobs:
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Build Native OCI Image
run: bootBuildImage --publishImage
run: gradle bootBuildImage --publishImage
env:
USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
24 changes: 13 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import com.google.cloud.tools.jib.api.buildplan.ImageFormat
import net.nemerosa.versioning.VersioningExtension
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.springframework.boot.gradle.dsl.SpringBootExtension
import org.springframework.boot.gradle.tasks.aot.ProcessAot
Expand All @@ -10,14 +12,14 @@ import org.springframework.boot.gradle.tasks.run.BootRun
plugins {

id("idea")
id("org.springframework.boot") version "3.3.2"
id("org.springframework.boot") version "3.3.3"
id("io.spring.dependency-management") version "1.1.6"
id("com.google.cloud.tools.jib") version "3.4.3"
id("net.nemerosa.versioning") version "3.1.0"
id("org.graalvm.buildtools.native") version "0.10.2"
id("org.graalvm.buildtools.native") version "0.10.3"

kotlin("jvm") version "2.0.10"
kotlin("plugin.spring") version "2.0.10"
kotlin("jvm") version "2.0.20"
kotlin("plugin.spring") version "2.0.20"

}

Expand All @@ -32,7 +34,7 @@ dependencies {
implementation("com.github.ben-manes.caffeine:caffeine")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")

implementation("io.github.openfeign:feign-core:13.1")
implementation("io.github.openfeign:feign-jackson:13.1")
Expand Down Expand Up @@ -61,7 +63,7 @@ configure<IdeaModel> {

kotlin {
jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(21))
languageVersion.set(JavaLanguageVersion.of(22))
vendor.set(JvmVendorSpec.ADOPTIUM)
}
}
Expand All @@ -71,14 +73,14 @@ tasks.withType<Test> {
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_21.toString()
targetCompatibility = JavaVersion.VERSION_21.toString()
sourceCompatibility = JavaVersion.VERSION_22.toString()
targetCompatibility = JavaVersion.VERSION_22.toString()
}

tasks.withType<KotlinCompile> {
kotlinOptions {
compilerOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = JavaVersion.VERSION_21.toString()
jvmTarget = JVM_22
}
}

Expand Down Expand Up @@ -169,7 +171,7 @@ jib {
}
}
from {
image = "eclipse-temurin:21-jre-jammy"
image = "eclipse-temurin:22-jre-jammy"
auth {
username = System.getenv("DOCKERHUB_USER")
password = System.getenv("DOCKERHUB_PASSWORD")
Expand Down
13 changes: 8 additions & 5 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

group = "com.github.schaka.janitorr"

plugins {
`kotlin-dsl`
kotlin("jvm") version "2.0.20"
`kotlin-dsl` version "5.1.1"
`embedded-kotlin` version "5.1.1"
}

repositories {
mavenCentral()
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_21.toString()
targetCompatibility = JavaVersion.VERSION_21.toString()
sourceCompatibility = JavaVersion.VERSION_22.toString()
targetCompatibility = JavaVersion.VERSION_22.toString()
}

tasks.withType<KotlinCompile> {
kotlinOptions {
compilerOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = JavaVersion.VERSION_21.toString()
jvmTarget = JvmTarget.JVM_22
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
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.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Empty file modified gradlew
100644 → 100755
Empty file.

0 comments on commit 4a4ee89

Please sign in to comment.