1
1
@ echo off
2
- SET ROOT = %~dp0 ..
2
+ rem This file builds everything and is run on the build server as part of
3
+ rem building, testing and packing nugets for all master commits and pull requests.
4
+
5
+ rem Publishing nugets is handled by nuget-publish.bat and run by the build server
6
+ rem on the master branch.
7
+
8
+ rem Optional strong name signing .pfx key file to produce signed binaries and nugets.
9
+ set StrongNameSignFile = " %1 "
10
+
11
+ set ROOT = %~dp0 ..
12
+
13
+ if exist %StrongNameSignFile% (
14
+ echo Using strong name signing key file: %StrongNameSignFile%
15
+ ) else (
16
+ echo No strong name signing key file specified. Will only build unsigned binaries and nugets.
17
+ )
3
18
4
19
if exist %ROOT% \Artifacts rmdir /Q /S %ROOT% \Artifacts
5
20
21
+ rem Regenerate all source code and test stubs before building
22
+ rem since there is no guarantee that merged pull requests
23
+ rem have properly regenerated code.
24
+ call %ROOT% \GenerateUnits.bat
25
+ if %errorlevel% neq 0 exit /b %errorlevel%
26
+
27
+ rem Update AsseemblyInfo.cs versions from .nuspec files
6
28
call powershell -NoProfile %ROOT% \Build\UpdateAssemblyInfo.ps1
7
29
if %errorlevel% neq 0 exit /b %errorlevel%
8
30
31
+ rem Restore nugets
9
32
call %ROOT% \Build\nuget-restore.bat
10
33
if %errorlevel% neq 0 exit /b %errorlevel%
11
34
35
+ rem Build source and tests
12
36
call %ROOT% \Build\build-all-release.bat
13
37
if %errorlevel% neq 0 exit /b %errorlevel%
14
38
39
+ rem Run all tests
15
40
call %ROOT% \Build\run-tests.bat
16
41
if %errorlevel% neq 0 exit /b %errorlevel%
17
42
43
+ rem Only build signed binaries if tests pass
44
+ call %ROOT% \Build\build-signed-release.bat %StrongNameSignFile%
45
+ if %errorlevel% neq 0 exit /b %errorlevel%
46
+
47
+ rem Pack nugets for both signed and unsigned binaries
18
48
call %ROOT% \Build\pack-nuget.bat
19
49
if %errorlevel% neq 0 exit /b %errorlevel%
20
50
51
+ rem Create a zip bundle of everything, becomes available in TeamCity for download
21
52
call %ROOT% \Build\zip-artifacts.bat
22
53
if %errorlevel% neq 0 exit /b %errorlevel%
0 commit comments