forked from dotnet/aspnetcore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
GenerateNugetPackageWithMsi.ps1
38 lines (33 loc) · 1.69 KB
/
GenerateNugetPackageWithMsi.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
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
param(
[Parameter(Mandatory=$true)][string]$Name,
[Parameter(Mandatory=$true)][string]$MsiPath,
[Parameter(Mandatory=$false)][string]$CabPath,
[Parameter(Mandatory=$true)][string]$NuspecFile,
[Parameter(Mandatory=$true)][string]$OutputDirectory,
[Parameter(Mandatory=$true)][string]$Architecture,
[Parameter(Mandatory=$true)][string]$PackageVersion,
[Parameter(Mandatory=$true)][string]$RepoRoot,
[Parameter(Mandatory=$true)][string]$MajorVersion,
[Parameter(Mandatory=$true)][string]$MinorVersion,
[Parameter(Mandatory=$true)][string]$PackageIcon,
[Parameter(Mandatory=$true)][string]$PackageIconFullPath,
[Parameter(Mandatory=$true)][string]$PackageLicenseExpression
)
$NuGetDir = Join-Path $RepoRoot "artifacts\Tools\nuget\$Name\$Architecture"
$NuGetExe = Join-Path $NuGetDir "nuget.exe"
if (-not (Test-Path $NuGetDir)) {
New-Item -ItemType Directory -Force -Path $NuGetDir | Out-Null
}
if (-not (Test-Path $NuGetExe)) {
Write-Output "Downloading nuget.exe to $NuGetExe"
wget https://dist.nuget.org/win-x86-commandline/v5.6.0/nuget.exe -OutFile $NuGetExe
}
& $NuGetExe pack $NuspecFile `
-Version $PackageVersion `
-OutputDirectory $OutputDirectory `
-NoDefaultExcludes `
-NoPackageAnalysis `
-Properties ASPNETCORE_RUNTIME_MSI=$MsiPath`;ASPNETCORE_CAB_FILE=$CabPath`;ARCH=$Architecture`;MAJOR=$MajorVersion`;MINOR=$MinorVersion`;PackageIcon=$PackageIcon`;PackageIconFullPath=$PackageIconFullPath`;PackageLicenseExpression=$PackageLicenseExpression`;
Exit $LastExitCode