This commit is contained in:
SpartanSoftware
2026-02-20 21:25:55 -06:00
commit 2a6a11a701
180 changed files with 18499 additions and 0 deletions

44
scripts/build.ps1 Normal file
View File

@@ -0,0 +1,44 @@
$testRoot = Join-Path $PSScriptRoot "..\src"
$buildRoot = Join-Path $PSScriptRoot "..\Build"
$testRoot = Resolve-Path $testRoot
# Clean Build folder
if (Test-Path $buildRoot) {
Remove-Item -LiteralPath $buildRoot -Recurse -Force -ErrorAction SilentlyContinue
}
New-Item -ItemType Directory -Path $buildRoot | Out-Null
Write-Host "Building from $testRoot"
Write-Host "Output to $buildRoot"
Write-Host ""
# Each top-level folder in test/
Get-ChildItem -Path $testRoot -Directory | ForEach-Object {
$folderRoot = $_.FullName
Write-Host "== Package: $($_.Name) =="
# Walk files inside this folder
Get-ChildItem -Path $folderRoot -File -Recurse | ForEach-Object {
$src = $_.FullName
$rel = $src.Substring($folderRoot.Length).TrimStart("\")
$dst = Join-Path $buildRoot $rel
$dstDir = Split-Path $dst
if (-not (Test-Path $dstDir)) {
New-Item -ItemType Directory -Path $dstDir -Force | Out-Null
}
Write-Host "Processing: $rel"
Write-Host " > Copying"
Copy-Item -LiteralPath $src -Destination $dst -Force
}
Write-Host ""
}
Write-Host "Build complete."

42
scripts/build.sh Normal file
View File

@@ -0,0 +1,42 @@
#!/usr/bin/env bash
set -e
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEST_ROOT="$(realpath "$SCRIPT_ROOT/../src")"
BUILD_ROOT="$SCRIPT_ROOT/../Build"
if [[ -d "$BUILD_ROOT" ]]; then
rm -rf "$BUILD_ROOT"
fi
mkdir -p "$BUILD_ROOT"
echo "Building from $TEST_ROOT"
echo "Output to $BUILD_ROOT"
echo ""
for folder in "$TEST_ROOT"/*/; do
[[ -d "$folder" ]] || continue
folder_root="$folder"
package_name="$(basename "$folder_root")"
echo "== Package: $package_name =="
find "$folder_root" -type f | while IFS= read -r src; do
rel="${src#$folder_root}"
dst="$BUILD_ROOT/$rel"
dst_dir="$(dirname "$dst")"
if [[ ! -d "$dst_dir" ]]; then
mkdir -p "$dst_dir"
fi
echo "Processing: $rel"
echo " > Copying"
cp -f "$src" "$dst"
done
echo ""
done
echo "Build complete."

57
scripts/buildMini.ps1 Normal file
View File

@@ -0,0 +1,57 @@
$testRoot = Join-Path $PSScriptRoot "..\src"
$buildRoot = Join-Path $PSScriptRoot "..\Build"
$testRoot = Resolve-Path $testRoot
# Clean Build folder
if (Test-Path $buildRoot) {
Remove-Item -LiteralPath $buildRoot -Recurse -Force -ErrorAction SilentlyContinue
}
New-Item -ItemType Directory -Path $buildRoot | Out-Null
Write-Host "Building from $testRoot"
Write-Host "Output to $buildRoot"
Write-Host ""
# Each top-level folder in test/
Get-ChildItem -Path $testRoot -Directory | ForEach-Object {
$folderRoot = $_.FullName
Write-Host "== Package: $($_.Name) =="
# Walk files inside this folder
Get-ChildItem -Path $folderRoot -File -Recurse | ForEach-Object {
$src = $_.FullName
$rel = $src.Substring($folderRoot.Length).TrimStart("\")
$dst = Join-Path $buildRoot $rel
$dstDir = Split-Path $dst
if (-not (Test-Path $dstDir)) {
New-Item -ItemType Directory -Path $dstDir -Force | Out-Null
}
Write-Host "Processing: $rel"
# Read first 3 lines
$header = Get-Content $src -TotalCount 3 -ErrorAction SilentlyContinue
if ($header -match "--:Minify:--") {
Write-Host " > Minifying"
$content = luamin -f "$src"
# UTF8 encoding without BOM because it breaks lua
$utf8NoBOM = New-Object System.Text.UTF8Encoding($false)
[System.IO.File]::WriteAllText($dst, $content, $utf8NoBOM)
}
else {
Write-Host " > Copying"
Copy-Item -LiteralPath $src -Destination $dst -Force
}
}
Write-Host ""
}
Write-Host "Build complete."

50
scripts/buildMini.sh Normal file
View File

@@ -0,0 +1,50 @@
#!/usr/bin/env bash
set -e
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEST_ROOT="$(realpath "$SCRIPT_ROOT/../src")"
BUILD_ROOT="$SCRIPT_ROOT/../Build"
if [[ -d "$BUILD_ROOT" ]]; then
rm -rf "$BUILD_ROOT"
fi
mkdir -p "$BUILD_ROOT"
echo "Building from $TEST_ROOT"
echo "Output to $BUILD_ROOT"
echo ""
for folder in "$TEST_ROOT"/*/; do
[[ -d "$folder" ]] || continue
folder_root="$folder"
package_name="$(basename "$folder_root")"
echo "== Package: $package_name =="
find "$folder_root" -type f | while IFS= read -r src; do
rel="${src#$folder_root}"
dst="$BUILD_ROOT/$rel"
dst_dir="$(dirname "$dst")"
if [[ ! -d "$dst_dir" ]]; then
mkdir -p "$dst_dir"
fi
echo "Processing: $rel"
header="$(head -n 3 "$src" 2>/dev/null || true)"
if echo "$header" | grep -q -- "--:Minify:--"; then
echo " > Minifying"
luamin -f "$src" > "$dst"
else
echo " > Copying"
cp -f "$src" "$dst"
fi
done
echo ""
done
echo "Build complete."

108
scripts/buildMiniTest.ps1 Normal file
View File

@@ -0,0 +1,108 @@
$testRoot = Join-Path $PSScriptRoot "..\src"
$buildRoot = Join-Path $PSScriptRoot "..\Build"
$testRoot = Resolve-Path $testRoot
# Clean Build folder
if (Test-Path $buildRoot) {
Remove-Item -LiteralPath $buildRoot -Recurse -Force -ErrorAction SilentlyContinue
}
New-Item -ItemType Directory -Path $buildRoot | Out-Null
Write-Host "Building from $testRoot"
Write-Host "Output to $buildRoot"
Write-Host ""
# Each top-level folder in test/
Get-ChildItem -Path $testRoot -Directory | ForEach-Object {
$folderRoot = $_.FullName
Write-Host "== Package: $($_.Name) =="
# Walk files inside this folder
Get-ChildItem -Path $folderRoot -File -Recurse | ForEach-Object {
$src = $_.FullName
$rel = $src.Substring($folderRoot.Length).TrimStart("\")
$dst = Join-Path $buildRoot $rel
$dstDir = Split-Path $dst
if (-not (Test-Path $dstDir)) {
New-Item -ItemType Directory -Path $dstDir -Force | Out-Null
}
Write-Host "Processing: $rel"
# Read first 3 lines
$header = Get-Content $src -TotalCount 3 -ErrorAction SilentlyContinue
if ($header -match "--:Minify:--") {
Write-Host " > Minifying"
$content = luamin -f "$src"
# UTF8 encoding without BOM because it breaks lua
$utf8NoBOM = New-Object System.Text.UTF8Encoding($false)
[System.IO.File]::WriteAllText($dst, $content, $utf8NoBOM)
}
else {
Write-Host " > Copying"
Copy-Item -LiteralPath $src -Destination $dst -Force
}
}
Write-Host ""
}
Write-Host "Build complete."
$testRoot = Join-Path $PSScriptRoot "..\test"
$buildRoot = Join-Path $PSScriptRoot "..\Build"
$testRoot = Resolve-Path $testRoot
Write-Host "Building from $testRoot"
Write-Host "Output to $buildRoot"
Write-Host ""
# Each top-level folder in test/
Get-ChildItem -Path $testRoot -Directory | ForEach-Object {
$folderRoot = $_.FullName
Write-Host "== Package: $($_.Name) =="
# Walk files inside this folder
Get-ChildItem -Path $folderRoot -File -Recurse | ForEach-Object {
$src = $_.FullName
$rel = $src.Substring($folderRoot.Length).TrimStart("\")
$dst = Join-Path $buildRoot $rel
$dstDir = Split-Path $dst
if (-not (Test-Path $dstDir)) {
New-Item -ItemType Directory -Path $dstDir -Force | Out-Null
}
Write-Host "Processing: $rel"
# Read first 3 lines
$header = Get-Content $src -TotalCount 3 -ErrorAction SilentlyContinue
if ($header -match "--:Minify:--") {
Write-Host " > Minifying"
$content = luamin -f "$src"
# UTF8 encoding without BOM because it breaks lua
$utf8NoBOM = New-Object System.Text.UTF8Encoding($false)
[System.IO.File]::WriteAllText($dst, $content, $utf8NoBOM)
}
else {
Write-Host " > Copying"
Copy-Item -LiteralPath $src -Destination $dst -Force
}
}
Write-Host ""
}
Write-Host "Build complete."

55
scripts/buildMiniTest.sh Normal file
View File

@@ -0,0 +1,55 @@
#!/usr/bin/env bash
set -e
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
build_from_root() {
local TEST_ROOT
TEST_ROOT="$(realpath "$1")"
local BUILD_ROOT="$SCRIPT_ROOT/../Build"
if [[ -d "$BUILD_ROOT" ]]; then
rm -rf "$BUILD_ROOT"
fi
mkdir -p "$BUILD_ROOT"
echo "Building from $TEST_ROOT"
echo "Output to $BUILD_ROOT"
echo ""
for folder in "$TEST_ROOT"/*/; do
[[ -d "$folder" ]] || continue
local package_name
package_name="$(basename "$folder")"
echo "== Package: $package_name =="
find "$folder" -type f | while IFS= read -r src; do
rel="${src#$folder}"
dst="$BUILD_ROOT/$rel"
dst_dir="$(dirname "$dst")"
mkdir -p "$dst_dir"
echo "Processing: $rel"
header="$(head -n 3 "$src" 2>/dev/null || true)"
if echo "$header" | grep -q -- "--:Minify:--"; then
echo " > Minifying"
luamin -f "$src" > "$dst"
else
echo " > Copying"
cp -f "$src" "$dst"
fi
done
echo ""
done
echo "Build complete."
}
build_from_root "$SCRIPT_ROOT/../src"
build_from_root "$SCRIPT_ROOT/../test"

83
scripts/buildTest.ps1 Normal file
View File

@@ -0,0 +1,83 @@
$testRoot = Join-Path $PSScriptRoot "..\src"
$buildRoot = Join-Path $PSScriptRoot "..\Build"
$testRoot = Resolve-Path $testRoot
# Clean Build folder
if (Test-Path $buildRoot) {
Remove-Item -LiteralPath $buildRoot -Recurse -Force -ErrorAction SilentlyContinue
}
New-Item -ItemType Directory -Path $buildRoot | Out-Null
Write-Host "Building from $testRoot"
Write-Host "Output to $buildRoot"
Write-Host ""
# Each top-level folder in test/
Get-ChildItem -Path $testRoot -Directory | ForEach-Object {
$folderRoot = $_.FullName
Write-Host "== Package: $($_.Name) =="
# Walk files inside this folder
Get-ChildItem -Path $folderRoot -File -Recurse | ForEach-Object {
$src = $_.FullName
$rel = $src.Substring($folderRoot.Length).TrimStart("\")
$dst = Join-Path $buildRoot $rel
$dstDir = Split-Path $dst
if (-not (Test-Path $dstDir)) {
New-Item -ItemType Directory -Path $dstDir -Force | Out-Null
}
Write-Host "Processing: $rel"
Write-Host " > Copying"
Copy-Item -LiteralPath $src -Destination $dst -Force
}
Write-Host ""
}
Write-Host "Build complete."
$testRoot = Join-Path $PSScriptRoot "..\test"
$buildRoot = Join-Path $PSScriptRoot "..\Build"
$testRoot = Resolve-Path $testRoot
Write-Host "Building from $testRoot"
Write-Host "Output to $buildRoot"
Write-Host ""
# Each top-level folder in test/
Get-ChildItem -Path $testRoot -Directory | ForEach-Object {
$folderRoot = $_.FullName
Write-Host "== Package: $($_.Name) =="
# Walk files inside this folder
Get-ChildItem -Path $folderRoot -File -Recurse | ForEach-Object {
$src = $_.FullName
$rel = $src.Substring($folderRoot.Length).TrimStart("\")
$dst = Join-Path $buildRoot $rel
$dstDir = Split-Path $dst
if (-not (Test-Path $dstDir)) {
New-Item -ItemType Directory -Path $dstDir -Force | Out-Null
}
Write-Host "Processing: $rel"
Write-Host " > Copying"
Copy-Item -LiteralPath $src -Destination $dst -Force
}
Write-Host ""
}
Write-Host "Build complete."

69
scripts/buildTest.sh Normal file
View File

@@ -0,0 +1,69 @@
#!/usr/bin/env bash
set -e
SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TEST_ROOT="$(realpath "$SCRIPT_ROOT/../src")"
BUILD_ROOT="$(realpath "$SCRIPT_ROOT/../Build" 2>/dev/null || echo "$SCRIPT_ROOT/../Build")"
if [[ -d "$BUILD_ROOT" ]]; then
rm -rf "$BUILD_ROOT"
fi
mkdir -p "$BUILD_ROOT"
echo "Building from $TEST_ROOT"
echo "Output to $BUILD_ROOT"
echo ""
for folder in "$TEST_ROOT"/*/; do
[[ -d "$folder" ]] || continue
package_name="$(basename "$folder")"
echo "== Package: $package_name =="
find "$folder" -type f | while read -r src; do
rel="${src#$folder}"
dst="$BUILD_ROOT/$rel"
dst_dir="$(dirname "$dst")"
mkdir -p "$dst_dir"
echo "Processing: $rel"
echo " > Copying"
cp -f "$src" "$dst"
done
echo ""
done
echo "Build complete."
TEST_ROOT="$(realpath "$SCRIPT_ROOT/../test")"
BUILD_ROOT="$(realpath "$SCRIPT_ROOT/../Build" 2>/dev/null || echo "$SCRIPT_ROOT/../Build")"
echo "Building from $TEST_ROOT"
echo "Output to $BUILD_ROOT"
echo ""
for folder in "$TEST_ROOT"/*/; do
[[ -d "$folder" ]] || continue
package_name="$(basename "$folder")"
echo "== Package: $package_name =="
find "$folder" -type f | while read -r src; do
rel="${src#$folder}"
dst="$BUILD_ROOT/$rel"
dst_dir="$(dirname "$dst")"
mkdir -p "$dst_dir"
echo "Processing: $rel"
echo " > Copying"
cp -f "$src" "$dst"
done
echo ""
done
echo "Build complete."