forked from fbertram/TuringTrader
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSINGLE_CLICK_BUILD.bat
95 lines (76 loc) · 2.97 KB
/
SINGLE_CLICK_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
@echo off
rem * TODO: there should be a better way to find the path to MSVC
PATH=%PATH%;"C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE"
echo *
echo *
echo ***************************************************************************
echo *** clean project
echo ***************************************************************************
rem * we'd like to clean a bit more aggressively than 'dotnet clean'
rd /s /q TuringTrader\bin
rd /s /q TuringTrader\obj
rd /s /q TuringTrader.Simulator\bin
rd /s /q TuringTrader.Simulator\obj
rd /s /q BooksAndPubs\bin
rd /s /q BooksAndPubs\obj
rd /s /q TuringTrader.Setup\bin
rd /s /q TuringTrader.Setup\obj
echo *
echo *
echo ***************************************************************************
echo *** version info
echo ***************************************************************************
rem example: git tag = 0.13
rem git describe = 0.13-14-g87a9f97
rem TT_GIT = 0.13-14-g87a9f97
rem TT_VER = 0.13.14-g87a9f97
for /f "tokens=*" %%g in ('git describe') do (set TT_GIT=%%g)
set TT_VER=%TT_GIT:-g=#g%
set TT_VER=%TT_VER:-=.%
set TT_VER=%TT_VER:#g=-g%
set _TT_VER=%TT_VER%-gdummy
set _SUFFIX=%_TT_VER:*-=%
call set TT_V0=%%_TT_VER:%_SUFFIX%=%%
set TT_V0=%TT_V0:-=%
echo *** GIT INFO: %TT_GIT%
echo *** VERSION: %TT_VER%
echo *** VERSION-0: %TT_V0%
pushd TuringTrader
echo public static class GitInfo { public static string Version = "%TT_GIT%"; } > GitVersion.cs
popd
echo *
echo *
echo ***************************************************************************
echo *** build project
echo ***************************************************************************
dotnet build TuringTrader/TuringTrader.csproj -c "Release" /p:Platform=x64 /p:Version=%TT_VER%
dotnet build BooksAndPubs/BooksAndPubs.csproj -c "Release" /p:Platform=x64 /p:Version=%TT_VER%
echo *
echo *
echo ***************************************************************************
echo *** publish project
echo ***************************************************************************
dotnet publish TuringTrader\TuringTrader.csproj -c "Release" /p:Platform=x64 /p:PublishProfile=FolderProfile /p:Version=%TT_VER%
echo *
echo *
echo ***************************************************************************
echo *** build setup file
echo ***************************************************************************
rem * uses TT_V0 environment variable
rem * 'dotnet build' cannot build WiX project
devenv TuringTrader.sln /Build "Release|x64" /Project TuringTrader.Setup
echo *
echo *
echo ***************************************************************************
echo *** build documentation
echo ***************************************************************************
pushd DocFX
docfx
popd
echo *
echo *
echo ***************************************************************************
echo *** end of build
echo ***************************************************************************
start TuringTrader.Setup\bin\Release
pause