From b0c5fddc04c8a2b5803718d7906eae41923d8304 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Mon, 30 Apr 2018 17:49:09 -0700 Subject: [PATCH 1/3] Add a property to disable bundling ASP.NET Core tools, templates, and runtimes --- build/BundledDotnetTools.props | 2 +- build/BundledRuntimes.props | 16 ++++++----- build/BundledTemplates.props | 2 ++ build/MSBuildExtensions.targets | 27 ++++++++++++++++--- .../DotnetFirstTimeUseConfigurer.cs | 6 ++++- src/dotnet/AspNetCoreCertificateGenerator.cs | 5 ++-- src/dotnet/dotnet.csproj | 7 ++++- 7 files changed, 49 insertions(+), 16 deletions(-) diff --git a/build/BundledDotnetTools.props b/build/BundledDotnetTools.props index ceb89cfd2..1df3521de 100644 --- a/build/BundledDotnetTools.props +++ b/build/BundledDotnetTools.props @@ -1,5 +1,5 @@ - + diff --git a/build/BundledRuntimes.props b/build/BundledRuntimes.props index c2876983b..45234b98b 100644 --- a/build/BundledRuntimes.props +++ b/build/BundledRuntimes.props @@ -55,13 +55,6 @@ - <_DownloadAndExtractItem Include="AspNetCoreSharedFxArchiveFile" - Condition="!Exists('$(AspNetCoreSharedFxArchiveFile)') And ( '$(AspNetCoreSharedFxArchiveRid)' == 'linux-arm' OR !$(Architecture.StartsWith('arm')) )"> - $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam) - $(AspNetCoreSharedFxArchiveFile) - $(AspNetCoreSharedFxPublishDirectory) - - <_DownloadAndExtractItem Include="CombinedSharedHostAndFrameworkArchive" Condition="!Exists('$(CombinedSharedHostAndFrameworkArchive)')"> $(CoreSetupRootUrl)$(MicrosoftNETCoreAppPackageVersion)/$(CombinedFrameworkHostCompressedFileName)$(CoreSetupBlobAccessTokenParam) @@ -96,6 +89,15 @@ $(DownloadedHostFxrInstallerFile) + + + + <_DownloadAndExtractItem Include="AspNetCoreSharedFxArchiveFile" + Condition="!Exists('$(AspNetCoreSharedFxArchiveFile)') And ( '$(AspNetCoreSharedFxArchiveRid)' == 'linux-arm' OR !$(Architecture.StartsWith('arm')) )"> + $(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam) + $(AspNetCoreSharedFxArchiveFile) + $(AspNetCoreSharedFxPublishDirectory) + <_DownloadAndExtractItem Include="DownloadedAspNetCoreSharedFxInstallerFile" Condition="'$(SkipBuildingInstallers)' != 'true' AND '$(DownloadedAspNetCoreSharedFxInstallerFile)' != '' AND !Exists($(DownloadedAspNetCoreSharedFxInstallerFile)) And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))"> diff --git a/build/BundledTemplates.props b/build/BundledTemplates.props index 1a77f6043..5334a2f5b 100644 --- a/build/BundledTemplates.props +++ b/build/BundledTemplates.props @@ -3,7 +3,9 @@ + + diff --git a/build/MSBuildExtensions.targets b/build/MSBuildExtensions.targets index 67e864f1c..567c31fe4 100644 --- a/build/MSBuildExtensions.targets +++ b/build/MSBuildExtensions.targets @@ -123,7 +123,29 @@ <_AspNetCoreAppTargetFrameworkVersion>$(_AspNetCoreAllTargetFrameworkVersion) <_NETCoreSdkIsPreview Condition=" '$(DropSuffix)' == '' ">true + + + + + + + + + + + + + + + $(_NETStandardTargetFrameworkVersion) $(_NETStandardLibraryPackageVersion) $(_NETCorePlatformsPackageVersion) - $(_AspNetCoreAllTargetFrameworkVersion) - $(_AspNetCoreAllPackageVersion) - $(_AspNetCoreAppTargetFrameworkVersion) - $(_AspNetCoreAppPackageVersion) + @(BundledVersionsVariable->'<%(Identity)>%(Value)', '%0A ') $(SdkVersion) <_NETCoreSdkIsPreview>$(_NETCoreSdkIsPreview) diff --git a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs index 966bd0d80..2cb502256 100644 --- a/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs +++ b/src/Microsoft.DotNet.Configurer/DotnetFirstTimeUseConfigurer.cs @@ -90,12 +90,16 @@ namespace Microsoft.DotNet.Configurer private bool ShouldGenerateAspNetCertificate() { +#if EXCLUDE_ASPNETCORE + return false; +#else var generateAspNetCertificate = _environmentProvider.GetEnvironmentVariableAsBool("DOTNET_GENERATE_ASPNET_CERTIFICATE", true); return ShouldRunFirstRunExperience() && generateAspNetCertificate && !_aspNetCertificateSentinel.Exists(); +#endif } private bool ShouldAddPackageExecutablePath() @@ -153,7 +157,7 @@ namespace Microsoft.DotNet.Configurer private bool ShouldRunFirstRunExperience() { - var skipFirstTimeExperience = + var skipFirstTimeExperience = _environmentProvider.GetEnvironmentVariableAsBool("DOTNET_SKIP_FIRST_TIME_EXPERIENCE", false); return !skipFirstTimeExperience; diff --git a/src/dotnet/AspNetCoreCertificateGenerator.cs b/src/dotnet/AspNetCoreCertificateGenerator.cs index d0fcf0a9a..c43a8f3ff 100644 --- a/src/dotnet/AspNetCoreCertificateGenerator.cs +++ b/src/dotnet/AspNetCoreCertificateGenerator.cs @@ -1,7 +1,6 @@ // 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. -using Microsoft.AspNetCore.DeveloperCertificates.XPlat; using Microsoft.DotNet.Configurer; namespace Microsoft.DotNet.Cli @@ -10,7 +9,9 @@ namespace Microsoft.DotNet.Cli { public void GenerateAspNetCoreDevelopmentCertificate() { - CertificateGenerator.GenerateAspNetHttpsCertificate(); +#if !EXCLUDE_ASPNET + Microsoft.AspNetCore.DeveloperCertificates.XPlat.CertificateGenerator.GenerateAspNetHttpsCertificate(); +#endif } } } diff --git a/src/dotnet/dotnet.csproj b/src/dotnet/dotnet.csproj index b7d26a073..b739ba700 100644 --- a/src/dotnet/dotnet.csproj +++ b/src/dotnet/dotnet.csproj @@ -9,6 +9,7 @@ true dotnet5.4 Microsoft.DotNet.Cli + $(DefineConstants);EXCLUDE_ASPNETCORE @@ -60,7 +61,6 @@ - @@ -75,6 +75,11 @@ + + + + + From ba68037ee6e47163c281c18b28d0afc6f409bdaf Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 1 May 2018 08:49:54 -0700 Subject: [PATCH 2/3] Do not disable bundled aspnet templates See https://github.com/dotnet/source-build/issues/456#issuecomment-385677818 --- build/BundledTemplates.props | 2 -- 1 file changed, 2 deletions(-) diff --git a/build/BundledTemplates.props b/build/BundledTemplates.props index 5334a2f5b..1a77f6043 100644 --- a/build/BundledTemplates.props +++ b/build/BundledTemplates.props @@ -3,9 +3,7 @@ - - From c382932ec44c38093d8ce1bf5dfd1f21e14e1f59 Mon Sep 17 00:00:00 2001 From: Nate McMaster Date: Tue, 1 May 2018 12:41:38 -0700 Subject: [PATCH 3/3] Fix #if to match .csproj constant --- .../Microsoft.DotNet.Configurer.csproj | 3 ++- src/dotnet/AspNetCoreCertificateGenerator.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj index a393f7926..dbc6f7e6f 100644 --- a/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj +++ b/src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj @@ -9,6 +9,7 @@ true git git://github.com/dotnet/cli + $(DefineConstants);EXCLUDE_ASPNETCORE @@ -26,4 +27,4 @@ - \ No newline at end of file + diff --git a/src/dotnet/AspNetCoreCertificateGenerator.cs b/src/dotnet/AspNetCoreCertificateGenerator.cs index c43a8f3ff..17de9ebce 100644 --- a/src/dotnet/AspNetCoreCertificateGenerator.cs +++ b/src/dotnet/AspNetCoreCertificateGenerator.cs @@ -9,7 +9,7 @@ namespace Microsoft.DotNet.Cli { public void GenerateAspNetCoreDevelopmentCertificate() { -#if !EXCLUDE_ASPNET +#if !EXCLUDE_ASPNETCORE Microsoft.AspNetCore.DeveloperCertificates.XPlat.CertificateGenerator.GenerateAspNetHttpsCertificate(); #endif }