Difficult-Rocket/nuitka-mac.ps1
2023-02-07 15:30:08 +08:00

54 lines
1.5 KiB
PowerShell

$start_time = Get-Uptime
Write-Output $start_time
python3.9 .github/workflows/get_info.py -env
if (-Not (Test-Path -Path "./.github/workflows/env.ps1"))
{
Throw "No env file found as ./github/workflows/env.ps1 !"
}
./.github/workflows/env.ps1
cd libs
cd Difficult_Rocket_rs
cd src
python3.9 setup.py build
python3.9 after_build.py
cd ../../..
$arg = @()
# 输出配置
$arg += @("--standalone")
$arg += @("--output-dir=build/nuitka-mac")
$arg += @("--company-name=tool-shenjack-workshop")
$arg += @("--product-name=Difficult-Rocket")
$arg += @("--product-version=$env:DR_version")
$arg += @("--file-version=$env:Build_version")
$arg += @("--file-description=Difficult-Rocket!")
$arg += @("--macos-app-icon=textures/icon.png")
# 编译器配置
$arg += @("--clang")
$arg += @("--lto=no")
# 数据配置
$arg += @("--include-data-dir=./libs/pyglet=./pyglet")
$arg += @("--include-data-dir=./libs/fonts=./libs/fonts")
$arg += @("--include-data-dir=./textures=./textures")
$arg += @("--include-data-dir=./configs=./configs")
# 编译配置
$arg += @("--show-memory")
$arg += @("--show-progress")
#$arg += @("--assume-yes-for-download")
python3.9 -m nuitka $arg $args DR.py
$end_time = Get-Uptime
$out = $end_time.TotalMilliseconds - $start_time.TotalMilliseconds
Write-Output $end_time.TotalSeconds $start_time.TotalSeconds $out s
Write-Output $start_time $end_time
Write-Output "--clang --lto=no and ($args)"
Copy-Item .\libs\pyglet\ .\build\nuitka-mac\DR.dist -Recurse
# --include-data-dir=./libs/pyglet=./pyglet
# --run
# --disable-ccache