Generate VS nuget package for 2.1 (#11616)
This commit is contained in:
parent
6ed7bf85b1
commit
010fdeac8e
|
|
@ -0,0 +1,31 @@
|
||||||
|
# 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
|
||||||
|
)
|
||||||
|
|
||||||
|
$NuGetDir = Join-Path $RepoRoot "obj\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)) {
|
||||||
|
# Using 3.5.0 to workaround https://github.com/NuGet/Home/issues/5016
|
||||||
|
Write-Output "Downloading nuget.exe to $NuGetExe"
|
||||||
|
wget https://dist.nuget.org/win-x86-commandline/v3.5.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`;
|
||||||
|
Exit $LastExitCode
|
||||||
|
|
@ -17,6 +17,8 @@
|
||||||
<HarvestSource>$(SharedFrameworkHarvestRootPath)\$(Platform)\</HarvestSource>
|
<HarvestSource>$(SharedFrameworkHarvestRootPath)\$(Platform)\</HarvestSource>
|
||||||
<DefineConstants>$(DefineConstants);AspNetCoreSharedFrameworkSource=$(HarvestSource)</DefineConstants>
|
<DefineConstants>$(DefineConstants);AspNetCoreSharedFrameworkSource=$(HarvestSource)</DefineConstants>
|
||||||
<NamespaceGuid>$(SharedFrameworkNamespaceGuid)</NamespaceGuid>
|
<NamespaceGuid>$(SharedFrameworkNamespaceGuid)</NamespaceGuid>
|
||||||
|
<ToolsetInstallerNuspecFile>$(RepositoryRoot)\src\Installers\Windows\SharedFramework\SharedFrameworkPackage.nuspec</ToolsetInstallerNuspecFile>
|
||||||
|
<InstallersOutputPath>$(RepositoryRoot)artifacts/bin/$(Configuration)/installers/</InstallersOutputPath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
@ -47,5 +49,23 @@
|
||||||
</HarvestDirectory>
|
</HarvestDirectory>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="CreateSharedFrameworkNugetPackage" AfterTargets="CopyToArtifactsDirectory;Build">
|
||||||
|
<PropertyGroup>
|
||||||
|
<MsiFullPath>$(InstallersOutputPath)en-US/$(TargetFileName)</MsiFullPath>
|
||||||
|
<CabFullPath>$(InstallersOutputPath)en-US/$(Cabinet)</CabFullPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Exec Command="powershell -NoProfile -NoLogo $(GenerateNupkgPowershellScript) ^
|
||||||
|
'$(ProductNameShort)' ^
|
||||||
|
'$(MsiFullPath)' ^
|
||||||
|
'$(CabFullPath)' ^
|
||||||
|
'$(ToolsetInstallerNuspecFile)' ^
|
||||||
|
'$(InstallersOutputPath)' ^
|
||||||
|
'$(Platform)' ^
|
||||||
|
'$(PackageVersion)' ^
|
||||||
|
'$(RepositoryRoot)' ^
|
||||||
|
'$(AspNetCoreMajorVersion)' ^
|
||||||
|
'$(AspNetCoreMinorVersion)'" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$</id>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<title>VS.Redist.Common.AspNetCore.SharedFramework.$ARCH$.$MAJOR$.$MINOR$</title>
|
||||||
|
<authors>Microsoft</authors>
|
||||||
|
<owners>Microsoft</owners>
|
||||||
|
<licenseUrl>https://www.microsoft.com/net/dotnet_library_license.htm</licenseUrl>
|
||||||
|
<projectUrl>https://github.com/aspnet/aspnetcore</projectUrl>
|
||||||
|
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||||
|
<description>$MAJOR$.$MINOR$ ASP.NET Core TargetingPack ($ARCH$) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption</description>
|
||||||
|
<copyright>© Microsoft Corporation. All rights reserved.</copyright>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="$ASPNETCORE_RUNTIME_MSI$" />
|
||||||
|
<file src="$ASPNETCORE_CAB_FILE$" />
|
||||||
|
</files>
|
||||||
|
</package>
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
<DefineConstants>$(DefineConstants);MajorVersion=$(AspNetCoreMajorVersion)</DefineConstants>
|
<DefineConstants>$(DefineConstants);MajorVersion=$(AspNetCoreMajorVersion)</DefineConstants>
|
||||||
<DefineConstants>$(DefineConstants);MinorVersion=$(AspNetCoreMinorVersion)</DefineConstants>
|
<DefineConstants>$(DefineConstants);MinorVersion=$(AspNetCoreMinorVersion)</DefineConstants>
|
||||||
<DefineConstants>$(DefineConstants);PackageVersion=$(PackageVersion)</DefineConstants>
|
<DefineConstants>$(DefineConstants);PackageVersion=$(PackageVersion)</DefineConstants>
|
||||||
|
<GenerateNupkgPowershellScript>$(RepositoryRoot)\src\Installers\Windows\GenerateNugetPackageWithMsi.ps1</GenerateNupkgPowershellScript>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue