Skip to content

Commit 22413f2

Browse files
committed
Added build_all.bat script to build all packages for distribution in one
step. See Issue 157. Updated the BuildOnWindos wiki page.
1 parent 916d3ff commit 22413f2

File tree

3 files changed

+157
-6
lines changed

3 files changed

+157
-6
lines changed

cefpython/cef3/windows/cefpython.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
1 VERSIONINFO
2-
FILEVERSION 31,1,0,0
3-
PRODUCTVERSION 31,1,0,0
2+
FILEVERSION 31,2,0,0
3+
PRODUCTVERSION 31,2,0,0
44
FILEFLAGSMASK 0x3FL
55
FILEFLAGS 0x0L
66
FILEOS 0x4L
@@ -13,13 +13,13 @@ BEGIN
1313
BEGIN
1414
VALUE "CompanyName", "CEF Python"
1515
VALUE "FileDescription", "CEF Python DLL"
16-
VALUE "FileVersion", "31.1.0.0"
16+
VALUE "FileVersion", "31.2.0.0"
1717
VALUE "InternalName", "cefpython"
1818
VALUE "LegalCopyright", "(c) 2012-2014 The CEF Python authors"
1919
VALUE "LegalTrademarks", ""
2020
VALUE "OriginalFilename", "cefpython_py27.pyd"
2121
VALUE "ProductName", "CEF Python 3"
22-
VALUE "ProductVersion", "31.1.0.0"
22+
VALUE "ProductVersion", "31.2.0.0"
2323
VALUE "Comments", "Licensed under BSD 3-clause license"
2424
VALUE "Aditional Notes", ""
2525
END
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
/cefpython3-*/
2-
/output/
1+
cefpython3-*/
2+
Output/
3+
dist/
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
@echo off
2+
3+
if "%1"=="" goto usage
4+
if "%2"=="" goto usage
5+
6+
set platform=%1
7+
set version=%2
8+
9+
set success=0
10+
if "%platform%"=="win32" set success=1
11+
if "%platform%"=="win-amd64" set success=1
12+
if %success% neq 1 (
13+
echo [build_all.bat] ERROR: invalid platform. Allowed: win32, win-amd64.
14+
goto usage
15+
)
16+
17+
echo [build_all.bat] PLATFORM: %platform%
18+
echo [build_all.bat] VERSION: %version%
19+
20+
set DISABLE_INNO_SETUP=0
21+
22+
echo.%*|findstr /C:"--disable-inno-setup" >nul 2>&1
23+
if %errorlevel% equ 0 (
24+
set DISABLE_INNO_SETUP=1
25+
)
26+
27+
:: Clean directories from previous run
28+
rm -rf Output/
29+
rm -rf cefpython3-*-setup/
30+
rm -rf dist/
31+
32+
mkdir dist
33+
34+
echo [build_all.bat] Installing setuptools and wheel
35+
pip install setuptools wheel
36+
if %errorlevel% neq 0 (
37+
echo [build_all.bat] ERROR: pip install setuptools wheel
38+
exit /B 1
39+
)
40+
41+
if %DISABLE_INNO_SETUP% equ 0 (
42+
echo [build_all.bat] Creating Inno Setup intaller
43+
python make-installer.py -v %version%
44+
if %errorlevel% equ 0 (
45+
mv Output/*.exe dist/
46+
if %errorlevel% neq 0 (
47+
echo [build_all.bat] ERROR: moving inno setup installer failed
48+
exit /B 1
49+
)
50+
rmdir Output
51+
if %errorlevel% neq 0 (
52+
echo [build_all.bat] ERROR: deleting Output/ directory failed
53+
exit /B 1
54+
)
55+
) else if %errorlevel% neq 0 (
56+
echo [build_all.bat] ERROR: creating Inno Setup installer failed
57+
exit /B 1
58+
)
59+
)
60+
61+
echo [build_all.bat] Creating Distutils setup
62+
python make-setup.py -v %version%
63+
if %errorlevel% neq 0 (
64+
echo [build_all.bat] ERROR: creating Distutils setup
65+
exit /B 1
66+
)
67+
68+
:: Enter the setup directory
69+
cd cefpython3-*-setup/
70+
71+
echo [build_all.bat] Creating Distutils source package
72+
python setup.py sdist
73+
if %errorlevel% neq 0 (
74+
echo [build_all.bat] ERROR: creating Distutils source package
75+
exit /B 1
76+
)
77+
78+
echo [build_all.bat] Creating Python Egg
79+
python setup.py bdist_egg
80+
if %errorlevel% neq 0 (
81+
echo [build_all.bat] ERROR: creating Python Egg failed
82+
exit /B 1
83+
)
84+
85+
echo [build_all.bat] Creating Python Wheel
86+
python setup.py bdist_wheel
87+
if %errorlevel% neq 0 (
88+
echo [build_all.bat] ERROR: creating Python Wheel failed
89+
exit /B 1
90+
)
91+
92+
echo [build_all.bat] Creating MSI installer
93+
python setup.py bdist_msi
94+
if %errorlevel% neq 0 (
95+
echo [build_all.bat] ERROR: creating MSI installer failed
96+
exit /B 1
97+
)
98+
99+
echo [build_all.bat] Creating EXE installer
100+
python setup.py bdist_wininst
101+
if %errorlevel% neq 0 (
102+
echo [build_all.bat] ERROR: creating EXE installer failed
103+
exit /B 1
104+
)
105+
106+
echo [build_all.bat] Moving all packages to the dist/ directory
107+
mv dist/* ../dist/
108+
if %errorlevel% neq 0 (
109+
echo [build_all.bat] ERROR: moving packages failed
110+
exit /B 1
111+
)
112+
113+
:: Up to the installer/ directory
114+
cd ../
115+
116+
echo [build_all.bat] Deleting the Distutils setup directory
117+
rm -rf cefpython3-*-setup/
118+
if %errorlevel% neq 0 (
119+
echo [build_all.bat] ERROR: failed deleting the Distutils setup directory
120+
exit /B 1
121+
)
122+
123+
cd dist/
124+
125+
echo [build_all.bat] Renaming some of the packages to include platform tag
126+
setlocal ENABLEDELAYEDEXPANSION
127+
for /R %%i in (*) do (
128+
set oldfile=%%i
129+
set newfile=!oldfile:.egg=-%platform%.egg!
130+
if "!oldfile!" neq "!newfile!" (
131+
mv !oldfile! !newfile!
132+
)
133+
set oldfile=%%i
134+
set newfile=!oldfile:.zip=-%platform%.zip!
135+
if "!oldfile!" neq "!newfile!" (
136+
mv !oldfile! !newfile!
137+
)
138+
)
139+
endlocal
140+
141+
echo [build_all.bat] Packages in the dist/ directory:
142+
dir
143+
144+
echo OK
145+
146+
goto :eof
147+
:usage
148+
@echo [build_all.bat] ERROR: platform or version arguments missing or invalid
149+
@echo [build_all.bat] ERROR: example usage: build_all.bat win32 31.2
150+
exit /B 1

0 commit comments

Comments
 (0)