forked from microsoft/Mobius
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.cmd
71 lines (49 loc) · 1.68 KB
/
Build.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@setlocal
@ECHO off
SET CMDHOME=%~dp0
@REM Remove trailing backslash \
set CMDHOME=%CMDHOME:~0,-1%
@REM Set some .NET directory locations required if running from PowerShell prompt.
if "%FrameworkDir%" == "" set FrameworkDir=%WINDIR%\Microsoft.NET\Framework
if "%FrameworkVersion%" == "" set FrameworkVersion=v4.0.30319
SET MSBUILDEXEDIR=%FrameworkDir%\%FrameworkVersion%
SET MSBUILDEXE=%MSBUILDEXEDIR%\MSBuild.exe
SET MSBUILDOPT=/verbosity:minimal
if "%builduri%" == "" set builduri=Build.cmd
cd "%CMDHOME%"
@cd
set PROJ_NAME=SparkCLR
set PROJ=%CMDHOME%\%PROJ_NAME%.sln
@echo ===== Building %PROJ% =====
@echo Restore NuGet packages ===================
SET STEP=NuGet-Restore
nuget restore "%PROJ%"
@if ERRORLEVEL 1 GOTO :ErrorStop
@echo Build Debug ==============================
SET STEP=Debug
SET CONFIGURATION=%STEP%
SET STEP=%CONFIGURATION%
"%MSBUILDEXE%" /p:Configuration=%CONFIGURATION% %MSBUILDOPT% "%PROJ%"
@if ERRORLEVEL 1 GOTO :ErrorStop
@echo BUILD ok for %CONFIGURATION% %PROJ%
@echo Build Release ============================
SET STEP=Release
SET CONFIGURATION=%STEP%
"%MSBUILDEXE%" /p:Configuration=%CONFIGURATION% %MSBUILDOPT% "%PROJ%"
@if ERRORLEVEL 1 GOTO :ErrorStop
@echo BUILD ok for %CONFIGURATION% %PROJ%
if EXIST %PROJ_NAME%.nuspec (
@echo ===== Build NuGet package for %PROJ% =====
SET STEP=NuGet-Pack
powershell -f %CMDHOME%\..\build\localmode\nugetpack.ps1
@if ERRORLEVEL 1 GOTO :ErrorStop
@echo NuGet package ok for %PROJ%
)
@echo ===== Build succeeded for %PROJ% =====
@GOTO :EOF
:ErrorStop
set RC=%ERRORLEVEL%
if "%STEP%" == "" set STEP=%CONFIGURATION%
@echo ===== Build FAILED for %PROJ% -- %STEP% with error %RC% - CANNOT CONTINUE =====
exit /B %RC%
:EOF