add linux / osx build scripts

This commit is contained in:
2026-01-15 15:37:13 -05:00
parent 16e4f6b789
commit 443149fe8d
10 changed files with 325 additions and 34 deletions

141
.vscode/tasks.json vendored
View File

@@ -4,14 +4,32 @@
{ {
"label": "Build (Minfiyed)", "label": "Build (Minfiyed)",
"type": "shell", "type": "shell",
"command": "powershell",
"args": [ "windows": {
"-NoProfile", "command": "powershell",
"-ExecutionPolicy", "args": [
"Bypass", "-NoProfile",
"-File", "-ExecutionPolicy",
"${workspaceFolder}\\tools\\buildMini.ps1" "Bypass",
], "-File",
"${workspaceFolder}\\scripts\\buildMini.ps1"
]
},
"linux": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/buildMini.sh"
]
},
"osx": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/buildMini.sh"
]
},
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
@@ -22,17 +40,36 @@
}, },
"problemMatcher": [] "problemMatcher": []
}, },
{ {
"label": "Build (Source)", "label": "Build (Source)",
"type": "shell", "type": "shell",
"command": "powershell",
"args": [ "windows": {
"-NoProfile", "command": "powershell",
"-ExecutionPolicy", "args": [
"Bypass", "-NoProfile",
"-File", "-ExecutionPolicy",
"${workspaceFolder}\\tools\\build.ps1" "Bypass",
], "-File",
"${workspaceFolder}\\scripts\\build.ps1"
]
},
"linux": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/build.sh"
]
},
"osx": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/build.sh"
]
},
"group": { "group": {
"kind": "build", "kind": "build",
"isDefault": true "isDefault": true
@@ -43,17 +80,36 @@
}, },
"problemMatcher": [] "problemMatcher": []
}, },
{
{
"label": "Test (Minfiyed)", "label": "Test (Minfiyed)",
"type": "shell", "type": "shell",
"command": "powershell",
"args": [ "windows": {
"-NoProfile", "command": "powershell",
"-ExecutionPolicy", "args": [
"Bypass", "-NoProfile",
"-File", "-ExecutionPolicy",
"${workspaceFolder}\\tools\\buildMiniTest.ps1" "Bypass",
], "-File",
"${workspaceFolder}\\scripts\\buildMiniTest.ps1"
]
},
"linux": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/buildMiniTest.sh"
]
},
"osx": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/buildMiniTest.sh"
]
},
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true
@@ -64,17 +120,36 @@
}, },
"problemMatcher": [] "problemMatcher": []
}, },
{ {
"label": "Test (Source)", "label": "Test (Source)",
"type": "shell", "type": "shell",
"command": "powershell",
"args": [ "windows": {
"-NoProfile", "command": "powershell",
"-ExecutionPolicy", "args": [
"Bypass", "-NoProfile",
"-File", "-ExecutionPolicy",
"${workspaceFolder}\\tools\\buildTest.ps1" "Bypass",
], "-File",
"${workspaceFolder}\\scripts\\buildTest.ps1"
]
},
"linux": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/buildTest.sh"
]
},
"osx": {
"command": "bash",
"args": [
"${workspaceFolder}/scripts/buildTest.sh"
]
},
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true

View File

@@ -1,3 +1,3 @@
# HyperionOS # HyperionOS
A OS made for lua enviroments. WIP

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."

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."

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"

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."