Add Build.ps1 to replicate Makefile functionality on Windows

This commit is contained in:
Campbell 2024-11-15 18:31:47 -05:00 committed by GitHub
parent 2733b70e18
commit 71450b5204
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

32
Build.ps1 Normal file
View File

@ -0,0 +1,32 @@
# Build.ps1 for WiiPy
# Default option is to run build, like a Makefile
param(
[string]$Task = "build"
)
$buildWiiPy = {
Write-Host "Building WiiPy..."
python -m nuitka --show-progress --assume-yes-for-downloads --onefile wiipy.py --onefile-tempdir-spec="{CACHE_DIR}/NinjaCheetah/WiiPy"
}
$cleanWiiPy = {
Write-Host "Cleaning..."
Remove-Item -Recurse -Force wiipy.exe, ./wiipy.build/, ./wiipy.dist/, ./wiipy.onefile-build/
}
switch ($Task.ToLower()) {
"build" {
& $buildWiiPy
break
}
"clean" {
& $cleanWiiPy
break
}
default {
Write-Host "Unknown task: $Task" -ForegroundColor Red
Write-Host "Available tasks: build, clean"
break
}
}