Skip to content

Commit bcaf0c5

Browse files
authored
Merge pull request #136 from demoth/codex/identify-deprecated-features-in-gradle-8.x
Fix Gradle 9 deprecations
2 parents 441f082 + 37f70b9 commit bcaf0c5

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ buildscript {
1818
configure(subprojects) {
1919
apply plugin: 'java-library'
2020
apply plugin: 'kotlin'
21-
sourceCompatibility = 11
21+
java {
22+
sourceCompatibility = JavaVersion.VERSION_11
23+
targetCompatibility = JavaVersion.VERSION_11
24+
}
2225
compileJava {
2326
options.incremental = true
2427
}

cake/lwjgl3/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ else {
2323
}
2424

2525
sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
26-
mainClassName = 'org.demoth.cake.lwjgl3.Lwjgl3GameLauncher'
27-
application.setMainClass(mainClassName)
26+
def mainClassName = 'org.demoth.cake.lwjgl3.Lwjgl3GameLauncher'
27+
application {
28+
mainClass.set(mainClassName)
29+
}
2830
java.sourceCompatibility = 11
2931
java.targetCompatibility = 11
3032

@@ -62,7 +64,7 @@ jar {
6264
}
6365
// setting the manifest makes the JAR runnable.
6466
manifest {
65-
attributes 'Main-Class': project.mainClassName
67+
attributes 'Main-Class': mainClassName
6668
}
6769
// this last step may help on some OSes that need extra instruction to make runnable JARs.
6870
doLast {

cake/lwjgl3/nativeimage.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ project(":cake:lwjgl3") {
99
binaries {
1010
main {
1111
imageName = appName
12-
mainClass = project.mainClassName
12+
mainClass.set('org.demoth.cake.lwjgl3.Lwjgl3GameLauncher')
1313
requiredVersion = '23.0'
1414
buildArgs.add("-march=compatibility")
1515
jvmArgs.addAll("-Dfile.encoding=UTF8")

0 commit comments

Comments
 (0)