This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.bat
69 lines (49 loc) · 1.84 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
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
@echo Off
set config=%1
if "%config%" == "" (
set config=Release
)
set version=1.0.0
if not "%PackageVersion%" == "" (
set version=%PackageVersion%
)
set nuget=
if "%nuget%" == "" (
set nuget=nuget
)
set build="%programfiles(x86)%\MSBuild\14.0\Bin\MsBuild.exe"
powershell -Command "(new-object System.Net.WebClient).DownloadFile('https://dist.nuget.org/win-x86-commandline/latest/nuget.exe','nuget.exe')"
copy nuget.exe Sigma.Core
copy nuget.exe Sigma.Core.Monitors.WPF
REM build Sigma.Core
cd Sigma.Core
nuget.exe restore -SolutionDirectory ../
%build% Sigma.Core.csproj /p:Configuration="%config%" /p:Platform=x64
REM pack Sigma.Core
nuget.exe pack "Sigma.Core.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%
REM build Sigma.Core.Monitors.WPF
cd ../Sigma.Core.Monitors.WPF
REM update the targets file
cd build
REM this is required in order to handle it as text instead of binary (im a powershell noob)
move Sigma.Core.Monitors.WPF.template.targets targets.txt
powershell -Command "(Get-Content targets.txt) -replace '~version~', '%version%' | Set-Content Sigma.Core.Monitors.WPF.targets.txt"
move Sigma.Core.Monitors.WPF.targets.txt Sigma.Core.Monitors.WPF.targets
move targets.txt Sigma.Core.Monitors.WPF.template.targets
cd ..
REM actual build
nuget.exe restore -SolutionDirectory ../
%build% Sigma.Core.Monitors.WPF.csproj /p:Configuration="%config%" /p:Platform=x64
REM pack Sigma.Core.Monitors.WPF
nuget.exe pack "Sigma.Core.Monitors.WPF.csproj" -IncludeReferencedProjects -Prop Platform=x64 -Verbosity detailed -Prop Configuration=%config% -Version %version%
REM cleanup
REM delete newly created target file
cd build
del Sigma.Core.Monitors.WPF.targets
cd ..
del nuget.exe
cd ..
del nuget.exe
cd Sigma.Core
del nuget.exe
cd ..