From dea1e3242d932f43bbdfb46a3bd3fd1d37bfdd61 Mon Sep 17 00:00:00 2001 From: Sridhar Periyasamy Date: Mon, 14 Mar 2016 18:54:45 -0700 Subject: [PATCH] Create dotnet bundle with CLI SDK, SharedFx MSI and Shared Host MSI. --- packaging/host/windows/registrykeys.wxs | 4 +++- packaging/windows/bundle.wxs | 8 ++++++- packaging/windows/generatebundle.ps1 | 14 +++++++----- packaging/windows/registrykeys.wxs | 2 -- scripts/dotnet-cli-build/MsiTargets.cs | 5 +++-- scripts/dotnet-cli-build/PackageTargets.cs | 25 ++++++++++++++++++++++ 6 files changed, 47 insertions(+), 11 deletions(-) diff --git a/packaging/host/windows/registrykeys.wxs b/packaging/host/windows/registrykeys.wxs index 6f5a3cad0..3d971599b 100644 --- a/packaging/host/windows/registrykeys.wxs +++ b/packaging/host/windows/registrykeys.wxs @@ -10,16 +10,18 @@ + - + + diff --git a/packaging/windows/bundle.wxs b/packaging/windows/bundle.wxs index 6999e8a3c..664087a99 100644 --- a/packaging/windows/bundle.wxs +++ b/packaging/windows/bundle.wxs @@ -32,7 +32,13 @@ - + + + + + + + diff --git a/packaging/windows/generatebundle.ps1 b/packaging/windows/generatebundle.ps1 index e50300363..dd73daaaa 100644 --- a/packaging/windows/generatebundle.ps1 +++ b/packaging/windows/generatebundle.ps1 @@ -2,7 +2,9 @@ # Licensed under the MIT license. See LICENSE file in the project root for full license information. param( - [Parameter(Mandatory=$true)][string]$DotnetMSIFile, + [Parameter(Mandatory=$true)][string]$CLISDKMSIFile, + [Parameter(Mandatory=$true)][string]$SharedFxMSIFile, + [Parameter(Mandatory=$true)][string]$SharedHostMSIFile, [Parameter(Mandatory=$true)][string]$DotnetBundleOutput, [Parameter(Mandatory=$true)][string]$WixRoot, [Parameter(Mandatory=$true)][string]$DotnetMSIVersion, @@ -28,7 +30,9 @@ function RunCandleForBundle -dBuildVersion="$DotnetMSIVersion" ` -dDisplayVersion="$DotnetCLIVersion" ` -dReleaseSuffix="$ReleaseSuffix" ` - -dMsiSourcePath="$DotnetMSIFile" ` + -dCLISDKMsiSourcePath="$CLISDKMSIFile" ` + -dSharedFXMsiSourcePath="$SharedFxMSIFile" ` + -dSharedHostMsiSourcePath="$SharedHostMSIFile" ` -arch "$Architecture" ` -ext WixBalExtension.dll ` -ext WixUtilExtension.dll ` @@ -73,9 +77,9 @@ function RunLightForBundle } -if(!(Test-Path $DotnetMSIFile)) +if(!(Test-Path $CLISDKMSIFile)) { - throw "$DotnetMSIFile not found" + throw "$CLISDKMSIFile not found" } Write-Host "Creating dotnet Bundle at $DotnetBundleOutput" @@ -103,6 +107,6 @@ if(!(Test-Path $DotnetBundleOutput)) Write-Host -ForegroundColor Green "Successfully created dotnet bundle - $DotnetBundleOutput" -_ $RepoRoot\test\Installer\testmsi.ps1 @("$DotnetMSIFile") +_ $RepoRoot\test\Installer\testmsi.ps1 @("$CLISDKMSIFile") exit $LastExitCode diff --git a/packaging/windows/registrykeys.wxs b/packaging/windows/registrykeys.wxs index 9bd84eb25..efb5c2b39 100644 --- a/packaging/windows/registrykeys.wxs +++ b/packaging/windows/registrykeys.wxs @@ -23,8 +23,6 @@ - - diff --git a/scripts/dotnet-cli-build/MsiTargets.cs b/scripts/dotnet-cli-build/MsiTargets.cs index e0e3ecb37..aa50fcac8 100644 --- a/scripts/dotnet-cli-build/MsiTargets.cs +++ b/scripts/dotnet-cli-build/MsiTargets.cs @@ -94,9 +94,10 @@ namespace Microsoft.DotNet.Cli.Build [BuildPlatforms(BuildPlatform.Windows)] public static BuildTargetResult GenerateCliSdkMsi(BuildTargetContext c) { + var cliSdkRoot = c.BuildContext.Get("CLISDKRoot"); Cmd("powershell", "-NoProfile", "-NoLogo", Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatemsi.ps1"), - Dirs.Stage2, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel) + cliSdkRoot, SdkMsi, WixRoot, MsiVersion, CliVersion, Arch, Channel) .Execute() .EnsureSuccessful(); return c.Success(); @@ -156,7 +157,7 @@ namespace Microsoft.DotNet.Cli.Build { Cmd("powershell", "-NoProfile", "-NoLogo", Path.Combine(Dirs.RepoRoot, "packaging", "windows", "generatebundle.ps1"), - SdkMsi, SdkBundle, WixRoot, MsiVersion, CliVersion, Arch, Channel) + SdkMsi, SharedFrameworkMsi, SharedHostMsi, SdkBundle, WixRoot, MsiVersion, CliVersion, Arch, Channel) .EnvironmentVariable("Stage2Dir", Dirs.Stage2) .Execute() .EnsureSuccessful(); diff --git a/scripts/dotnet-cli-build/PackageTargets.cs b/scripts/dotnet-cli-build/PackageTargets.cs index 11ba01b43..77b9300a8 100644 --- a/scripts/dotnet-cli-build/PackageTargets.cs +++ b/scripts/dotnet-cli-build/PackageTargets.cs @@ -22,6 +22,7 @@ namespace Microsoft.DotNet.Cli.Build [Target(nameof(PrepareTargets.Init), nameof(PackageTargets.InitPackage), nameof(PackageTargets.GenerateVersionBadge), + nameof(PackageTargets.CopyCLISDKLayout), nameof(SharedFrameworkTargets.PublishSharedHost), nameof(SharedFrameworkTargets.PublishSharedFramework), nameof(PackageTargets.GenerateCompressedFile), @@ -47,6 +48,30 @@ namespace Microsoft.DotNet.Cli.Build return c.Success(); } + [Target] + public static BuildTargetResult CopyCLISDKLayout(BuildTargetContext c) + { + var nugetVersion = c.BuildContext.Get("BuildVersion").NuGetVersion; + var cliSdkRoot = Path.Combine(Dirs.Output, "obj", "clisdk"); + var cliSdk = Path.Combine(cliSdkRoot, "sdk", nugetVersion); + + if (Directory.Exists(cliSdkRoot)) + { + Directory.Delete(cliSdkRoot, true); + } + + Directory.CreateDirectory(cliSdk); + + foreach (var file in Directory.GetFiles(Dirs.Stage2, "*", SearchOption.AllDirectories)) + { + string destFile = Path.Combine(cliSdk, Path.GetFileName(file)); + File.Copy(file, destFile, true); + } + + c.BuildContext["CLISDKRoot"] = cliSdkRoot; + return c.Success(); + } + [Target(nameof(PackageTargets.GenerateZip), nameof(PackageTargets.GenerateTarBall))] public static BuildTargetResult GenerateCompressedFile(BuildTargetContext c) {