forked from pchalamet/cassandra-sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenerateVersion.cmd
53 lines (45 loc) · 1.07 KB
/
GenerateVersion.cmd
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
@echo off
setlocal
set HERE=%~dp0
pushd %HERE%
set FLAVOR=%1
if "%FLAVOR%" == "/?" goto :usage
if "%FLAVOR%" == "" (
echo WARNING: missing flavor as parameter ^(see %~n0 /?^)
echo WARNING: using FLAVOR=Debug instead
echo.
set FLAVOR=Debug
)
set VERSION=%2
if "%VERSION%" == "" (
echo WARNING: missing version as parameter ^(see %~n0 /?^)
echo WARNING: using VERSION=0.0.0 instead
echo.
set VERSION=0.0.0
)
set VERSIONSTATUS=%3
if "%VERSIONSTATUS%" == "" (
echo WARNING: missing version status as parameter ^(see %~n0 /?^)
echo WARNING: using VERSIONSTATUS=alpha instead
echo.
set VERSIONSTATUS=alpha
)
if "%VERSIONSTATUS%" == "rtm" (
set VERSIONSTATUS=
) else (
set VERSIONSTATUS=-%VERSIONSTATUS%
)
msbuild /t:GenerateVersion /p:Version=%VERSION% /p:Configuration=%FLAVOR% /p:VersionStatus=%VERSIONSTATUS% cassandra-sharp.targets || goto :done
:done
popd
endlocal
goto :eof
:usage
echo usage:
echo %~n0 ^<flavor^> ^<version^> ^<status^>
echo.
echo where:
echo flavor : Debug or Release
echo version : format is AAA.BBB.CCC
echo status : alpha, beta, rtm
goto :done