From c8e009172235f82cc27404eae64ede8a9d727826 Mon Sep 17 00:00:00 2001 From: Lukas Panhorst Date: Tue, 30 Jul 2024 21:10:52 +0200 Subject: [PATCH] Update to Java 21 & Replace depricated buildDir --- build.gradle.kts | 2 +- buildSrc/build.gradle.kts | 2 +- buildSrc/src/main/kotlin/org.openbase.bco.gradle.kts | 4 ++-- docker/Dockerfile | 4 ++-- module/app/util/build.gradle.kts | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index a4621fd612..2ad4888cb2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,6 +18,6 @@ nexusPublishing { tasks.withType(KotlinCompile::class).all { kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index b9f6f1c2fe..3c5f95c096 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -23,6 +23,6 @@ dependencies { tasks.withType { kotlinOptions { - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/buildSrc/src/main/kotlin/org.openbase.bco.gradle.kts b/buildSrc/src/main/kotlin/org.openbase.bco.gradle.kts index 681c515cba..89a94743f5 100644 --- a/buildSrc/src/main/kotlin/org.openbase.bco.gradle.kts +++ b/buildSrc/src/main/kotlin/org.openbase.bco.gradle.kts @@ -24,7 +24,7 @@ group = "org.openbase" val releaseVersion = !version.toString().endsWith("-SNAPSHOT") java { - sourceCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = sourceCompatibility withSourcesJar() withJavadocJar() @@ -45,7 +45,7 @@ dependencies { tasks.withType { kotlinOptions { freeCompilerArgs = listOf("-Xjsr305=strict") - jvmTarget = "17" + jvmTarget = "21" } } diff --git a/docker/Dockerfile b/docker/Dockerfile index c246598051..e5a37a1e8d 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # Install dependencies -FROM eclipse-temurin:17-jdk AS builder +FROM eclipse-temurin:21-jdk AS builder ENV \ JAVA_OPTS="" \ @@ -38,7 +38,7 @@ RUN cd lib/jul && \ RUN ./gradlew :bco.app.util:installDist -x test -x javadoc --no-daemon --stacktrace # Switch to baseline image -FROM eclipse-temurin:17-jre +FROM eclipse-temurin:21-jre # # Install app COPY --from=builder /workspace/module/app/util/build/install/bco/bin /usr/bin/ diff --git a/module/app/util/build.gradle.kts b/module/app/util/build.gradle.kts index 67463c65a3..24adfe98e9 100644 --- a/module/app/util/build.gradle.kts +++ b/module/app/util/build.gradle.kts @@ -29,7 +29,7 @@ fun createAdditionalScript(name: String, configureStartScripts: CreateStartScrip tasks.register("startScripts$name") { configureStartScripts() applicationName = name - outputDir = File(project.buildDir, "scripts") + outputDir = File(project.layout.buildDirectory.get().asFile, "scripts") classpath = tasks.getByName("jar").outputs.files + configurations.runtimeClasspath.get() }.also { application.applicationDistribution.into("bin") { @@ -117,7 +117,7 @@ tasks.register("deploy-bco-dist") { dependsOn("installDist") val bcoDist = System.getenv("BCO_DIST") ?: "${System.getenv("HOME")}/usr" val mainDist = distributions.getByName("main").distributionBaseName.get() - val fromDir = File(project.buildDir, "install/$mainDist") + val fromDir = File(project.layout.buildDirectory.get().asFile, "install/$mainDist") doFirst { copy { from(fromDir) @@ -148,7 +148,7 @@ tasks.register("testDeploy") { //println("Copy to ${System.getenv("HOME")}/local/bco_tmp") //println("BCO_DIST: ${BCO_DIST}") copy { - from(File(project.buildDir, "install/bco-test")) + from(File(project.layout.buildDirectory.get().asFile, "install/bco-test")) into("${System.getenv("HOME")}/local/bco_tmp") } }