-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildWin32.bat
66 lines (49 loc) · 1.63 KB
/
buildWin32.bat
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
:
:: Build 32 bit Windows jpylyzer binaries from Python script, and pack them in ZIP file
::
:: ZIP file includes license file, PDF User Manual and example files
::
:: Johan van der Knijff, 25 april 2013
::
:: Dependencies:
::
:: - Python 2.7 (PyInstaller doesn't work with Python 3 yet!)
:: - PyInstaller 2: http://www.pyinstaller.org/
:: - PyWin32 (needed by PyInstaller): http://sourceforge.net/projects/pywin32/files/
:: - a spec file with
::
@echo off
setlocal
::::::::: CONFIGURATION ::::::::::
:: Python
set python=c:\python27_32bit\python
:: Path to PyInstaller
set pathPyInstaller=c:\pyinstall\
:: Script base name (i.e. script name minus .py extension)
set scriptBaseName=jpwrappa
:: PyInstaller spec file that defines build options
set specFile=jpwrappa_win32.spec
:: Directory where build is created (should be identical to 'name' in 'coll' in spec file!!)
set distDir=.\dist_win32\
:: Executes jpylyzer with -v option and stores output to
:: env variable 'version'
set vCommand=%python% .\%scriptBaseName%\%scriptBaseName%.py -v
%vCommand% 2> temp.txt
set /p version= < temp.txt
del temp.txt
::::::::: BUILD ::::::::::::::::::
:: Build binaries
%python% %pathPyInstaller%\pyinstaller.py %specFile%
:: Generate name for ZIP file
set zipName=%scriptBaseName%_%version%_win32.zip
:: Create ZIP file
%python% zipdir.py %distDir%\%scriptBaseName% %distDir%\%zipName%
::::::::: CLEANUP :::::::::::::::::
:: Delete build directory
rmdir build /S /Q
:: Delete jpylyzer directory in distdir
rmdir %distDir%\%scriptBaseName% /S /Q
::::::::: PARTY TIME! :::::::::::::::::
echo /
echo Done! Created %zipName% in directory %distDir%!
echo /