From f496a9bb18be39255d07c99097aacd2a7dbaa467 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Wed, 4 Apr 2018 10:37:38 -0700 Subject: [PATCH 1/3] Updating windows msi code to use variables for the SDK and Runtime brandings. --- build/package/Installer.MSI.targets | 4 +++- packaging/windows/clisdk/bundle.wxl | 6 +++--- packaging/windows/clisdk/bundle.wxs | 3 +++ packaging/windows/clisdk/generatebundle.ps1 | 6 +++++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build/package/Installer.MSI.targets b/build/package/Installer.MSI.targets index 22d6adf38..96f9a27cb 100644 --- a/build/package/Installer.MSI.targets +++ b/build/package/Installer.MSI.targets @@ -154,7 +154,9 @@ '$(SimpleVersion)' '$(NugetVersion)' '$(CombinedFrameworkSDKHostInstallerUpgradeCode)' - '$(Architecture)'" /> + '$(Architecture)' + '$(SharedFrameworkVersion)' + '$(AspNetCoreRuntimePackageVersion)'" /> The installation was successful The following were installed at [DOTNETHOME] - • .NET Core SDK 2.1.300 - • .NET Core Runtime 2.1.0 - • ASP.NET Core Runtime 2.1.0 + • .NET Core SDK [DOTNETSDKVERSION] + • .NET Core Runtime [DOTNETRUNTIMEVERSION] + • ASP.NET Core Runtime [ASPNETCOREVERSION] This product collects usage data • More information and opt-out https://aka.ms/dotnet-cli-telemetry diff --git a/packaging/windows/clisdk/bundle.wxs b/packaging/windows/clisdk/bundle.wxs index 5e6936af7..aeae3aad9 100644 --- a/packaging/windows/clisdk/bundle.wxs +++ b/packaging/windows/clisdk/bundle.wxs @@ -24,6 +24,9 @@ + + + diff --git a/packaging/windows/clisdk/generatebundle.ps1 b/packaging/windows/clisdk/generatebundle.ps1 index 8b53d9591..a2b166baf 100644 --- a/packaging/windows/clisdk/generatebundle.ps1 +++ b/packaging/windows/clisdk/generatebundle.ps1 @@ -14,7 +14,9 @@ param( [Parameter(Mandatory=$true)][string]$DotnetCLIDisplayVersion, [Parameter(Mandatory=$true)][string]$DotnetCLINugetVersion, [Parameter(Mandatory=$true)][string]$UpgradeCode, - [Parameter(Mandatory=$true)][string]$Architecture + [Parameter(Mandatory=$true)][string]$Architecture, + [Parameter(Mandatory=$true)][string]$DotNetRuntimeVersion, + [Parameter(Mandatory=$true)][string]$AspNetCoreVersion ) . "$PSScriptRoot\..\..\..\scripts\common\_common.ps1" @@ -43,6 +45,8 @@ function RunCandleForBundle -dAdditionalSharedFXMsiSourcePath="$AdditionalSharedFxMSIFile" ` -dAdditionalHostFXRMsiSourcePath="$AdditionalHostFxrMSIFile" ` -dAdditionalSharedHostMsiSourcePath="$AdditionalSharedHostMSIFile" ` + -dDotNetRuntimeVersion="$DotNetRuntimeVersion" ` + -dAspNetCoreVersion="$AspNetCoreVersion" ` -arch "$Architecture" ` -ext WixBalExtension.dll ` -ext WixUtilExtension.dll ` From b09b6bff26fa1f278918cfbf6de46f1c63c65c57 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Wed, 4 Apr 2018 20:57:45 -0700 Subject: [PATCH 2/3] Generating the conclusion.html files dynamically so that we don't need to set the version in them everytime our branding changes. --- build/package/Installer.DEB.proj | 8 ++-- build/package/Installer.MSI.targets | 4 +- build/package/Installer.PKG.targets | 30 +++++++++++--- build/package/Installer.RPM.targets | 4 +- build/publish/Badge.targets | 8 ++-- .../dotnet-cli-build/ReplaceFileContents.cs | 41 ++++++++++++++----- .../clisdk/resources/cs.lproj/conclusion.html | 6 +-- .../clisdk/resources/de.lproj/conclusion.html | 6 +-- .../clisdk/resources/en.lproj/conclusion.html | 6 +-- .../clisdk/resources/es.lproj/conclusion.html | 6 +-- .../clisdk/resources/fr.lproj/conclusion.html | 6 +-- .../clisdk/resources/it.lproj/conclusion.html | 6 +-- .../clisdk/resources/ja.lproj/conclusion.html | 6 +-- .../clisdk/resources/ko.lproj/conclusion.html | 6 +-- .../clisdk/resources/pl.lproj/conclusion.html | 6 +-- .../resources/pt-br.lproj/conclusion.html | 6 +-- .../clisdk/resources/ru.lproj/conclusion.html | 6 +-- .../clisdk/resources/tr.lproj/conclusion.html | 6 +-- .../resources/zh-hans.lproj/conclusion.html | 6 +-- .../resources/zh-hant.lproj/conclusion.html | 6 +-- src/redist/redist.csproj | 4 +- 21 files changed, 111 insertions(+), 72 deletions(-) diff --git a/build/package/Installer.DEB.proj b/build/package/Installer.DEB.proj index f8c741964..0e516f440 100644 --- a/build/package/Installer.DEB.proj +++ b/build/package/Installer.DEB.proj @@ -53,8 +53,8 @@ + '$(MicrosoftNETCoreAppPackageVersion)' + '$(AspNetCoreVersion)'" /> $(SdkPkgScriptsDirectory)/postinstall $(PkgIntermediateDirectory)/scripts $(SdkPkgDestinationScriptsDirectory)/postinstall - $(SdkPkgSourcesRootDirectory)/resources + $(PkgIntermediateDirectory)/resources $(SdkPkgSourcesRootDirectory)/Distribution-Template $(PkgIntermediateDirectory)/CLI-SDK-Formatted-Distribution-Template.xml @@ -61,6 +61,16 @@ $(SdkVersion) + + + $(SdkVersion) + + + $(MicrosoftNETCoreAppPackageVersion) + + + $(AspNetCoreVersion) + @@ -69,6 +79,8 @@ + + @@ -77,7 +89,7 @@ - + @@ -91,11 +103,17 @@ DestinationFiles="@(AspNetRuntimeFilesInput->'$(SdkLayoutOutputDirectory)/%(RecursiveDir)%(FileName)%(Extension)')" /> + + @@ -130,8 +148,8 @@ diff --git a/build/package/Installer.RPM.targets b/build/package/Installer.RPM.targets index 115d6070f..9302cf5ea 100644 --- a/build/package/Installer.RPM.targets +++ b/build/package/Installer.RPM.targets @@ -104,8 +104,8 @@ - @@ -21,8 +21,8 @@ diff --git a/build_projects/dotnet-cli-build/ReplaceFileContents.cs b/build_projects/dotnet-cli-build/ReplaceFileContents.cs index b0baf4179..130550aba 100644 --- a/build_projects/dotnet-cli-build/ReplaceFileContents.cs +++ b/build_projects/dotnet-cli-build/ReplaceFileContents.cs @@ -3,6 +3,7 @@ using System; using System.IO; +using System.Linq; using System.Text.RegularExpressions; using Microsoft.Build.Utilities; using Microsoft.Build.Framework; @@ -28,10 +29,10 @@ namespace Microsoft.DotNet.Cli.Build public class ReplaceFileContents : Task { [Required] - public string InputFile { get; set; } + public ITaskItem[] InputFiles { get; set; } [Required] - public string DestinationFile { get; set; } + public ITaskItem[] DestinationFiles { get; set; } public ITaskItem[] ReplacementItems { get; set; } @@ -55,19 +56,36 @@ namespace Microsoft.DotNet.Cli.Build throw new Exception($"Expected {nameof(ReplacementPatterns)} (length {ReplacementPatterns.Length}) and {nameof(ReplacementStrings)} (length {ReplacementStrings.Length}) to have the same length."); } - if (!File.Exists(InputFile)) + if (InputFiles.Length != DestinationFiles.Length) { - throw new FileNotFoundException($"Expected file {InputFile} was not found."); + throw new Exception($"Expected {nameof(InputFiles)} (length {InputFiles.Length}) and {nameof(DestinationFiles)} (length {DestinationFiles.Length}) to have the same length."); } - string inputFileText = File.ReadAllText(InputFile); - string outputFileText = ReplacePatterns(inputFileText); + var filesNotFound = InputFiles.Where(i => !File.Exists(i.ItemSpec)).Select(i => i.ItemSpec); + if (filesNotFound.Any()) + { + var filesNotFoundString = string.Join(",", filesNotFound); + throw new FileNotFoundException($"Expected files where not found: {filesNotFoundString}"); + } - WriteOutputFile(outputFileText); + Log.LogMessage(MessageImportance.High, $"ReplacingContents for `{InputFiles.Length}` files."); + + for (var i = 0; i < InputFiles.Length; i++) + { + ReplaceContents(InputFiles[i].ItemSpec, DestinationFiles[i].ItemSpec); + } return true; } + public void ReplaceContents(string inputFile, string destinationFile) + { + string inputFileText = File.ReadAllText(inputFile); + string outputFileText = ReplacePatterns(inputFileText); + + WriteOutputFile(destinationFile, outputFileText); + } + public string ReplacePatterns(string inputFileText) { var outText = inputFileText; @@ -92,15 +110,18 @@ namespace Microsoft.DotNet.Cli.Build return outText; } - public void WriteOutputFile(string outputFileText) + public void WriteOutputFile(string destinationFile, string outputFileText) { - var destinationDirectory = Path.GetDirectoryName(DestinationFile); + var destinationDirectory = Path.GetDirectoryName(destinationFile); + Log.LogMessage(MessageImportance.High, $"Destination Directory: {destinationDirectory}"); if (!Directory.Exists(destinationDirectory)) { + Log.LogMessage(MessageImportance.High, $"Destination Directory `{destinationDirectory}` does not exist. Creating..."); Directory.CreateDirectory(destinationDirectory); } - File.WriteAllText(DestinationFile, outputFileText); + Log.LogMessage(MessageImportance.High, $"Writing file: {destinationFile}"); + File.WriteAllText(destinationFile, outputFileText); } } } diff --git a/packaging/osx/clisdk/resources/cs.lproj/conclusion.html b/packaging/osx/clisdk/resources/cs.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/cs.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/cs.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/de.lproj/conclusion.html b/packaging/osx/clisdk/resources/de.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/de.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/de.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/en.lproj/conclusion.html b/packaging/osx/clisdk/resources/en.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/en.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/en.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/es.lproj/conclusion.html b/packaging/osx/clisdk/resources/es.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/es.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/es.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/fr.lproj/conclusion.html b/packaging/osx/clisdk/resources/fr.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/fr.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/fr.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/it.lproj/conclusion.html b/packaging/osx/clisdk/resources/it.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/it.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/it.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/ja.lproj/conclusion.html b/packaging/osx/clisdk/resources/ja.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/ja.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ja.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/ko.lproj/conclusion.html b/packaging/osx/clisdk/resources/ko.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/ko.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ko.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/pl.lproj/conclusion.html b/packaging/osx/clisdk/resources/pl.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/pl.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/pl.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html b/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/pt-br.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/ru.lproj/conclusion.html b/packaging/osx/clisdk/resources/ru.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/ru.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/ru.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/tr.lproj/conclusion.html b/packaging/osx/clisdk/resources/tr.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/tr.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/tr.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html b/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/zh-hans.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html b/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html index 7d91816fd..03fc060e4 100644 --- a/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html +++ b/packaging/osx/clisdk/resources/zh-hant.lproj/conclusion.html @@ -7,9 +7,9 @@

