Skip to content

Commit

Permalink
Merge pull request #545 from tonihele/feature/gradle-template-improve…
Browse files Browse the repository at this point in the history
…ments

Feature/gradle template improvements
  • Loading branch information
tonihele authored Nov 13, 2023
2 parents 48dfc0a + 75aea92 commit 93440a2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ plugins {
group 'com.mygame'
version '1.0'

mainClassName = "com.mygame.Main"
application {
applicationName = '${name}'
mainClass = 'com.mygame.Main'
// Mac OS with LWJGL 3 needs to be started with this JVM argument
if (System.getProperty("os.name").toLowerCase().contains("mac")) {
applicationDefaultJvmArgs = ['-XstartOnFirstThread']
}
}

repositories {
mavenCentral()
jcenter()
maven { url 'https://jitpack.io' }
}

Expand Down Expand Up @@ -45,7 +51,10 @@ dependencies {
implementation "org.jmonkeyengine:jme3-core:$jmeVer"
implementation "org.jmonkeyengine:jme3-desktop:$jmeVer"
<#if jmeVersion.versionInfo.major gt 3 || (jmeVersion.versionInfo.major == 3 && jmeVersion.versionInfo.minor gte 6 )>
implementation "org.jmonkeyengine:jme3-awt-dialogs:$jmeVer"
// Mac OS with LWJGL 3 doesn't allow AWT/Swing
if (!System.getProperty("os.name").toLowerCase().contains("mac")) {
implementation "org.jmonkeyengine:jme3-awt-dialogs:$jmeVer"
}
</#if>
<#if lwjglLibrary.isCoreJmeLibrary == true>
implementation "${lwjglLibrary.groupId}:${lwjglLibrary.artifactId}:$jmeVer"
Expand Down Expand Up @@ -99,7 +108,7 @@ dependencies {

jar {
manifest {
attributes 'Main-Class': "$mainClassName"
attributes 'Main-Class': application.mainClass
}
}

Expand All @@ -110,5 +119,5 @@ java {
}

wrapper {
gradleVersion = '7.6'
gradleVersion = '8.4'
}
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private String[] createSteps() {
// Create build.gradle from template
File gradleBuildFile = new File(dirF, "build.gradle");
Map<String, Object> 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"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public enum AdditionalLibrary implements TemplateLibrary {
SHADERBLOW_EX("ShaderBlowEx", NbBundle.getMessage(AdditionalLibrary.class,
"additionalLibrary.shaderblowex.description"),
"com.github.polincdev", "ShaderBlowEx",
"master-SNAPSHOT", false),
"-SNAPSHOT", false),
SIO2("SiO2", NbBundle.getMessage(AdditionalLibrary.class,
"additionalLibrary.sio2.description"),
"com.simsilica", "sio2",
Expand Down

0 comments on commit 93440a2

Please sign in to comment.