Difficult-Rocket/nuitka-win.ps1

55 lines
1.6 KiB
PowerShell
Raw Normal View History

2022-12-20 16:32:21 +08:00
$start_time = Get-Uptime
Write-Output $start_time
2023-01-02 19:22:22 +08:00
2023-01-06 21:29:13 +08:00
python .\.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
2023-01-24 10:14:17 +08:00
cd libs
cd Difficult_Rocket_rs
cd src
python3.8 setup.py build
python after_build.py
cd ../../..
2023-01-02 19:22:22 +08:00
$arg = @()
# 输出配置
$arg += @("--standalone")
2023-01-24 09:59:38 +08:00
$arg += @("--output-dir=build/nuitka-win")
2023-01-02 19:22:22 +08:00
$arg += @("--company-name=tool-shenjack-workshop")
$arg += @("--product-name=Difficult-Rocket")
2023-01-18 00:26:18 +08:00
$arg += @("--product-version=$env:DR_version")
$arg += @("--file-version=$env:Build_version")
2023-01-02 19:22:22 +08:00
$arg += @("--file-description=Difficult-Rocket!")
2023-01-03 15:34:06 +08:00
$arg += @("--windows-icon-from-ico=textures/icon.png")
2023-02-12 18:45:29 +08:00
#$arg += @("--macos-app-icon=textures/icon.png")
2023-01-02 19:22:22 +08:00
# 编译器配置
2023-02-07 15:30:08 +08:00
$arg += @("--msvc=latest")
2023-01-02 19:22:22 +08:00
$arg += @("--clang")
$arg += @("--lto=no")
# 数据配置
2023-01-31 22:07:18 +08:00
$arg += @("--include-data-dir=./libs/pyglet=./libs/pyglet")
2023-01-02 19:22:22 +08:00
$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.8.exe -m nuitka $arg $args DR.py
2022-12-20 16:32:21 +08:00
$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
2023-01-26 23:15:32 +08:00
Write-Output "--clang --lto=no and $args"
2023-02-07 15:30:08 +08:00
Copy-Item .\libs\pyglet\ .\build\nuitka-win\DR.dist -Recurse
2022-12-20 16:32:21 +08:00
# --include-data-dir=./libs/pyglet=./pyglet
# --run
# --disable-ccache