4
set ROOT=${buildout:directory}
6
set RELEASE=%ROOT%\release\bzr.${settings:bzr-release}
7
set DEV=%ROOT%\dev\bzr.dev
12
set SVN_DEV=${buildout:directory}/${svn-dev:destination}
13
set SVN_BDB=${buildout:directory}/${svn-db4:destination}
14
set SVN_LIBINTL=${buildout:directory}/${svn-libintl:destination}
15
set TBZR=${buildout:directory}/tbzr/trunk
16
set INSTALLERS=%ROOT%\installers
17
set PYTHON=${buildout:executable}
19
set ORIGINAL_PYTHONPATH=%PYTHONPATH%
20
set ORIGINAL_DIRECTORY=%CD%
24
set TORTOISE_OVERLAYS_MSI_WIN32_CMD=%PYTHON% %ROOT%/ostools.py basename ${settings:tortoise-overlays-win32-url}
25
FOR /f "tokens=1 delims= " %%G IN ('%TORTOISE_OVERLAYS_MSI_WIN32_CMD%') DO set BASENAME=%%G
26
set TORTOISE_OVERLAYS_MSI_WIN32=${buildout:directory}/tortoise-overlays/%BASENAME%
28
set TORTOISE_OVERLAYS_MSI_X64_CMD=%PYTHON% %ROOT%/ostools.py basename ${settings:tortoise-overlays-x64-url}
29
FOR /f "tokens=1 delims= " %%G IN ('%TORTOISE_OVERLAYS_MSI_X64_CMD%') DO set BASENAME=%%G
30
set TORTOISE_OVERLAYS_MSI_X64=${buildout:directory}/tortoise-overlays/%BASENAME%
32
FOR /f "tokens=1 delims= " %%G IN ('cygpath %PYTHON%') DO set CYG_PYTHON=%%G
35
if "%1"=="release" (set TARGET=%RELEASE%) & (set BZR_TARGET=release) & shift & goto ARGS
36
if "%1"=="dev" (set TARGET=%DEV%) & (set BZR_TARGET=trunk) & shift & goto ARGS
37
if "%1"=="plugin-release" (set PLUGIN_TARGET=release) & shift & goto ARGS
38
if "%1"=="plugin-dev" (set PLUGIN_TARGET=trunk) & shift & goto ARGS
40
if not defined TARGET (set TARGET=%RELEASE%) & (set BZR_TARGET=release)
41
if not defined PLUGIN_TARGET (set PLUGIN_TARGET=release)
43
%PYTHON% %ROOT%/ostools.py remove %TARGET%
44
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
46
%PYTHON% %ROOT%/ostools.py makedir %TARGET%
47
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
49
%PYTHON% %ROOT%/ostools.py makedir %INSTALLERS%
50
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
52
rem Use %COMSPEC% /c in case bzr is actually a .bat file
53
%COMSPEC% /c bzr co %ROOT%/bzr/%BZR_TARGET% %TARGET%
54
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
56
rem Build the python installers first, because we don't want to
57
rem include any of the 3rd-party plugins, because we don't bundle
58
rem their dependencies.
61
rem This is slightly redundant with 'make installer-all'
62
rem except in that case we have to do cygwin path translations for all the
63
rem different versions of python
64
${settings:python24} setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
65
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
67
${settings:python25} setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
68
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
70
${settings:python26} setup.py bdist_wininst --install-script="bzr-win32-bdist-postinstall.py" -d .
71
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
73
cd %ROOT%/subvertpy/%PLUGIN_TARGET%
74
%PYTHON% setup.py install -O1 --install-lib=%TARGET%
75
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
77
cd %ROOT%/bzrtools/%PLUGIN_TARGET%
78
%PYTHON% setup.py install -O1 --install-lib=%TARGET%
79
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
81
cd %ROOT%/qbzr/%PLUGIN_TARGET%
82
%PYTHON% setup.py install -O1 --install-lib=%TARGET%
83
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
85
cd %ROOT%/bzr-svn/%PLUGIN_TARGET%
86
%PYTHON% setup.py install -O1 --install-lib=%TARGET%
87
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
89
cd %ROOT%/bzr-rewrite/%PLUGIN_TARGET%
90
%PYTHON% setup.py install -O1 --install-lib=%TARGET%
91
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
93
set PYTHONPATH=%PYTHONPATH%;%TARGET%
95
%PYTHON% setup.py build
96
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
99
make installer PYTHON=%CYG_PYTHON%
100
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
102
%PYTHON% %ROOT%/ostools.py copytodir %TARGET%/bzr*.exe %INSTALLERS%
103
@if %ERRORLEVEL% NEQ 0 (set BUILD_ERROR=%ERRORLEVEL%) & goto End
106
set PYTHONPATH=%ORIGINAL_PYTHONPATH%
107
cd %ORIGINAL_DIRECTORY%
108
exit /b %BUILD_ERROR%