Files
iOSAI/build.bat
2025-10-23 18:57:37 +08:00

29 lines
1.1 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
setlocal
cd /d E:\code\Python\iOSAi
REM ---- 1) 打包 ----
python -m nuitka Module\Main.py ^
--standalone ^
--msvc=latest ^
--windows-console-mode=disable ^
--output-filename=IOSAI ^
--include-package=Module,Utils,Entity,script ^
--include-module=flask,wda,psutil,portalocker,flask_cors,cv2,lxml.etree,requests,urllib3,certifi,idna,setuptools ^
--include-data-dir=resources=resources ^
--include-data-dir=SupportFiles=SupportFiles ^
--include-data-files="resources/iproxy/*=resources/iproxy/" ^
--include-data-files=resources/icon.ico=resources/icon.ico ^
--jobs=20 ^
--windows-icon-from-ico=resources/icon.ico
IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL%
REM 2) 复制 sidecar venv 到 Main.dist 根目录(与 IOSAI.exe 同级)
rmdir /S /Q ".\Main.dist\python-rt" 2>nul
xcopy /E /I /Y ".\Needed\mini-python" ".\Main.dist\python-rt\"
rem ---- build done above ----
rem 强制删除根目录里会污染 sys.path 的同名包(目前只遇到 simplejson
rmdir /s /q ".\Main.dist\simplejson" 2>nul
del /f /q ".\Main.dist\simplejson.*" 2>nul