Skip to content
This repository has been archived by the owner on Jul 31, 2018. It is now read-only.

Commit

Permalink
Merge pull request #38 from moden-py/PR
Browse files Browse the repository at this point in the history
Debug build
  • Loading branch information
moden-py committed Sep 15, 2015
2 parents f1ad53f + 8260dce commit b37a426
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 18 deletions.
3 changes: 1 addition & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,4 @@ build_script:

artifacts:
# Archive the generated coverage report in the ci.appveyor.com build report.
- path: swapy32bit.exe
- path: swapy64bit.exe
- path: swapy*.exe
38 changes: 24 additions & 14 deletions ci/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,38 @@
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/


function BuildExe ($python_version, $architecture, $python_home) {
function BuildExe ($python_version, $architecture, $python_home, $build_type) {
Write-Host "Building with PyInstaller" $python_version "for" $architecture "bit architecture to" $python_home
$pyinstaller_path = $python_home + "\Scripts\pyinstaller.exe"
$args = "--clean swapy.spec"

Write-Host "Run PyInstaller" $pyinstaller_path $args
Start-Process -FilePath $pyinstaller_path -ArgumentList $args -Wait -Passthru

if ($architecture -eq "32") {
$out_filename = "swapy32bit.exe"
if ($build_type -eq "release") {
$args = "--clean swapy.spec"
$input_filename = "swapy.exe"
if ($architecture -eq "32") {
$out_filename = "swapy32bit.exe"
} else {
$out_filename = "swapy64bit.exe"
}
} else {
$out_filename = "swapy64bit.exe"
$args = "--clean swapy-debug.spec"
$input_filename = "swapy-debug.exe"
if ($architecture -eq "32") {
$out_filename = "swapy32bit-debug.exe"
} else {
$out_filename = "swapy64bit-debug.exe"
}
}

Write-Host "Copy out file" .\dist\swapy.exe .\$out_filename
Copy-Item .\dist\swapy.exe .\$out_filename

Write-Host "Start building" $pyinstaller_path $args
Start-Process -FilePath $pyinstaller_path -ArgumentList $args -Wait -Passthru

Write-Host "Copy out file" .\dist\$input_filename .\$out_filename
Copy-Item .\dist\$input_filename .\$out_filename

}


function main () {
BuildExe $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON
BuildExe $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON "release"
BuildExe $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON "debug"
}

main
17 changes: 17 additions & 0 deletions swapy-debug.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- mode: python -*-
a = Analysis(['swapy-ob.py'],
pathex=['swapy-git'])
a.datas += [('swapy_dog_head.ico','swapy_dog_head.ico','DATA'),]
pyz = PYZ(a.pure)
exe = EXE(pyz,
a.datas,
a.scripts,
a.binaries,
a.zipfiles,
exclude_binaries=False,
name=os.path.join('dist', 'swapy-debug.exe'),
debug=True,
strip=False,
upx=False,
console=True,
icon='swapy_dog.ico')
5 changes: 3 additions & 2 deletions swapy.spec
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ exe = EXE(pyz,
name=os.path.join('dist', 'swapy.exe'),
debug=False,
strip=False,
upx=False,
console=False , icon='swapy_dog.ico')
upx=True,
console=False,
icon='swapy_dog.ico')

0 comments on commit b37a426

Please sign in to comment.