-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.bat
48 lines (41 loc) · 1.04 KB
/
pack.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
@echo off
call :clean
echo.
echo pack projects
dotnet build aqua.tool.Validation -c Release
echo.
::echo pack nuspec files
::if "%1" neq "" (
:: for %%I in (%*) do call :pack "%%I"
::) else (
:: for /r "%~dp0" %%d in (*.nuspec) do call :pack "%%d"
::)
::echo.
echo done.
pause
goto :eof
:pack
call :prepare
echo pack %~1
"%~dp0.tools\NuGet.exe" pack "%~1" -OutputDirectory "%~dp0artifacts" >>"%~dp0pack.log"
set resultcode=%errorlevel%
if %resultcode% neq 0 (
echo.
pause
)
exit /b %resultcode%
:prepare
if not exist "%~dp0.tools\nuget.exe" (
echo download nuget cmd tool
md "%~dp0.tools\temp\"
powershell -Command "Invoke-WebRequest -Uri 'https://www.nuget.org/api/v2/package/NuGet.CommandLine/' -OutFile '%~dp0.tools\temp\NuGet.CommandLine.nupkg.zip'"
powershell -Command "Expand-Archive -Path '%~dp0.tools\temp\NuGet.CommandLine.nupkg.zip' -DestinationPath '%~dp0.tools\temp\'"
move "%~dp0.tools\temp\tools\NuGet.exe" "%~dp0.tools\"
rd /s /q "%~dp0.tools\temp\"
)
echo.
exit /b 0
:clean
echo.
echo clean
del /q "%~dp0pack.log" 2>nul