forked from aspnet/WebHooks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
47 lines (37 loc) · 1.46 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
@echo off
setlocal
pushd %~dp0
if exist bin goto build
mkdir bin
:Build
REM Find the most recent 32bit MSBuild.exe on the system. Require v12.0 (installed with VS2013) or later since .NET 4.0
REM is not supported. Always quote the %MSBuild% value when setting the variable and never quote %MSBuild% references.
set MSBuild="%ProgramFiles(x86)%\MSBuild\14.0\Bin\MSBuild.exe"
if not exist %MSBuild% @set MSBuild="%ProgramFiles(x86)%\MSBuild\12.0\Bin\MSBuild.exe"
if not exist %MSBuild% (
echo Could not find msbuild.exe. Please run this from a Visual Studio developer prompt
goto BuildFail
)
REM Start Azure Storage Emulator
set StorageEmulator="%ProgramFiles(x86)%\Microsoft SDKs\Azure\Storage Emulator\AzureStorageEmulator.exe"
if not exist %StorageEmulator% (
echo Could not find AzureStorageEmulator.exe. Please install Azure SDK from http://azure.microsoft.com/en-us/downloads/
goto BuildFail
)
%StorageEmulator% start 2> NUL
if "%1" == "" goto BuildDefaults
%MSBuild% WebHooks.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess
:BuildDefaults
%MSBuild% WebHooks.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess
:BuildFail
echo.
echo *** BUILD FAILED ***
exit /B 999
:BuildSuccess
echo.
echo **** BUILD SUCCESSFUL ***
exit /B 0