forked from Azure/AppConfiguration-DotnetProvider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpack.ps1
36 lines (26 loc) · 1.66 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
<#
.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(
)
$ErrorActionPreference = "Stop"
$PrebuiltBinariesDir = "bin\BuildOutput"
$PublishRelativePath = "bin\PackageOutput"
$LogDirectory = "$PSScriptRoot\buildlogs"
$AzureAppConfigurationProjectName = "Microsoft.Extensions.Configuration.AzureAppConfiguration"
$AzureAppConfigurationProjectPath = "$PSScriptRoot\src\$AzureAppConfigurationProjectName\$AzureAppConfigurationProjectName.csproj"
$AzureAppConfigurationOutputPath = "$PSScriptRoot\src\$AzureAppConfigurationProjectName\$PublishRelativePath"
$AzureAppConfigurationAspNetCoreProjectName = "Microsoft.Azure.AppConfiguration.AspNetCore"
$AzureAppConfigurationAspNetCoreProjectPath = "$PSScriptRoot\src\$AzureAppConfigurationAspNetCoreProjectName\$AzureAppConfigurationAspNetCoreProjectName.csproj"
$AzureAppConfigurationAspNetCoreOutputPath = "$PSScriptRoot\src\$AzureAppConfigurationAspNetCoreProjectName\$PublishRelativePath"
# Create the log directory.
if ((Test-Path -Path $LogDirectory) -ne $true) {
New-Item -ItemType Directory -Path $LogDirectory | Write-Verbose
}
# The build system expects pre-built binaries to be in the folder pointed to by 'OutDir'.
dotnet pack -o "$AzureAppConfigurationOutputPath" /p:OutDir="$PrebuiltBinariesDir" "$AzureAppConfigurationProjectPath" --no-build | Tee-Object -FilePath "$LogDirectory\build.log"
dotnet pack -o "$AzureAppConfigurationAspNetCoreOutputPath" /p:OutDir="$PrebuiltBinariesDir" "$AzureAppConfigurationAspNetCoreProjectPath" --no-build | Tee-Object -FilePath "$LogDirectory\build.log"
exit $LASTEXITCODE