v0.7.5e: implemented a basic desktop release build task
This commit is contained in:
parent
7670bc147c
commit
f76730b5ad
|
@ -28,14 +28,25 @@ project.ext.assetsDir = new File("../android/src/main/assets")
|
|||
|
||||
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
|
||||
|
||||
task run(dependsOn: classes, type: JavaExec) {
|
||||
task debug(type: JavaExec) {
|
||||
main = project.mainClassName
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
workingDir = project.assetsDir
|
||||
ignoreExitValue = true
|
||||
}
|
||||
|
||||
//TODO add dist task to generate a .JAR
|
||||
task releaseJAR(type: Jar) {
|
||||
from sourceSets.main.output
|
||||
from project.assetsDir
|
||||
from { configurations.runtimeClasspath.findAll { it.name.endsWith('jar') }.collect { zipTree(it) } }
|
||||
|
||||
manifest {
|
||||
attributes 'Main-Class': project.mainClassName
|
||||
attributes 'Specification-Name': appName
|
||||
attributes 'Specification-Version': appVersionName
|
||||
attributes 'Implementation-Version': appVersionCode
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':core')
|
||||
|
|
|
@ -49,17 +49,6 @@ public class DesktopLauncher {
|
|||
}
|
||||
});
|
||||
|
||||
String version = DesktopLauncher.class.getPackage().getSpecificationVersion();
|
||||
if (version == null) {
|
||||
Game.version = "0.7.5d";
|
||||
}
|
||||
|
||||
try {
|
||||
Game.versionCode = Integer.parseInt(DesktopLauncher.class.getPackage().getImplementationVersion());
|
||||
} catch (NumberFormatException e) {
|
||||
Game.versionCode = 372;
|
||||
}
|
||||
|
||||
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
|
||||
|
||||
config.width = 1920;
|
||||
|
@ -69,7 +58,23 @@ public class DesktopLauncher {
|
|||
config.foregroundFPS = 0;
|
||||
config.backgroundFPS = -1;
|
||||
|
||||
config.title = "Shattered Pixel Dungeon";
|
||||
//TODO rather than hardcoding these values when running debug
|
||||
// it would be nice to be able to fetch them from gradle in some way
|
||||
config.title = DesktopLauncher.class.getPackage().getSpecificationTitle();
|
||||
if (config.title == null) {
|
||||
config.title = "ShatteredPD INDEV";
|
||||
}
|
||||
|
||||
Game.version = DesktopLauncher.class.getPackage().getSpecificationVersion();
|
||||
if (Game.version == null) {
|
||||
Game.version = "0.7.5d-INDEV";
|
||||
}
|
||||
|
||||
try {
|
||||
Game.versionCode = Integer.parseInt(DesktopLauncher.class.getPackage().getImplementationVersion());
|
||||
} catch (NumberFormatException e) {
|
||||
Game.versionCode = 380;
|
||||
}
|
||||
|
||||
new LwjglApplication(new ShatteredPixelDungeon(new DesktopPlatformSupport()), config);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user