Improved build script, now with more options

This commit is contained in:
Ambroise Garel
2025-07-29 15:05:00 +02:00
parent 1488001442
commit c7cd1aa462
5 changed files with 57 additions and 18 deletions
+9 -6
View File
@@ -5,9 +5,7 @@ require_once("./BuildScript/Script.php");
require_once("./BuildScript/Warehouses.php");
if (!is_dir("./_DebugOutput"))
{
mkdir("./_DebugOutput");
}
function packMiz($theaterJson, $debugMode)
{
@@ -45,12 +43,20 @@ function packMiz($theaterJson, $debugMode)
return true;
}
$buildType = "debug";
if (count($argv) > 1) $buildType = strtolower($argv[1]);
$buildSingleTheater = null;
if (count($argv) > 2) $buildSingleTheater = strtolower($argv[2]);
$theaterFiles = scandir("./Theaters");
foreach ($theaterFiles as $theaterFile)
{
if (($theaterFile === ".") || ($theaterFile === "..")) continue;
if (!str_ends_with(strtolower($theaterFile), ".json")) continue;
if (($buildSingleTheater != null) && (strtolower($theaterFile) !== $buildSingleTheater.".json"))
continue;
$theaterJson = json_decode(file_get_contents("./Theaters/$theaterFile"), true);
if ($theaterJson == null)
{
@@ -59,10 +65,7 @@ foreach ($theaterFiles as $theaterFile)
}
echo "Building scenario \"".$theaterFile."\"...\n";
for ($i = 0; $i <= 1; $i++)
{
packMiz($theaterJson, $i == 1);
}
packMiz($theaterJson, $buildType !== "release");
echo "\n";
}