fix(packaging): split gui and cli collection
This commit is contained in:
1 parent
89fb278988
commit
8e7be541d3
2 files changed
+27
-13
No files matched your search
@@ -51,9 +51,15 @@ $CommonArgs = @(
|
||||
"--hidden-import", "PIL._tkinter_finder",
|
||||
"--hidden-import", "ttkbootstrap",
|
||||
"--hidden-import", "logging.handlers",
|
||||
"--hidden-import", "cryptography.hazmat.primitives.serialization",
|
||||
"--hidden-import", "cryptography.hazmat.primitives.serialization"
|
||||
)
|
||||
|
||||
$GuiArgs = @(
|
||||
"--collect-submodules", "gui"
|
||||
)
|
||||
|
||||
$CliArgs = @(
|
||||
"--collect-submodules", "douyin",
|
||||
"--collect-submodules", "gui",
|
||||
"--collect-submodules", "operations"
|
||||
)
|
||||
|
||||
@@ -76,23 +82,20 @@ foreach ($name in $ExcludedOptionalModules) {
|
||||
if ($Obfuscate -and (Test-Path $HiddenImportsFile)) {
|
||||
$HiddenImports = Get-Content -LiteralPath $HiddenImportsFile -Raw | ConvertFrom-Json
|
||||
$CliOnlyHiddenImportRoots = @("cv2", "numpy", "paddleocr", "paddle")
|
||||
$RunCliArgs = @()
|
||||
foreach ($name in $HiddenImports) {
|
||||
$nameText = [string]$name
|
||||
$rootName = ($nameText -split "\.")[0]
|
||||
if ($CliOnlyHiddenImportRoots -contains $rootName) {
|
||||
$RunCliArgs += @("--hidden-import", $nameText)
|
||||
$CliArgs += @("--hidden-import", $nameText)
|
||||
} else {
|
||||
$CommonArgs += @("--hidden-import", $nameText)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$RunCliArgs = @()
|
||||
}
|
||||
|
||||
python -m PyInstaller @CommonArgs --name DouyinGuajiGUI --windowed (Join-Path $BuildSourceRoot "gui\gui_app_entry.py")
|
||||
python -m PyInstaller @CommonArgs --name web_gui --console (Join-Path $BuildSourceRoot "gui\web_gui_entry.py")
|
||||
python -m PyInstaller @CommonArgs @RunCliArgs --name run_cli --console (Join-Path $BuildSourceRoot "bin\run_cli_entry.py")
|
||||
python -m PyInstaller @CommonArgs @GuiArgs --name DouyinGuajiGUI --windowed (Join-Path $BuildSourceRoot "gui\gui_app_entry.py")
|
||||
python -m PyInstaller @CommonArgs @GuiArgs --name web_gui --console (Join-Path $BuildSourceRoot "gui\web_gui_entry.py")
|
||||
python -m PyInstaller @CommonArgs @CliArgs --name run_cli --console (Join-Path $BuildSourceRoot "bin\run_cli_entry.py")
|
||||
|
||||
foreach ($name in @("DouyinGuajiGUI", "web_gui", "run_cli")) {
|
||||
$srcDir = Join-Path $DistRoot $name
|
||||
|
||||
Reference in new issue
Block a user