Fixed tests / Removed win32 packr builds
This commit is contained in:
Binary file not shown.
@@ -3,10 +3,9 @@ sourceSets.main.java.srcDirs = ["src/"]
|
||||
project.ext.mainClassName = "mindustry.desktop.DesktopLauncher"
|
||||
project.ext.assetsDir = new File("../core/assets")
|
||||
|
||||
def enableTemplates = true
|
||||
def JDK_DIR = "$System.env.JDK_DIR"
|
||||
def ICON_DIR = new File("$rootDir/core/assets/icons/icon.icns")
|
||||
def platforms = ["Linux64", "Windows64", "Windows32", "MacOS"]
|
||||
def platforms = ["Linux64", "Windows64", "MacOS"]
|
||||
|
||||
tasks.register('run', JavaExec){
|
||||
dependsOn classes
|
||||
@@ -112,80 +111,66 @@ platforms.each{ platform ->
|
||||
delete "build/packr/output/"
|
||||
}
|
||||
|
||||
//the Windows32 version uses an old java-8 based template, because packr and jpackage don't support win32
|
||||
if(enableTemplates && (platform == "Windows32")){
|
||||
copy{
|
||||
into "build/packr/output"
|
||||
from "${JDK_DIR}/templates/${platform.toString().toLowerCase()}"
|
||||
}
|
||||
def jarPath = JDK_DIR + "packr.jar"
|
||||
def args = new String[]{"java", "-jar", jarPath}
|
||||
|
||||
copy{
|
||||
into "build/packr/output/jre"
|
||||
rename("${appName}.jar", "desktop.jar")
|
||||
from "build/libs/${appName}.jar"
|
||||
}
|
||||
}else{
|
||||
def jarPath = JDK_DIR + "packr.jar"
|
||||
def args = new String[]{"java", "-jar", jarPath}
|
||||
|
||||
args += new String[]{
|
||||
"--platform", platform == "MacOS" ? "Mac" : platform.toString(),
|
||||
"--jdk", JDK_DIR + "jre-${platform.toString().toLowerCase()}",
|
||||
"--executable", appName,
|
||||
"--classpath", "$rootDir/desktop/build/packr/desktop.jar".toString(),
|
||||
"--mainclass", project.ext.mainClassName,
|
||||
"--verbose",
|
||||
"--bundle", getPackage() + ".mac",
|
||||
"--icon", ICON_DIR,
|
||||
"--output", "$rootDir/desktop/build/packr/output".toString(),
|
||||
"--removelibs", "$rootDir/desktop/build/packr/desktop.jar".toString()
|
||||
}
|
||||
|
||||
args += "--vmargs"
|
||||
|
||||
if(platform == "MacOS"){
|
||||
args += "XstartOnFirstThread"
|
||||
}
|
||||
|
||||
args += "Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1"
|
||||
args += "XX:+ShowCodeDetailsInExceptionMessages"
|
||||
args += "XX:+UseCompactObjectHeaders"
|
||||
args += "enable-native-access=ALL-UNNAMED"
|
||||
|
||||
project.services.get(ExecOperations).exec{
|
||||
commandLine args.toList()
|
||||
standardOutput = System.out
|
||||
}
|
||||
|
||||
def outputJsonFile = platform != "MacOS" ? file("build/packr/output/Mindustry.json") : file("build/packr/output/${appName}.app/Contents/Resources/Mindustry.json")
|
||||
|
||||
if(platform != "MacOS"){
|
||||
copy{
|
||||
into "build/packr/output/jre/"
|
||||
from "build/packr/output/desktop.jar"
|
||||
}
|
||||
|
||||
delete{
|
||||
delete "build/packr/output/desktop.jar"
|
||||
}
|
||||
|
||||
outputJsonFile.text = outputJsonFile.text.replace("desktop.jar", "jre/desktop.jar")
|
||||
}else{
|
||||
copy{
|
||||
into "build/packr/output/${appName}.app/Contents/"
|
||||
from "build/packr/output/Contents/"
|
||||
}
|
||||
|
||||
delete{
|
||||
delete "build/packr/output/Contents/"
|
||||
}
|
||||
}
|
||||
|
||||
//packr is broken and won't let me add one hyphen, so I have to do that myself later
|
||||
outputJsonFile.text = outputJsonFile.text.replace("-enable-native-access=ALL-UNNAMED", "--enable-native-access=ALL-UNNAMED")
|
||||
args += new String[]{
|
||||
"--platform", platform == "MacOS" ? "Mac" : platform.toString(),
|
||||
"--jdk", JDK_DIR + "jre-${platform.toString().toLowerCase()}",
|
||||
"--executable", appName,
|
||||
"--classpath", "$rootDir/desktop/build/packr/desktop.jar".toString(),
|
||||
"--mainclass", project.ext.mainClassName,
|
||||
"--verbose",
|
||||
"--bundle", getPackage() + ".mac",
|
||||
"--icon", ICON_DIR,
|
||||
"--output", "$rootDir/desktop/build/packr/output".toString(),
|
||||
"--removelibs", "$rootDir/desktop/build/packr/desktop.jar".toString()
|
||||
}
|
||||
|
||||
if((platform == "Windows64" || platform == "Windows32")){
|
||||
args += "--vmargs"
|
||||
|
||||
if(platform == "MacOS"){
|
||||
args += "XstartOnFirstThread"
|
||||
}
|
||||
|
||||
args += "Dhttps.protocols=TLSv1.2,TLSv1.1,TLSv1"
|
||||
args += "XX:+ShowCodeDetailsInExceptionMessages"
|
||||
args += "XX:+UseCompactObjectHeaders"
|
||||
args += "enable-native-access=ALL-UNNAMED"
|
||||
|
||||
project.services.get(ExecOperations).exec{
|
||||
commandLine args.toList()
|
||||
standardOutput = System.out
|
||||
}
|
||||
|
||||
def outputJsonFile = platform != "MacOS" ? file("build/packr/output/Mindustry.json") : file("build/packr/output/${appName}.app/Contents/Resources/Mindustry.json")
|
||||
|
||||
if(platform != "MacOS"){
|
||||
copy{
|
||||
into "build/packr/output/jre/"
|
||||
from "build/packr/output/desktop.jar"
|
||||
}
|
||||
|
||||
delete{
|
||||
delete "build/packr/output/desktop.jar"
|
||||
}
|
||||
|
||||
outputJsonFile.text = outputJsonFile.text.replace("desktop.jar", "jre/desktop.jar")
|
||||
}else{
|
||||
copy{
|
||||
into "build/packr/output/${appName}.app/Contents/"
|
||||
from "build/packr/output/Contents/"
|
||||
}
|
||||
|
||||
delete{
|
||||
delete "build/packr/output/Contents/"
|
||||
}
|
||||
}
|
||||
|
||||
//packr is broken and won't let me add one hyphen, so I have to do that myself later
|
||||
outputJsonFile.text = outputJsonFile.text.replace("-enable-native-access=ALL-UNNAMED", "--enable-native-access=ALL-UNNAMED")
|
||||
|
||||
if((platform == "Windows64")){
|
||||
copy{
|
||||
from "build/packr/output/jre/bin/msvcr100.dll"
|
||||
into "build/packr/output/"
|
||||
@@ -197,8 +182,8 @@ platforms.each{ platform ->
|
||||
copy{
|
||||
def lib = platform == "MacOS" || platform == "Linux64" ? "lib" : ""
|
||||
from zipTree(platform == "MacOS" ? "build/packr/output/${appName}.app/Contents/Resources/desktop.jar" : "build/packr/output/jre/desktop.jar").matching{
|
||||
include "${lib}steamworks4j${platform == "Windows64" ? '64.dll' : platform == "Windows32" ? '.dll' : platform == "Linux64" ? '.so' : '.dylib'}"
|
||||
include "${lib}steam_api${platform == "Windows64" ? '64.dll' : platform == "Windows32" ? '.dll' : platform == "Linux64" ? '.so' : '.dylib'}"
|
||||
include "${lib}steamworks4j${platform == "Windows64" ? '64.dll' : platform == "Linux64" ? '.so' : '.dylib'}"
|
||||
include "${lib}steam_api${platform == "Windows64" ? '64.dll' : platform == "Linux64" ? '.so' : '.dylib'}"
|
||||
}
|
||||
into platform != "MacOS" ? "build/packr/output/" : "build/packr/output/${appName}.app/Contents/Resources"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user