-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.bat
43 lines (33 loc) · 1.29 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
@echo off
REM IF [%1]==[] GOTO MissingApiKey
reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath > nul 2>&1
if ERRORLEVEL 1 goto MissingMSBuildRegistry
for /f "skip=2 tokens=2,*" %%A in ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0" /v MSBuildToolsPath') do SET MSBUILDDIR=%%B
IF NOT EXIST %MSBUILDDIR%nul goto MissingMSBuildToolsPath
IF NOT EXIST %MSBUILDDIR%msbuild.exe goto MissingMSBuildExe
::BUILD
"tools\nuget.exe" restore AdalWrapper.sln
"%MSBUILDDIR%msbuild.exe" "src\AdalWrapper\AdalWrapper.csproj" /t:ReBuild /p:Configuration=Release;TargetFrameworkVersion=v4.5;DefineConstants="TRACE;NET45";OutPutPath=bin\Release\net45\
mkdir build
del "build\*.nupkg"
::SET API KEY
REM "tools\nuget.exe" setApiKey %1
::PACK
"tools\nuget.exe" pack "src\AdalWrapper\AdalWrapper.nuspec" -OutputDirectory build -Version 1.0.0.0
::DEPLOY
REM "tools\nuget.exe" push "build\*.nupkg"
goto:eof
::ERRORS
::---------------------
:MissingApiKey
echo API Key not found
goto:eof
:MissingMSBuildRegistry
echo Cannot obtain path to MSBuild tools from registry
goto:eof
:MissingMSBuildToolsPath
echo The MSBuild tools path from the registry '%MSBUILDDIR%' does not exist
goto:eof
:MissingMSBuildExe
echo The MSBuild executable could not be found at '%MSBUILDDIR%'
goto:eof