From e90058156be75b1177e331e634a5b454bdd3c29c Mon Sep 17 00:00:00 2001 From: John Beisner Date: Tue, 25 Jun 2019 11:39:15 -0700 Subject: [PATCH] Manufacturing of the Visual Studio NuPkgs. (dotnet/core-setup#6913) * Manufacturing of the Visual Studio NuPkgs. Commit migrated from https://github.com/dotnet/core-setup/commit/0524eae56d0bb16ec93a7313e237d6c5758bae90 --- src/installer/pkg/packaging/dir.proj | 83 +++++++++++++++++++++- src/installer/pkg/packaging/dir.props | 11 ++- .../vscomponents/VS.Redist.Common.Component.nuspec | 18 +++++ .../windows/vscomponents/generatenupkg.ps1 | 35 +++++++++ src/installer/publish/dir.props | 3 +- src/installer/publish/publish.proj | 7 +- 6 files changed, 151 insertions(+), 6 deletions(-) create mode 100644 src/installer/pkg/packaging/windows/vscomponents/VS.Redist.Common.Component.nuspec create mode 100644 src/installer/pkg/packaging/windows/vscomponents/generatenupkg.ps1 diff --git a/src/installer/pkg/packaging/dir.proj b/src/installer/pkg/packaging/dir.proj index 64c178d..e520e4f 100644 --- a/src/installer/pkg/packaging/dir.proj +++ b/src/installer/pkg/packaging/dir.proj @@ -15,7 +15,7 @@ - + @@ -214,4 +214,83 @@ Condition="'@(PackageProjects)' != ''" /> - + + + + + + + + $(MSBuildThisFileDirectory)windows/vscomponents/VS.Redist.Common.Component.nuspec + $(MSBuildThisFileDirectory)windows/vscomponents/generatenupkg.ps1 + https://github.com/dotnet/core-setup + + + + + $(HostFxrInstallerFile) + VS.Redist.Common.NetCore.HostFXR.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) .NET Core HostFX Resolver + + + $(AppHostPackInstallerFile) + VS.Redist.Common.NetCore.AppHostPack.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) .NET Core AppHost Pack + + + $(SharedFrameworkInstallerFile) + VS.Redist.Common.NetCore.SharedFramework.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) .NET Core SharedFramework + + + $(SharedHostInstallerFile) + VS.Redist.Common.NetCore.SharedHost.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) .NET Core SharedHost + + + $(NetStandardTargetingPackInstallerFile) + VS.Redist.Common.NetStandard.TargetingPack.$(TargetArchitecture).$(NetStandardProductBandVersion) + $(NetStandardProductBandVersion).$(PatchVersion)$(ProductVersionSuffix) + $(NetStandardProductBandVersion) .NET Standard TargetingPack + + + $(TargetingPackInstallerFile) + VS.Redist.Common.NetCore.TargetingPack.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) .NET Core TargetingPack + + + $(WindowsDesktopSharedFrameworkInstallerFile) + VS.Redist.Common.WindowsDesktop.SharedFramework.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) WindowsDesktop SharedFramework + + + $(WindowsDesktopTargetingPackInstallerFile) + VS.Redist.Common.WindowsDesktop.TargetingPack.$(TargetArchitecture).$(NETCoreAppFrameworkVersion) + $(SharedFrameworkNugetVersion) + $(NETCoreAppFrameworkVersion) WindowsDesktop TargetingPack + + + + + diff --git a/src/installer/pkg/packaging/dir.props b/src/installer/pkg/packaging/dir.props index 186e74e..7d7d4d7 100644 --- a/src/installer/pkg/packaging/dir.props +++ b/src/installer/pkg/packaging/dir.props @@ -27,4 +27,13 @@ dotnet-runtime-internal-$(ProductMoniker)$(CompressedFileExtension) dotnet-runtime-symbols-$(ProductMoniker)$(CompressedFileExtension) - \ No newline at end of file + + $(AssetOutputPath)dotnet-targeting-pack-$(ProductMoniker)$(InstallerExtension) + $(AssetOutputPath)dotnet-apphost-pack-$(ProductMoniker)$(InstallerExtension) + 2.1 + $(NetStandardProductBandVersion).$(PatchVersion)$(ProductVersionSuffix)-$(PackageTargetRid) + $(AssetOutputPath)netstandard-targeting-pack-$(NetStandardProductMoniker)$(InstallerExtension) + $(AssetOutputPath)windowsdesktop-runtime-$(ProductMoniker)$(InstallerExtension) + $(AssetOutputPath)windowsdesktop-targeting-pack-$(ProductMoniker)$(InstallerExtension) + + diff --git a/src/installer/pkg/packaging/windows/vscomponents/VS.Redist.Common.Component.nuspec b/src/installer/pkg/packaging/windows/vscomponents/VS.Redist.Common.Component.nuspec new file mode 100644 index 0000000..e9bb74c --- /dev/null +++ b/src/installer/pkg/packaging/windows/vscomponents/VS.Redist.Common.Component.nuspec @@ -0,0 +1,18 @@ + + + + $COMPONENT_NAME$ + 1.0.0 + $COMPONENT_NAME$ + Microsoft + Microsoft + https://www.microsoft.com/net/dotnet_library_license.htm + $PROJECT_URL$ + true + $FRIENDLY_NAME$ ($ARCH$) Windows Installer MSI as a .nupkg for internal Visual Studio build consumption + © Microsoft Corporation. All rights reserved. + + + + + diff --git a/src/installer/pkg/packaging/windows/vscomponents/generatenupkg.ps1 b/src/installer/pkg/packaging/windows/vscomponents/generatenupkg.ps1 new file mode 100644 index 0000000..52cf538 --- /dev/null +++ b/src/installer/pkg/packaging/windows/vscomponents/generatenupkg.ps1 @@ -0,0 +1,35 @@ +# 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]$MsiPath, + [Parameter(Mandatory=$true)][string]$MsiVersion, + [Parameter(Mandatory=$true)][string]$NuspecFile, + [Parameter(Mandatory=$true)][string]$NupkgFile, + [Parameter(Mandatory=$true)][string]$Architecture, + [Parameter(Mandatory=$true)][string]$ComponentName, + [Parameter(Mandatory=$true)][string]$ComponentFriendlyName, + [Parameter(Mandatory=$true)][string]$ProjectUrl, + [Parameter(Mandatory=$true)][string]$BinDir +) + +$NuGetDir = Join-Path $BinDir "nuget" +$NuGetExe = Join-Path $NuGetDir "nuget.exe" +$OutputDirectory = [System.IO.Path]::GetDirectoryName($NupkgFile) + +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 +} + +if (Test-Path $NupkgFile) { + Remove-Item -Force $NupkgFile +} + +& $NuGetExe pack $NuspecFile -Version $MsiVersion -OutputDirectory $OutputDirectory -NoDefaultExcludes -NoPackageAnalysis -Properties COMPONENT_MSI=$MsiPath`;ARCH=$Architecture`;COMPONENT_NAME=$ComponentName`;FRIENDLY_NAME=$ComponentFriendlyName`;PROJECT_URL=$ProjectUrl +Exit $LastExitCode diff --git a/src/installer/publish/dir.props b/src/installer/publish/dir.props index e743bfe..3b9ec85 100644 --- a/src/installer/publish/dir.props +++ b/src/installer/publish/dir.props @@ -31,7 +31,8 @@ Include=" $(PackageOutputPath)**/runtime.*.nupkg; $(PackageOutputPath)**/*.Runtime.*.nupkg; - $(PackageOutputPath)**/*.App.Host.*.nupkg" + $(PackageOutputPath)**/*.App.Host.*.nupkg; + $(PackageOutputPath)**/VS.Redist.Common.*.nupkg" RelativeBlobPath="$(BinariesRelativePath)"/> diff --git a/src/installer/publish/publish.proj b/src/installer/publish/publish.proj index 98487e1..6423a79 100644 --- a/src/installer/publish/publish.proj +++ b/src/installer/publish/publish.proj @@ -60,8 +60,11 @@ - - + + -- 2.7.4