-
-
Notifications
You must be signed in to change notification settings - Fork 34
/
build-core.ps1
75 lines (61 loc) · 2.41 KB
/
build-core.ps1
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
[cmdletbinding()]
param(
[Parameter(Mandatory=$False)][ValidateSet('Release','Debug')][string]$configuration
)
# How to run:
# .\build-core.ps1
# or
# .\build-core.ps1 -configuration Debug
. .\build-include.ps1
$scriptpath = $MyInvocation.MyCommand.Path
$dir = Split-Path $scriptpath
Push-Location $dir
if (-not $PSBoundParameters.ContainsKey('configuration'))
{
if (Test-Path Release.snk) { $configuration = "Release"; } else { $configuration = "Debug"; }
}
Write-Host "Using configuration $configuration..." -ForegroundColor Yellow
try {
# CodegenCS.Core + nupkg/snupkg
dotnet restore ".\Core\CodegenCS\CodegenCS.Core.csproj"
& $msbuild ".\Core\CodegenCS\CodegenCS.Core.csproj" `
/t:Restore /t:Build /t:Pack `
/p:PackageOutputPath="..\..\packages-local\" `
/p:Configuration=$configuration `
/p:IncludeSymbols=true `
/verbosity:minimal `
/p:ContinuousIntegrationBuild=true
if (! $?) { throw "msbuild failed" }
# CodegenCS.Models + nupkg/snupkg
dotnet restore ".\Core\CodegenCS.Models\CodegenCS.Models.csproj"
& $msbuild ".\Core\CodegenCS.Models\CodegenCS.Models.csproj" `
/t:Restore /t:Build /t:Pack `
/p:PackageOutputPath="..\..\packages-local\" `
/p:Configuration=$configuration `
/p:IncludeSymbols=true `
/verbosity:minimal `
/p:ContinuousIntegrationBuild=true
if (! $?) { throw "msbuild failed" }
# CodegenCS.Runtime + nupkg/snupkg
dotnet restore ".\Core\CodegenCS.Runtime\CodegenCS.Runtime.csproj"
& $msbuild ".\Core\CodegenCS.Runtime\CodegenCS.Runtime.csproj" `
/t:Restore /t:Build /t:Pack `
/p:PackageOutputPath="..\..\packages-local\" `
/p:Configuration=$configuration `
/p:IncludeSymbols=true `
/verbosity:minimal `
/p:ContinuousIntegrationBuild=true
if (! $?) { throw "msbuild failed" }
# CodegenCS.DotNet + nupkg/snupkg
dotnet restore ".\Core\CodegenCS.DotNet\CodegenCS.DotNet.csproj"
& $msbuild ".\Core\CodegenCS.DotNet\CodegenCS.DotNet.csproj" `
/t:Restore /t:Build /t:Pack `
/p:PackageOutputPath="..\..\packages-local\" `
/p:Configuration=$configuration `
/p:IncludeSymbols=true `
/verbosity:minimal `
/p:ContinuousIntegrationBuild=true
if (! $?) { throw "msbuild failed" }
} finally {
Pop-Location
}