From c646651a18e0fb546963b30e3511d9fa157ac509 Mon Sep 17 00:00:00 2001 From: capdevon Date: Fri, 27 Dec 2024 23:10:39 +0100 Subject: [PATCH] build.gradle: Update jME to v3.7.0-stable --- build.gradle | 68 ++++++++++++++++++++++------------------------------ 1 file changed, 29 insertions(+), 39 deletions(-) diff --git a/build.gradle b/build.gradle index fd82886..a6707f7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,34 +1,16 @@ plugins { + id 'java' id 'java-library' } -description = 'prototypical JMonkeyEngine application' - -// select one source-code (JDK) option -sourceCompatibility = JavaVersion.VERSION_1_8 -targetCompatibility = JavaVersion.VERSION_1_8 - -ext.jmeVersion = '3.6.1-stable' // from mavenCentral +java { + // select one source-code (JDK) option + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 +} -gradle.projectsEvaluated { - tasks.withType(JavaCompile) { // compile-time options: - options.compilerArgs << '-Xdiags:verbose' - options.compilerArgs << '-Xlint:unchecked' - options.deprecation = true - options.encoding = 'UTF-8' - } - tasks.withType(JavaExec) { // runtime options: - args = [] - classpath sourceSets.main.runtimeClasspath - //debug true - enableAssertions true - //jvmArgs '-verbose:gc' - //jvmArgs '-Xbatch' - //jvmArgs '-Xms512m', '-Xmx512m' - //jvmArgs '-XX:+PrintCompilation' - //jvmArgs '-XX:+UseConcMarkSweepGC' - jvmArgs '-XX:+UseG1GC', '-XX:MaxGCPauseMillis=10' - } +project.ext { + jmeVersion = '3.7.0-stable' } repositories { @@ -36,40 +18,48 @@ repositories { } dependencies { + // jMonkeyEngine implementation 'org.jmonkeyengine:jme3-core:' + jmeVersion implementation 'org.jmonkeyengine:jme3-desktop:' + jmeVersion implementation 'org.jmonkeyengine:jme3-effects:' + jmeVersion - runtimeOnly 'org.jmonkeyengine:jme3-awt-dialogs:' + jmeVersion - // PhysicsEngine - implementation 'com.github.stephengold:Minie:8.1.0+big4' + // Mac OS with LWJGL 3 doesn't allow AWT/Swing + if (!System.getProperty("os.name").toLowerCase().contains("mac")) { + runtimeOnly 'org.jmonkeyengine:jme3-awt-dialogs:' + jmeVersion + } + + // Physics + implementation 'com.github.stephengold:Minie:8.2.0+big4' // select one version of LWJGL - //runtimeOnly 'org.jmonkeyengine:jme3-lwjgl:' + jmeVersion // LWJGL 2.x - runtimeOnly 'org.jmonkeyengine:jme3-lwjgl3:' + jmeVersion // LWJGL 3.x + runtimeOnly 'org.jmonkeyengine:jme3-lwjgl:' + jmeVersion // LWJGL 2.x + //runtimeOnly 'org.jmonkeyengine:jme3-lwjgl3:' + jmeVersion // LWJGL 3.x runtimeOnly 'org.jmonkeyengine:jme3-jogg:' + jmeVersion runtimeOnly 'org.jmonkeyengine:jme3-plugins:' + jmeVersion //runtimeOnly 'org.jmonkeyengine:jme3-testdata:' + jmeVersion runtimeOnly 'org.jmonkeyengine:jme3-testdata:3.4.0-alpha6' - - // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 - implementation 'org.apache.commons:commons-lang3:3.15.0' } -// cleanup tasks +wrapper { + gradleVersion = '8.4' +} + +// Register cleanup tasks: + clean.dependsOn('cleanDLLs', 'cleanDyLibs', 'cleanLogs', 'cleanSOs') -task cleanDLLs(type: Delete) { + +tasks.register('cleanDLLs', Delete) { // extracted Windows native libraries delete fileTree(dir: '.', include: '*.dll') } -task cleanDyLibs(type: Delete) { +tasks.register('cleanDyLibs', Delete) { // extracted macOS native libraries delete fileTree(dir: '.', include: '*.dylib') } -task cleanLogs(type: Delete) { +tasks.register('cleanLogs', Delete) { // JVM crash logs delete fileTree(dir: '.', include: 'hs_err_pid*.log') } -task cleanSOs(type: Delete) { +tasks.register('cleanSOs', Delete) { // extracted Linux and Android native libraries delete fileTree(dir: '.', include: '*.so') }