Setup basic jpackage settings

This commit is contained in:
fgnm
2020-08-05 13:39:48 +02:00
parent 8cb076cdba
commit c10fc4cd3b
7 changed files with 46 additions and 3 deletions
+37 -2
View File
@@ -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'
}
}
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 120 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

+2
View File
@@ -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")
}
+2
View File
@@ -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")
}
+2
View File
@@ -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")
}
+3 -1
View File
@@ -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")
}