增加测试构建命令

This commit is contained in:
星外之神 2022-06-18 12:30:54 +08:00
parent aa5caa2549
commit 9e82f15981

View File

@ -95,14 +95,14 @@ python main.py
- 对于`opus`编码,需要添加`libogg-0.dll``libopus-0.dll``libopusfile-0.dll` - 对于`opus`编码,需要添加`libogg-0.dll``libopus-0.dll``libopusfile-0.dll`
- 以添加`opus``vorbis`编码的背景音乐支持为例,编译需执行以下命令: - 以添加`opus``vorbis`编码的背景音乐支持为例,编译需执行以下命令:
``` powershell ``` cmd
git clone https://github.com/wszqkzqk/pypvz.git git clone https://github.com/wszqkzqk/pypvz.git
cd pypvz cd pypvz
nuitka --mingw64 --standalone ` nuitka --mingw64 --standalone `
--onefile ` --onefile `
--show-progress ` --show-progress `
--show-memory ` --show-memory `
--output-dir=D:\17265\Documents\GitHub\pypvz\release ` --output-dir=release `
--windows-icon-from-ico=pypvz.ico ` --windows-icon-from-ico=pypvz.ico `
--include-data-dir=resources=resources ` --include-data-dir=resources=resources `
--include-data-file=C:\Users\17265\AppData\Local\Programs\Python\Python310\Lib\site-packages\pygame\libogg-0.dll=libogg-0.dll ` --include-data-file=C:\Users\17265\AppData\Local\Programs\Python\Python310\Lib\site-packages\pygame\libogg-0.dll=libogg-0.dll `
@ -124,7 +124,23 @@ nuitka --mingw64 --standalone `
* `--windows-product-version=`表示版本号信息,所跟内容格式必须为`x.x.x.x` * `--windows-product-version=`表示版本号信息,所跟内容格式必须为`x.x.x.x`
* 建议开启`--lto=yes`选项优化链接,如果编译失败可以关闭此选项 * 建议开启`--lto=yes`选项优化链接,如果编译失败可以关闭此选项
可执行文件生成路径为`./out/main.exe` 可执行文件生成路径为`./release/main.exe`
如果只需要在本地生成编译文件测试,则只需要执行:
``` cmd
nuitka --mingw64 `
--follow-imports `
--show-progress `
--output-dir=test-build `
--windows-icon-from-ico=pypvz.ico `
--windows-product-name=pypvz `
--windows-company-name=null `
--windows-file-description=pypvz `
--windows-disable-console `
--windows-product-version=0.7.33.0 `
main.py
```
### 使用pyinstaller进行构建 ### 使用pyinstaller进行构建