Skip to content

Commit cd5a983

Browse files
committed
Fix deprecation warnings
1 parent fef8e76 commit cd5a983

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

build.gradle.kts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,11 @@ dependencies {
142142
Logging.NONE -> {
143143
runtimeOnly(libs.slf4j.nop)
144144
}
145+
145146
Logging.SIMPLE -> {
146147
runtimeOnly(libs.slf4j.simple)
147148
}
149+
148150
Logging.FULL -> {
149151
runtimeOnly(libs.log4j.slf4j2)
150152
runtimeOnly(libs.log4j.core)
@@ -172,12 +174,11 @@ kotlin {
172174

173175
// ------------------------------------------------------------------------------------------------------------------ //
174176

175-
project.setProperty("mainClassName", applicationMainClass)
176-
177177
application {
178-
if (hasProperty("openrndr.application")) {
179-
mainClass = "${property("openrndr.application")}"
180-
}
178+
mainClass = if (hasProperty("openrndr.application"))
179+
"${property("openrndr.application")}"
180+
else
181+
applicationMainClass
181182
}
182183

183184
tasks {
@@ -198,7 +199,7 @@ tasks {
198199
}
199200
named<org.beryx.runtime.JPackageTask>("jpackage") {
200201
doLast {
201-
val destPath = if(OperatingSystem.current().isMacOsX)
202+
val destPath = if (OperatingSystem.current().isMacOsX)
202203
"build/jpackage/openrndr-application.app/Contents/Resources/data"
203204
else
204205
"build/jpackage/openrndr-application/data"
@@ -290,11 +291,13 @@ class Openrndr {
290291
"aarch64", "arm-v8" -> "macos-arm64"
291292
else -> "macos"
292293
}
294+
293295
currOs.isLinux -> when (currArch) {
294296
"x86-64" -> "linux-x64"
295297
"aarch64" -> "linux-arm64"
296298
else -> throw IllegalArgumentException("architecture not supported: $currArch")
297299
}
300+
298301
else -> throw IllegalArgumentException("os not supported: ${currOs.name}")
299302
}
300303

@@ -331,25 +334,26 @@ class Openrndr {
331334
}
332335
}
333336
}
337+
334338
val openrndr = Openrndr()
335339

336340
if (properties["openrndr.tasks"] == "true") {
337-
task("create executable jar for $applicationMainClass") {
341+
tasks.register("create executable jar for $applicationMainClass") {
338342
group = " \uD83E\uDD8C OPENRNDR"
339343
dependsOn("shadowJar")
340344
}
341345

342-
task("run $applicationMainClass") {
346+
tasks.register("run $applicationMainClass") {
343347
group = " \uD83E\uDD8C OPENRNDR"
344348
dependsOn("run")
345349
}
346350

347-
task("create standalone executable for $applicationMainClass") {
351+
tasks.register("create standalone executable for $applicationMainClass") {
348352
group = " \uD83E\uDD8C OPENRNDR"
349353
dependsOn("jpackageZip")
350354
}
351355

352-
task("add IDE file scopes") {
356+
tasks.register("add IDE file scopes") {
353357
group = " \uD83E\uDD8C OPENRNDR"
354358
val scopesFolder = File("${project.projectDir}/.idea/scopes")
355359
scopesFolder.mkdirs()

0 commit comments

Comments
 (0)