diff --git a/jme3-templates/src/com/jme3/gde/templates/files/freemarker/build.gradle.ftl b/jme3-templates/src/com/jme3/gde/templates/files/freemarker/build.gradle.ftl index 73603c3c..cd3af9e3 100644 --- a/jme3-templates/src/com/jme3/gde/templates/files/freemarker/build.gradle.ftl +++ b/jme3-templates/src/com/jme3/gde/templates/files/freemarker/build.gradle.ftl @@ -7,11 +7,16 @@ plugins { group 'com.mygame' version '1.0' -mainClassName = "com.mygame.Main" +application { + applicationName = '${name}' + mainClass = 'com.mygame.Main' + if (System.getProperty("os.name").toLowerCase().contains("mac")) { + applicationDefaultJvmArgs = ['-XstartOnFirstThread'] + } +} repositories { mavenCentral() - jcenter() maven { url 'https://jitpack.io' } } @@ -99,7 +104,7 @@ dependencies { jar { manifest { - attributes 'Main-Class': "$mainClassName" + attributes 'Main-Class': application.mainClass } } @@ -110,5 +115,5 @@ java { } wrapper { - gradleVersion = '7.6' + gradleVersion = '8.4' } \ No newline at end of file diff --git a/jme3-templates/src/com/jme3/gde/templates/gradledesktop/GradleDesktopGameWizardIterator.java b/jme3-templates/src/com/jme3/gde/templates/gradledesktop/GradleDesktopGameWizardIterator.java index bb18311b..e0f20437 100644 --- a/jme3-templates/src/com/jme3/gde/templates/gradledesktop/GradleDesktopGameWizardIterator.java +++ b/jme3-templates/src/com/jme3/gde/templates/gradledesktop/GradleDesktopGameWizardIterator.java @@ -132,6 +132,7 @@ private String[] createSteps() { // Create build.gradle from template File gradleBuildFile = new File(dirF, "build.gradle"); Map buildFileBindings = new HashMap<>(); + buildFileBindings.put("name", wiz.getProperty("name")); buildFileBindings.put("jmeVersion", wiz.getProperty("jmeVersion")); buildFileBindings.put("lwjglLibrary", wiz.getProperty("lwjglLibrary")); buildFileBindings.put("guiLibrary", wiz.getProperty("guiLibrary"));