Fixed tests / Removed win32 packr builds

This commit is contained in:
Anuken
2026-03-17 23:37:58 -04:00
parent e7ba494bfc
commit 2fe23966f9
2 changed files with 60 additions and 75 deletions
Binary file not shown.
+4 -19
View File
@@ -3,10 +3,9 @@ sourceSets.main.java.srcDirs = ["src/"]
project.ext.mainClassName = "mindustry.desktop.DesktopLauncher" project.ext.mainClassName = "mindustry.desktop.DesktopLauncher"
project.ext.assetsDir = new File("../core/assets") project.ext.assetsDir = new File("../core/assets")
def enableTemplates = true
def JDK_DIR = "$System.env.JDK_DIR" def JDK_DIR = "$System.env.JDK_DIR"
def ICON_DIR = new File("$rootDir/core/assets/icons/icon.icns") 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){ tasks.register('run', JavaExec){
dependsOn classes dependsOn classes
@@ -112,19 +111,6 @@ platforms.each{ platform ->
delete "build/packr/output/" 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()}"
}
copy{
into "build/packr/output/jre"
rename("${appName}.jar", "desktop.jar")
from "build/libs/${appName}.jar"
}
}else{
def jarPath = JDK_DIR + "packr.jar" def jarPath = JDK_DIR + "packr.jar"
def args = new String[]{"java", "-jar", jarPath} def args = new String[]{"java", "-jar", jarPath}
@@ -183,9 +169,8 @@ platforms.each{ platform ->
//packr is broken and won't let me add one hyphen, so I have to do that myself later //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") outputJsonFile.text = outputJsonFile.text.replace("-enable-native-access=ALL-UNNAMED", "--enable-native-access=ALL-UNNAMED")
}
if((platform == "Windows64" || platform == "Windows32")){ if((platform == "Windows64")){
copy{ copy{
from "build/packr/output/jre/bin/msvcr100.dll" from "build/packr/output/jre/bin/msvcr100.dll"
into "build/packr/output/" into "build/packr/output/"
@@ -197,8 +182,8 @@ platforms.each{ platform ->
copy{ copy{
def lib = platform == "MacOS" || platform == "Linux64" ? "lib" : "" 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{ 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}steamworks4j${platform == "Windows64" ? '64.dll' : platform == "Linux64" ? '.so' : '.dylib'}"
include "${lib}steam_api${platform == "Windows64" ? '64.dll' : platform == "Windows32" ? '.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" into platform != "MacOS" ? "build/packr/output/" : "build/packr/output/${appName}.app/Contents/Resources"
} }