forked from Azure/AppConfiguration-DotnetProvider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
30 lines (23 loc) · 1 KB
/
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
<#
.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"
)
$ErrorActionPreference = "Stop"
$BuildRelativePath = "bin\BuildOutput"
$LogDirectory = "$PSScriptRoot\buildlogs"
$Solution = "$PSScriptRoot\Microsoft.Extensions.Configuration.AzureAppConfiguration.sln"
# Create the log directory.
if ((Test-Path -Path $LogDirectory) -ne $true) {
New-Item -ItemType Directory -Path $LogDirectory | Write-Verbose
}
# Build (We use 'publish' to pull the Microsoft.Azure.AppConfiguration.AzconfigClient.dll to be able to include it in the Microsoft.Extensions.Configuration.AzureAppConfiguration NuGet package)
dotnet publish -o "$BuildRelativePath" -c $BuildConfig "$Solution" /p:OutDir=$BuildRelativePath | Tee-Object -FilePath "$LogDirectory\build.log"
exit $LASTEXITCODE