Merge branch 'main' into translations-system

This commit is contained in:
NeeEoo
2024-04-10 16:14:55 +02:00
59 changed files with 345 additions and 162 deletions
+2 -2
View File
@@ -2,10 +2,10 @@ package commands;
class Compiler {
public static function test(args:Array<String>) {
__build(args, ["test", getBuildTarget(), "-D", "TEST_BUILD"]);
__build(args, ["test", getBuildTarget(), "-DTEST_BUILD"]);
}
public static function build(args:Array<String>) {
__build(args, ["build", getBuildTarget(), "-D", "TEST_BUILD"]);
__build(args, ["build", getBuildTarget(), "-DTEST_BUILD"]);
}
public static function release(args:Array<String>) {
__build(args, ["build", getBuildTarget()]);
+31
View File
@@ -0,0 +1,31 @@
package commands;
import sys.io.File;
class Optimizer {
public static function main(args:Array<String>) {
var args = ArgParser.parse(args);
var saveOld = args.existsOption("no-old");
if(args.length == 0) {
Sys.println(Main.curCommand.dDoc);
return;
}
var filename = args.get(0);
var data = File.getContent(filename);
var json = null;
try {
json = haxe.Json.parse(data);
} catch(e:Dynamic) {
Sys.println("Error parsing JSON file.");
Sys.println(e);
return;
}
if(saveOld)
File.saveContent(filename + ".old", data);
File.saveContent(filename, haxe.Json.stringify(json));
}
}
+17 -4
View File
@@ -10,10 +10,20 @@ class Update {
public static function main(args:Array<String>) {
prettyPrint("Preparing installation...");
var args = ArgParser.parse(args, ["S" => "silent-progress", "silent" => "silent-progress"]);
var CHECK_VSTUDIO = !args.existsOption("no-vscheck");
var REINSTALL_ALL = args.existsOption("all");
var SILENT = args.existsOption("silent-progress");
// to prevent messing with currently installed libs
if (!FileSystem.exists('.haxelib'))
FileSystem.createDirectory('.haxelib');
if (REINSTALL_ALL) {
FileSystem.deleteDirectory('.haxelib');
FileSystem.createDirectory('.haxelib');
}
var libs:Array<Library> = [];
var libsXML:Access = new Access(Xml.parse(File.getContent('./libs.xml')).firstElement());
@@ -33,18 +43,21 @@ class Update {
libs.push(lib);
}
var commandSuffix = " --always";
if (SILENT) commandSuffix += " --silent";
for(lib in libs) {
var globalism:Null<String> = lib.global == "true" ? "--global" : null;
var globalSuffix = globalism != null ? ' $globalism' : '';
switch(lib.type) {
case "lib":
prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}"...');
Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}${globalism != null ? ' $globalism' : ''} --always');
Sys.command('haxelib install ${lib.name} ${lib.version != null ? " " + lib.version : " "}$globalSuffix$commandSuffix');
case "git":
prettyPrint((lib.global == "true" ? "Globally installing" : "Locally installing") + ' "${lib.name}" from git url "${lib.url}"');
Sys.command('haxelib git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}${globalism != null ? ' $globalism' : ''} --always');
Sys.command('haxelib git ${lib.name} ${lib.url}${lib.ref != null ? ' ${lib.ref}' : ''}$globalSuffix$commandSuffix');
case "custom":
Sys.command('haxelib dev ${lib.name} "./libraries/${lib.name}"');
default:
prettyPrint('Cannot resolve library of type "${lib.type}"');
}
@@ -76,7 +89,7 @@ class Update {
}
// vswhere.exe its used to find any visual studio related installations on the system, including full visual studio ide installations, visual studio build tools installations, and other related components - Nex
if (Compiler.getBuildTarget().toLowerCase() == "windows" && new Process('"C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" -property catalog_productDisplayVersion').exitCode(true) == 1) {
if (CHECK_VSTUDIO && Compiler.getBuildTarget().toLowerCase() == "windows" && new Process('"C:/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe" -property catalog_productDisplayVersion').exitCode(true) == 1) {
prettyPrint("Installing Microsoft Visual Studio Community (Dependency)");
// thanks to @crowplexus for these two lines! - Nex