-
Notifications
You must be signed in to change notification settings - Fork 114
/
Copy pathpack.ps1
43 lines (31 loc) · 1.06 KB
/
pack.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
<#
.Synopsis
This script creates NuGet packages from all of the projects in this repo.
Note: build.cmd should be run before running this script.
#>
[CmdletBinding()]
param(
[Parameter()]
[ValidateSet('Debug','Release')]
[string]$BuildConfig = "Release"
)
$ErrorActionPreference = "Stop"
$PublishRelativePath = "bin\PackageOutput"
$LogDirectory = "$PSScriptRoot\buildlogs"
$targetProjects = @(
"Microsoft.FeatureManagement",
"Microsoft.FeatureManagement.AspNetCore",
"Microsoft.FeatureManagement.Telemetry.ApplicationInsights"
)
# 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"
foreach ($project in $targetProjects)
{
$projectPath = "$PSScriptRoot\src\$project\$project.csproj"
$outputPath = "$PSScriptRoot\src\$project\$PublishRelativePath"
& $dotnet pack -c $BuildConfig -o "$outputPath" "$projectPath" --no-build | Tee-Object -FilePath "$LogDirectory\build.log"
}
exit $LASTEXITCODE