Setup basic jpackage settings
This commit is contained in:
+37
-2
@@ -10,6 +10,7 @@ buildscript {
|
||||
|
||||
plugins {
|
||||
id 'java'
|
||||
id 'org.beryx.runtime' version '1.11.2'
|
||||
}
|
||||
|
||||
group 'games.rednblack'
|
||||
@@ -45,10 +46,11 @@ task packTextures {
|
||||
}
|
||||
}
|
||||
|
||||
project.ext.mainClassName = "games.rednblack.editor.Main"
|
||||
mainClassName = "games.rednblack.editor.Main"
|
||||
project.ext.assetsDir = new File("assets/");
|
||||
def osName = System.getProperty('os.name').toLowerCase(Locale.ROOT)
|
||||
|
||||
task run(dependsOn: classes, type: JavaExec) {
|
||||
task runHyperLap2D(dependsOn: classes, type: JavaExec) {
|
||||
main = project.mainClassName
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
standardInput = System.in
|
||||
@@ -65,8 +67,13 @@ task dist(type: Jar) {
|
||||
manifest {
|
||||
attributes 'Main-Class': project.mainClassName
|
||||
}
|
||||
|
||||
destinationDirectory = file("$buildDir/lib")
|
||||
}
|
||||
|
||||
jpackageImage.dependsOn dist
|
||||
jpackage.dependsOn dist
|
||||
|
||||
dependencies {
|
||||
implementation "com.badlogicgames.gdx:gdx:$gdxVersion"
|
||||
implementation "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
|
||||
@@ -96,3 +103,31 @@ dependencies {
|
||||
|
||||
testImplementation group: 'junit', name: 'junit', version: '4.12'
|
||||
}
|
||||
|
||||
runtime {
|
||||
javaHome.set(System.getProperty("java.home"))
|
||||
options = ['--strip-debug',
|
||||
'--compress', '2',
|
||||
'--no-header-files',
|
||||
'--no-man-pages',
|
||||
'--strip-native-commands',
|
||||
'--vm', 'server']
|
||||
modules = ['java.base',
|
||||
'java.desktop',
|
||||
'jdk.unsupported']
|
||||
distDir = file(buildDir)
|
||||
|
||||
jpackage {
|
||||
mainJar = dist.archiveFileName.get()
|
||||
if (osName.contains('windows')) {
|
||||
imageOptions = ["--icon", file("icons/icon.ico")]
|
||||
installerType = 'msi'
|
||||
} else if (osName.contains('linux')) {
|
||||
imageOptions = ["--icon", file("icons/icon.png")]
|
||||
installerType = 'deb'
|
||||
} else if (osName.contains('mac')) {
|
||||
imageOptions = ["--icon", file("icons/icon.icns")]
|
||||
installerType = 'dmg'
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 120 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
@@ -26,4 +26,6 @@ dependencies {
|
||||
task dist(type: Jar) {
|
||||
from files(sourceSets.main.output.classesDirs)
|
||||
from files(sourceSets.main.output.resourcesDir)
|
||||
|
||||
destinationDirectory = file("../build/lib/plugins")
|
||||
}
|
||||
@@ -26,4 +26,6 @@ dependencies {
|
||||
task dist(type: Jar) {
|
||||
from files(sourceSets.main.output.classesDirs)
|
||||
from files(sourceSets.main.output.resourcesDir)
|
||||
|
||||
destinationDirectory = file("../build/lib/plugins")
|
||||
}
|
||||
@@ -28,4 +28,6 @@ dependencies {
|
||||
task dist(type: Jar) {
|
||||
from files(sourceSets.main.output.classesDirs)
|
||||
from files(sourceSets.main.output.resourcesDir)
|
||||
|
||||
destinationDirectory = file("../build/lib/plugins")
|
||||
}
|
||||
@@ -40,5 +40,7 @@ project.ext.assetsDir = new File("assets/pack");
|
||||
task dist(type: Jar) {
|
||||
from files(sourceSets.main.output.classesDirs)
|
||||
from files(sourceSets.main.output.resourcesDir)
|
||||
from files(project.assetsDir);
|
||||
from files(project.assetsDir)
|
||||
|
||||
destinationDirectory = file("../build/lib/plugins")
|
||||
}
|
||||
Reference in New Issue
Block a user