The following was installed at /usr/local/share/dotnet

    -
  • .NET Core SDK 2.1.300
  • -
  • .NET Core Runtime 2.1.0
  • -
  • ASP.NET Core Runtime 2.1.0
  • +
  • .NET Core SDK {DOTNETSDKVERSION}
  • +
  • .NET Core Runtime {DOTNETRUNTIMEVERSION}
  • +
  • ASP.NET Core Runtime {ASPNETCOREVERSION}

diff --git a/src/redist/redist.csproj b/src/redist/redist.csproj index 65bd1e2a9..cd3ca221e 100644 --- a/src/redist/redist.csproj +++ b/src/redist/redist.csproj @@ -356,8 +356,8 @@ "version": "$(MicrosoftNETCoreAppPackageVersion)" From d26719d8de8029cbdaf31c724e264ed8acd3d89c Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Wed, 4 Apr 2018 21:21:10 -0700 Subject: [PATCH 3/3] Modifying branding.props to no longer have the version there manually updated. With this last change, updating the CLI version should require changes only in the Version.props file. --- build/Branding.props | 2 +- build/Version.props | 18 ++++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/build/Branding.props b/build/Branding.props index 282dae5b7..a13a74294 100644 --- a/build/Branding.props +++ b/build/Branding.props @@ -1,7 +1,7 @@ cli - Microsoft .NET Core SDK 2.1.300 - Preview + Microsoft .NET Core SDK $(CliBrandingVersion) .NET Standard Support for Visual Studio 2015 Microsoft .NET Core Runtime 2.1.0 - Preview Microsoft .NET Core Host 2.1.0 - Preview diff --git a/build/Version.props b/build/Version.props index 2f23c68c8..c8dd4c795 100644 --- a/build/Version.props +++ b/build/Version.props @@ -5,18 +5,20 @@ 300 preview3 - $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix) - $(VersionMajor).$(VersionMinor).$(VersionPatch).$(CommitCount) - $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(CliVersionNoSuffix)-$(ReleaseSuffix) + $(CliVersionNoSuffix) - $(ReleaseSuffix) + $(CliVersionNoSuffix).$(CommitCount) + $(CliVersionNoSuffix) - $(ReleaseSuffix)-$(CommitCount) + $(ReleaseSuffix)-$(CommitCount) - $(VersionMajor).$(VersionMinor).$(VersionPatch)-$(ReleaseSuffix)-$(CommitCount) + $(CliVersionNoSuffix)-$(ReleaseSuffix)-$(CommitCount) - $(FullNugetVersion) - $(VersionMajor).$(VersionMinor).$(VersionPatch) + $(FullNugetVersion) + $(CliVersionNoSuffix) $(NugetVersion) - $(NugetVersion) + $(NugetVersion)