Skip to content

Commit e4bb106

Browse files
committed
build(gradle): start gradle upgrade
1 parent cfb2859 commit e4bb106

3 files changed

Lines changed: 25 additions & 20 deletions

File tree

backend

Submodule backend updated 138 files

build.gradle.kts

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import org.gradle.internal.os.OperatingSystem
22
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
3+
import org.gradle.process.ExecOperations
34
import java.util.Properties
45

5-
val minJavaVersion = JavaVersion.VERSION_11
6+
val minJavaVersion = JavaVersion.VERSION_17
67
plugins {
7-
val minJavaVersion = JavaVersion.VERSION_11 // Declared twice because plugins block has its own scope
8+
val minJavaVersion = JavaVersion.VERSION_17 // Declared twice because plugins block has its own scope
89
require(JavaVersion.current() >= minJavaVersion) {
910
"Building requires at least JDK $minJavaVersion - please look into the README"
1011
}
1112

1213
application
13-
kotlin("jvm") version "1.9.25"
14+
kotlin("jvm") version "2.3.0"
1415
id("idea")
1516
id("org.openjfx.javafxplugin") version "0.1.0"
16-
id("com.github.johnrengelman.shadow") version "6.1.0"
17+
id("com.gradleup.shadow") version "9.3.1"
1718

18-
id("com.github.ben-manes.versions") version "0.47.0"
19-
id("se.patrikerdes.use-latest-versions") version "0.2.18"
19+
id("com.github.ben-manes.versions") version "0.53.0"
20+
id("se.patrikerdes.use-latest-versions") version "0.2.19"
2021
}
2122

2223
idea {
@@ -44,7 +45,7 @@ version = try {
4445
println("Current version: $version (Java version: ${JavaVersion.current()})")
4546

4647
application {
47-
mainClassName = "sc.gui.GuiAppKt" // needs shadow-update which needs gradle update to 7.0
48+
mainClass.set("sc.gui.GuiAppKt") // needs shadow-update which needs gradle update to 7.0
4849
}
4950

5051
repositories {
@@ -92,14 +93,14 @@ tasks {
9293
}
9394
}
9495
withType<KotlinCompile> {
95-
kotlinOptions {
96-
jvmTarget = minJavaVersion.toString()
97-
freeCompilerArgs = listOf("-Xjvm-default=all")
96+
compilerOptions {
97+
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.fromTarget(minJavaVersion.toString()))
98+
freeCompilerArgs.addAll("-Xjvm-default=all")
9899
}
99100
}
100101

101102
withType<Jar> {
102-
manifest.attributes["Main-Class"] = application.mainClassName
103+
manifest.attributes["Main-Class"] = application.mainClass.get()
103104
}
104105

105106
javafx {
@@ -113,7 +114,7 @@ tasks {
113114
}
114115

115116
shadowJar {
116-
destinationDirectory.set(buildDir)
117+
destinationDirectory.set(layout.buildDirectory.asFile.get())
117118
archiveClassifier.set(
118119
"${
119120
OperatingSystem.current().familyName.replace(
@@ -140,24 +141,28 @@ tasks {
140141

141142
run.configure {
142143
dependsOn(backend.task(":server:makeRunnable"))
143-
workingDir(buildDir.resolve("run"))
144+
workingDir(layout.buildDirectory.asFile.get().resolve("run"))
144145
doFirst {
145146
workingDir.mkdirs()
146147
}
147148
args = System.getProperty("args", "").split(" ")
148149
}
149150

150-
val release by creating {
151+
val release by registering {
151152
dependsOn(clean, check)
152153
group = "distribution"
153154
description = "Create and push a tagged commit matching the backend version"
154155
doLast {
155156
val desc = project.properties["m"]?.toString()
156157
?: throw InvalidUserDataException("Das Argument -Pm=\"Beschreibung dieser Version\" wird benötigt")
157-
exec { commandLine("git", "add", "CHANGELOG.md") }
158-
exec { commandLine("git", "commit", "-m", "release: v$versionFromBackend") }
159-
exec { commandLine("git", "tag", versionFromBackend, "-m", desc) }
160-
exec { commandLine("git", "push", "--follow-tags", "--recurse-submodules=on-demand") }
158+
val processHelper: (Array<String>) -> Unit = { args ->
159+
val process = ProcessBuilder(*args).start()
160+
process.waitFor()
161+
}
162+
processHelper(arrayOf("git", "add", "CHANGELOG.md"))
163+
processHelper(arrayOf("git", "commit", "-m", "release: v$versionFromBackend"))
164+
processHelper(arrayOf("git", "tag", versionFromBackend, "-m", desc))
165+
processHelper(arrayOf("git", "push", "--follow-tags", "--recurse-submodules=on-demand"))
161166
}
162167
}
163168
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.4-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)