This repository has been archived by the owner on Mar 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild-release.ps1
executable file
·37 lines (32 loc) · 1.71 KB
/
build-release.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
$result="../result"
foreach( $a in ($Env:ARCH_INSTALLS -split ' ') )
{
switch( $a )
{
'win32' { $arch="win32"; $dist="bin_win32"; $python="c:/python32/python.exe" }
'win64' { $arch="win64"; $dist="bin_win64"; $python="c:/python64/python.exe" }
default { Write-Error "Unsupported architecture $a"; exit 0 }
}
Write-Host "........................"
Write-Host "Building $arch release"
Write-Host "........................"
Remove-Item -Path $dist -Force -Recurse -ErrorAction SilentlyContinue
New-Item -ItemType directory -Path $dist | Out-Null
Remove-Item -Path $result/fb2mobi_all_$arch.zip -Force -ErrorAction SilentlyContinue
Copy-Item -Path ../kindlegen.exe -Destination ./kindlegen.exe -ErrorAction SilentlyContinue
&$python setup-all.win32.cx_freeze.py build_exe -b $dist
Write-Host "Cleaning after cx_freeze..."
$dirs="imageformats", "platforms", "styles"
foreach( $d in $dirs )
{
# Move-Item -Path $dist/$d/Qt5* -Destination $dist/lib -ErrorAction SilentlyContinue
Copy-Item -Path $dist/$d/Qt5* -Destination $dist/lib -ErrorAction SilentlyContinue
Remove-Item -Path $dist/$d/Qt5* -ErrorAction SilentlyContinue
Remove-Item -Path $dist/$d/VCRUNTIME140.dll -ErrorAction SilentlyContinue
Remove-Item -Path $dist/$d/MSVCP140.dll -ErrorAction SilentlyContinue
}
Move-Item -Path $dist/lib/VCRUNTIME140.dll -Destination $dist/VCRUNTIME140.dll -ErrorAction SilentlyContinue
Move-Item -Path $dist/lib/MSVCP140.dll $dist/MSVCP140.dll -ErrorAction SilentlyContinue
Write-Host "Compressiing result..."
Compress-Archive -Path (Get-ChildItem -Path $dist).FullName -DestinationPath $result/fb2mobi_all_$arch
}