-
Notifications
You must be signed in to change notification settings - Fork 12
/
build.bat
55 lines (44 loc) · 1.54 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
@echo Off
set config=%1
if "%config%" == "" (
set config=Release
)
set version=
if not "%PackageVersion%" == "" (
set version=-Version %PackageVersion%
)
set nuget=
if "%nuget%" == "" (
set nuget=.nuget\NuGet.exe
)
set nunit="packages\NUnit.Runners.2.6.2\tools\nunit-console.exe"
echo Update self %nuget%
%nuget% update -self
if %errorlevel% neq 0 goto failure
echo Restore packages
%nuget% install ".nuget\packages.config" -OutputDirectory packages -NonInteractive
if %errorlevel% neq 0 goto failure
echo Build
%WINDIR%\Microsoft.NET\Framework\v4.0.30319\msbuild NRaft.sln /t:Rebuild /p:Configuration="%config%" /m /v:M /fl /flp:LogFile=msbuild.log;Verbosity=Normal /nr:false
if %errorlevel% neq 0 goto failure
echo Unit tests
%nunit% NRaft.Core.Tests\bin\NRaft.Core.Tests.dll /framework:net-4.5
if %errorlevel% neq 0 goto failure
%nunit% NRaft.Server.Tests\bin\NRaft.Server.Tests.dll /framework:net-4.5
if %errorlevel% neq 0 goto failure
%nunit% NRaft.Client.Tests\bin\NRaft.Client.Tests.dll /framework:net-4.5
if %errorlevel% neq 0 goto failure
echo Package
mkdir Build
cmd /c %nuget% pack "NRaft.Core\NRaft.Core.csproj" -symbols -o Build -p Configuration=%config% %version%
if %errorlevel% neq 0 goto failure
cmd /c %nuget% pack "NRaft.Server\NRaft.Server.csproj" -symbols -o Build -p Configuration=%config% %version%
if %errorlevel% neq 0 goto failure
cmd /c %nuget% pack "NRaft.Client\NRaft.Client.csproj" -symbols -o Build -p Configuration=%config% %version%
if %errorlevel% neq 0 goto failure
:success
echo Success
goto end
:failure
echo Failed
:end