Working jPackage for macOS
This commit is contained in:
+4
-3
@@ -117,15 +117,15 @@ runtime {
|
||||
'java.desktop',
|
||||
'java.compiler',
|
||||
'java.logging',
|
||||
'jdk.crypto.cryptoki',
|
||||
'java.management',
|
||||
'jdk.crypto.cryptoki',
|
||||
'jdk.crypto.ec',
|
||||
'jdk.unsupported']
|
||||
distDir = file(buildDir)
|
||||
|
||||
jpackage {
|
||||
mainJar = dist.archiveFileName.get()
|
||||
imageOptions += ['--app-version', getVersion(), '--vendor', 'Red & Black Games', '--description', 'HyperLap2D Editor',
|
||||
'--copyright', '(c) 2020, Red & Black Games', '--name', 'HyperLap2D']
|
||||
imageOptions += ['--app-version', getVersion(), '--vendor', 'Red & Black Games', '--description', 'HyperLap2D Editor', '--name', 'HyperLap2D']
|
||||
if (osName.contains('windows')) {
|
||||
imageOptions += ["--icon", file("icons/icon.ico")]
|
||||
installerType = 'msi'
|
||||
@@ -139,6 +139,7 @@ runtime {
|
||||
]
|
||||
resourceDir = file("resources-linux")
|
||||
} else if (osName.contains('mac')) {
|
||||
imageOptions += ['--copyright', '(c) 2020, Red & Black Games']
|
||||
imageOptions += ["--icon", file("icons/icon.icns")]
|
||||
jvmArgs = ['-XstartOnFirstThread', '-Djava.awt.headless=true']
|
||||
installerType = 'dmg'
|
||||
|
||||
+12
-10
@@ -1,5 +1,6 @@
|
||||
package games.rednblack.editor.plugin.tiled.manager;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.g2d.NinePatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
@@ -29,19 +30,20 @@ public class ResourcesManager {
|
||||
}
|
||||
|
||||
private void init() {
|
||||
File atlasTempFile = getResourceFileFromJar(".atlas");
|
||||
File pngTempFile = getResourceFileFromJar(".png");
|
||||
textureAtlas = new TextureAtlas(new FileHandle(atlasTempFile));
|
||||
atlasTempFile.deleteOnExit();
|
||||
pngTempFile.deleteOnExit();
|
||||
FileHandle atlasTempFile = getResourceFileFromJar(".atlas");
|
||||
FileHandle pngTempFile = getResourceFileFromJar(".png");
|
||||
textureAtlas = new TextureAtlas(atlasTempFile);
|
||||
atlasTempFile.file().deleteOnExit();
|
||||
pngTempFile.file().deleteOnExit();
|
||||
}
|
||||
|
||||
private File getResourceFileFromJar(String extension) {
|
||||
String fileName = "/"+RESOURCES_FILE_NAME+extension;
|
||||
File tempFile = new File (System.getProperty("user.dir")+fileName);
|
||||
private FileHandle getResourceFileFromJar(String extension) {
|
||||
String fileName = RESOURCES_FILE_NAME+extension;
|
||||
//File tempFile = new File (System.getProperty("user.dir")+fileName);
|
||||
FileHandle tempFile = Gdx.files.internal(fileName);
|
||||
try {
|
||||
InputStream in = getClass().getResourceAsStream(fileName);
|
||||
FileOutputStream out = new FileOutputStream(tempFile);
|
||||
InputStream in = getClass().getResourceAsStream("/"+fileName);
|
||||
FileOutputStream out = new FileOutputStream(tempFile.file());
|
||||
ByteStreams.copy(in, out);
|
||||
in.close();
|
||||
out.close();
|
||||
|
||||
Reference in New Issue
Block a user