-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDeploy.bat
109 lines (89 loc) · 2.3 KB
/
Deploy.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
:: Deploy script for DUSE
::
:: This script compiles release versions of the 64 and 32 bit versions of DUSE
:: and places then into zip files ready for release.
::
:: This script uses MSBuild and Zip.exe
:: To use the script:
:: 1) Start the Embarcadero RAD Studio Command Prompt to set the
:: required environment variables for MSBuild.
:: 2) Set the ZIPROOT environment variable to the directory where zip.exe is
:: installed.
:: 3) Change directory to that where this script is located.
:: 4) Run the script
::
:: Usage:
:: Deploy <version>
:: where
:: <version> is the version number of the release, e.g. 0.5.3-beta or 1.2.0
@echo off
echo ----------------------
echo Deploying DUSE Release
echo ----------------------
:: Check for required parameter
if "%1"=="" goto paramerror
:: Check for required environment variables
if "%ZipRoot%"=="" goto envvarerror
:: Set variables
set Version=%1
set BuildRoot=.\_build
set BuildExeRoot=%BuildRoot%\exe
set Win32Dir=%BuildExeRoot%\Win32\Release
set Win64Dir=%BuildExeRoot%\Win64\Release
set ReleaseDir=%BuildRoot%\release
set OutFile32=%ReleaseDir%\duse-32bit-%Version%.zip
set OutFile64=%ReleaseDir%\duse-64bit-%Version%.zip
set DocsDir=docs
set SrcDir=src
:: Make a clean directory structure
if exist %BuildRoot% rmdir /S /Q %BuildRoot%
mkdir %BuildExeRoot%
mkdir %BuildExeRoot%\Win32
mkdir %Win32Dir%
mkdir %BuildExeRoot%\Win64
mkdir %Win64Dir%
mkdir %ReleaseDir%
setlocal
:: Build Pascal
cd %SrcDir%
echo.
echo Building 32 bit version
echo.
msbuild DUSE.dproj /p:config=Release /p:platform=Win32
echo.
echo.
echo Building 64 bit version
echo.
msbuild DUSE.dproj /p:config=Release /p:platform=Win64
echo.
endlocal
:: Rename 32 bit exe file
setlocal
cd %Win32Dir%
ren DUSE.exe DUSE32.exe
endlocal
:: Create zip files
echo.
echo Creating zip files
%ZipRoot%\zip.exe -j -9 %OutFile32% %Win32Dir%\DUSE32.exe
%ZipRoot%\zip.exe -j -9 %OutFile64% %Win64Dir%\DUSE.exe
%ZipRoot%\zip.exe -j -9 %OutFile32% %DocsDir%\README.txt
%ZipRoot%\zip.exe -j -9 %OutFile64% %DocsDir%\README.txt
echo.
echo ---------------
echo Build completed
echo ---------------
goto end
:: Error messages
:paramerror
echo.
echo ***ERROR: Please specify a version number as a parameter
echo.
goto end
:envvarerror
echo.
echo ***ERROR: ZipRoot environment variable not set
echo.
goto end
:: End
:end