-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeploy.bat
More file actions
125 lines (103 loc) · 3.04 KB
/
Copy pathDeploy.bat
File metadata and controls
125 lines (103 loc) · 3.04 KB
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
:: Deploy script for SWAGView.
::
:: This script compiles release versions of the 64 and 32 bit builds of SWAGView
:: and places then into a single zip file ready for release.
::
:: This script uses MSBuild and InfoZip's zip.exe. The MSBuild project also
:: requires DelphiDabbler Version Information Editor.
::
:: Get zip.exe from https://delphidabbler.com/extras/info-zip
:: Get Version Information Editor from https://delphidabbler.com/software/vied
:: 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) Set the VIEDROOT environment variable to the directory where VIEd.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 SWAGView Release
echo --------------------------
:: Check for required parameter
if "%1"=="" goto paramerror
:: Check for required environment variables
if "%ZipRoot%"=="" goto envvarerror
if "%VIEdRoot"=="" goto envvarerror
:: Set variables
set Version=%1
set BuildRoot=.\_build
set Win32Dir=%BuildRoot%\Win32\Release\exe
set Win64Dir=%BuildRoot%\Win64\Release\exe
set ReleaseDir=%BuildRoot%\release
set OutFile32=%ReleaseDir%\swagview-exe32-%Version%.zip
set OutFile64=%ReleaseDir%\swagview-exe64-%Version%.zip
set SrcDir=src
set PrgBaseName=SWAGView
set ReadMe=%ReleaseDir%\README.txt
set LicenseFile=LICENSE.txt
set WebDocs=https://github.com/ddabapps/swagview/blob/main/README.md#installation
:: 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 %PrgBaseName%.dproj /p:config=Release /p:platform=Win32
echo.
echo.
echo Building 64 bit version
echo.
msbuild %PrgBaseName%.dproj /p:config=Release /p:platform=Win64
echo.
endlocal
:: Create read-me file
echo For installation information see %WebDocs% > %ReadMe%
:: Rename 32 bit exe file
setlocal
cd %Win32Dir%
ren %PrgBaseName%.exe %PrgBaseName%32.exe
endlocal
:: Create zip files
echo.
echo Creating zip files
%ZipRoot%\zip.exe -j -9 %OutFile32% %Win32Dir%\%PrgBaseName%32.exe
%ZipRoot%\zip.exe -j -9 %OutFile64% %Win64Dir%\%PrgBaseName%.exe
%ZipRoot%\zip.exe -j -9 %OutFile32% %ReadMe%
%ZipRoot%\zip.exe -j -9 %OutFile64% %ReadMe%
%ZipRoot%\zip.exe -j -9 %OutFile32% %LicenseFile%
%ZipRoot%\zip.exe -j -9 %OutFile64% %LicenseFile%
del %ReadMe%
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