forked from dadhi/DryIoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.bat
63 lines (50 loc) · 1.61 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
@echo off
setlocal EnableDelayedExpansion
set SLN=DryIoc.sln
rem: Optional
rem dotnet clean --verbosity:minimal
echo:
echo:## Starting: DOTNET RESTORE... ##
echo:
dotnet restore /p:DevMode=false %SLN%
if %ERRORLEVEL% neq 0 goto :error
echo:
echo:## Finished: DOTNET RESTORE ##
echo:
rem Looking for MSBuild.exe path
set MSB="C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\bin\MSBuild.exe"
if not exist %MSB% set MSB="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\MSBuild.exe"
if not exist %MSB% for /f "tokens=4 delims='" %%p IN ('.nuget\nuget.exe restore ^| find "MSBuild auto-detection"') do set MSB="%%p\MSBuild.exe"
echo:
echo:## Using MSBuild: %MSB%
echo:
echo:## Starting: BUILD and PACKAGING... ##
echo:
rem: Turning Off the $(DevMode) from the Directory.Build.props to alway build an ALL TARGETS
call %MSB% %SLN% /t:Rebuild /p:DevMode=false;Configuration=Release /nowarn:VSX1000 /m /v:m /bl /fl /flp:LogFile=MSBuild.log
if %ERRORLEVEL% neq 0 goto :error
echo:
echo:## Finished: BUILD and PACKAGING ##
echo:
echo:## Starting: TestRunner... ##
echo:
dotnet run --no-build -c Release --project test/DryIoc.TestRunner/DryIoc.TestRunner.csproj
if %ERRORLEVEL% neq 0 goto :error
echo:## Finished: TestRunner ##
echo:
echo:## Running: TESTS... ##
echo:
dotnet test --no-build -c Release -p:DevMode=false
if %ERRORLEVEL% neq 0 goto :error
echo:## Finished: TESTS ##
call build\NugetPack.bat
if %ERRORLEVEL% neq 0 goto :error
echo:
echo:## Finished: PACKAGING ##
echo:
echo:## Finished: ALL Successful ##
exit /b 0
:error
echo:
echo:## Build is failed :-(
exit /b 1