forked from jumpinjackie/mapguide-maestro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
116 lines (97 loc) · 2.63 KB
/
build.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
110
111
112
113
114
115
116
@echo off
SET TYPEACTION=build
SET TYPEBUILD=Release
SET PLATFORM=Any CPU
SET RELEASE_VERSION=6.0m8
SET OLDPATH=%PATH%
SET PATH=%PATH%;%CD%\Maestro\packages\NSIS.2.51\tools
SET SLNDIR=%CD%
:study_params
if (%1)==() goto start_build
if "%1"=="-help" goto help_show
if "%1"=="-h" goto help_show
if "%1"=="-c" goto get_conf
if "%1"=="-config" goto get_conf
if "%1"=="-a" goto get_action
if "%1"=="-action" goto get_action
if "%1"=="-p" goto get_platform
if "%1"=="-platform" goto get_platform
if "%1"=="-version" goto get_version
if "%1"=="-v" goto get_verbose
if "%1"=="-verbose" goto get_verbose
goto custom_error
:next_param
shift
shift
goto study_params
:get_verbose
SET VERBOSITY=/v:n
goto next_param
:get_version
SET RELEASE_VERSION=%2
goto next_param
:get_conf
SET TYPEBUILD=%2
SET OUTDIR=%CD%\out\%PLATFORM%\%TYPEBUILD%
if "%2"=="release" goto next_param
if "%2"=="Release" goto next_param
if "%2"=="debug" goto next_param
if "%2"=="Debug" goto next_param
goto custom_error
:get_action
SET TYPEACTION=%2
if "%2"=="build" goto next_param
if "%2"=="clean" goto next_param
goto custom_error
:get_platform
SET PLATFORM=%2
SET OUTDIR=%CD%\out\%PLATFORM%\%TYPEBUILD%
if "%2"=="x86" goto next_param
if "%2"=="x64" goto next_param
goto custom_error
:start_build
SET MSBUILD=msbuild.exe /p:Configuration=%TYPEBUILD%
SET MAKENSIS=makensis.exe /DSLN_CONFIG=%TYPEBUILD% /DCPU=x86 /DRELEASE_VERSION=%RELEASE_VERSION%
if "%TYPEACTION%"=="build" goto build
if "%TYPEACTION%"=="clean" goto clean
:build
pushd Maestro
%MSBUILD% Maestro_All.sln
popd
pushd UserDoc
call make.bat html
popd
pushd UserDoc\build\html
xcopy /S /Y *.* %SLNDIR%\out\%TYPEBUILD%\UserDoc\
popd
pushd Install
%MAKENSIS% Maestro.nsi
popd
goto quit
:clean
pushd Maestro
%MSBUILD% /t:clean Maestro_All.sln
popd
rd /S /Q out
goto quit
:custom_error
echo The command is not recognized.
echo Please use the format:
:help_show
echo ************************************************************************
echo build.bat [-h]
echo [-t]
echo [-v]
echo [-p=CPU]
echo [-c=BuildType]
echo [-a=Action]
echo Help: -h[elp]
echo Test: -t[est]
echo Verbose: -v
echo CPU: -p[latform]=x86(default),x64
echo BuildType: -c[onfig]=Release(default), Debug
echo Action: -a[ction]=build(default),
echo clean
echo ************************************************************************
:quit
SET PATH=%OLDPATH%