-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
94 lines (67 loc) · 1.41 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
@echo off
setlocal
if not exist version.cmd goto nover
call version.cmd
set _CONFIGURATION=Release
for %%I in (
Scullery.Core
Scullery.EntityFrameworkCore
) do (
set _ASSEMBLY=%%I
call :package
)
:meta
rem *
rem * Build meta package
rem *
set _ASSEMBLY=Scullery
mkdir build\%_ASSEMBLY%
copy /y src\%_ASSEMBLY%.nuspec build\%_ASSEMBLY%
call :create
goto end
:package
rem *
rem * Build
rem *
pushd src\%_ASSEMBLY%
dotnet build --configuration %_CONFIGURATION%
popd
rem *
rem * Prepare directory
rem *
mkdir build
mkdir build\%_ASSEMBLY%
mkdir build\%_ASSEMBLY%\lib
mkdir build\%_ASSEMBLY%\lib\net6.0
copy /y src\%_ASSEMBLY%\bin\%_CONFIGURATION%\net6.0\%_ASSEMBLY%.dll build\%_ASSEMBLY%\lib\net6.0
copy /y src\%_ASSEMBLY%\%_ASSEMBLY%.nuspec build\%_ASSEMBLY%
call :create
exit /b
:create
rem *
rem * Create package
rem *
pushd build\%_ASSEMBLY%
nuget pack %_ASSEMBLY%.nuspec
rem *
rem * Remove existing local package
rem *
if not exist "%Source%\packages\%_ASSEMBLY%\%_VERSION%" goto skiprmdir
rmdir /q /s %Source%\packages\%_ASSEMBLY%\%_VERSION%
:skiprmdir
rem *
rem * Add local package
rem *
nuget add %_ASSEMBLY%.%_VERSION%.nupkg -source %Source%\packages
popd
rem *
rem * Remove cached pacakge
rem *
if not exist "%USERPROFILE%\.nuget\packages\%_ASSEMBLY%" goto skiprmdir2
rmdir /q /s %USERPROFILE%\.nuget\packages\%_ASSEMBLY%
:skiprmdir2
exit /b
:nover
echo No version file specified
goto end
:end