-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpack.bat
More file actions
42 lines (33 loc) · 887 Bytes
/
pack.bat
File metadata and controls
42 lines (33 loc) · 887 Bytes
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
@echo off
setlocal
pushd "%~dp0"
set "CONFIGURATION=Release"
set "ARTIFACTS_DIR=%CD%\artifacts"
set "PACKAGES_DIR=%ARTIFACTS_DIR%\packages"
if exist "%PACKAGES_DIR%" rmdir /s /q "%PACKAGES_DIR%"
mkdir "%PACKAGES_DIR%"
echo [1/3] Restoring solution...
dotnet restore CodeWF.NetWeaver.slnx
if errorlevel 1 goto :error
echo [2/3] Building solution...
dotnet build CodeWF.NetWeaver.slnx -c %CONFIGURATION% --no-restore
if errorlevel 1 goto :error
echo [3/3] Packing libraries...
for %%P in (
"src\CodeWF.NetWeaver\CodeWF.NetWeaver.csproj"
"src\CodeWF.NetWrapper\CodeWF.NetWrapper.csproj"
) do (
dotnet pack %%~P -c %CONFIGURATION% -o "%PACKAGES_DIR%"
if errorlevel 1 goto :error
)
echo.
echo Packages are available in:
echo %PACKAGES_DIR%
popd
exit /b 0
:error
set "EXIT_CODE=%ERRORLEVEL%"
echo.
echo Pack failed with exit code %EXIT_CODE%.
popd
exit /b %EXIT_CODE%