-
Notifications
You must be signed in to change notification settings - Fork 114
/
build.ps1
42 lines (33 loc) · 917 Bytes
/
build.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
<#
.Synopsis
This script builds all of the projects in this repo.
.Parameter BuildConfig
Indicates whether the build config should be set to Debug or Release. The default is Release.
#>
[CmdletBinding()]
param(
[Parameter()]
[ValidateSet('Debug','Release')]
[string]$BuildConfig = "Release",
[Parameter()]
[switch]$RestoreOnly = $false
)
$ErrorActionPreference = "Stop"
$LogDirectory = "$PSScriptRoot\buildlogs"
$Solution = "$PSScriptRoot\Microsoft.FeatureManagement.sln"
# Create the log directory.
if ((Test-Path -Path $LogDirectory) -ne $true) {
New-Item -ItemType Directory -Path $LogDirectory | Write-Verbose
}
$dotnet = & "$PSScriptRoot/build/resolve-dotnet.ps1"
if ($RestoreOnly)
{
# Restore
& $dotnet restore "$Solution"
}
else
{
# Build
& $dotnet build -c $BuildConfig "$Solution" | Tee-Object -FilePath "$LogDirectory\build.log"
}
exit $LASTEXITCODE