added possiblity to build jar file and override shutdown behavior when closing via alt-f4 or the close button of the window

This commit is contained in:
Hanno Fleischer
2024-12-13 10:15:45 +01:00
parent 1e5c5bd5eb
commit 3658a91b7b
2 changed files with 21 additions and 1 deletions

View File

@@ -26,3 +26,14 @@ implementation project(":mdga:model")
mainClass = 'pp.mdga.client.MdgaApp'
applicationName = 'MDGA'
}
tasks.register('fatJar', Jar) {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest {
attributes 'Main-Class': 'pp.mdga.client.MdgaApp'
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
with jar
}

View File

@@ -88,7 +88,7 @@ public class MdgaApp extends SimpleApplication {
private final TimerManager timerManager = new TimerManager();
public static final int DEBUG_MULTIPLIER = 0;
public static final int DEBUG_MULTIPLIER = 1;
/**
* Constructs a new MdgaApp instance.
@@ -403,5 +403,14 @@ public TimerManager getTimerManager() {
public CeremonyView getCeremonyView() {
return ceremonyView;
}
@Override
public void destroy() {
afterGameCleanup();
if (executor != null) {
executor.shutdown();
}
super.destroy();
}
}