Merge pull request #9178 from natemcmaster/namc/disable-aspnet

Add a property to disable bundling ASP.NET Core tools and runtimes
This commit is contained in:
Livar 2018-05-01 15:56:32 -07:00 committed by GitHub
commit f87c6e7d11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 49 additions and 17 deletions

View file

@ -1,5 +1,5 @@
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ItemGroup Condition=" '$(IncludeAspNetCoreRuntime)' != 'false' ">
<BundledDotnetTools Include="dotnet-dev-certs" Version="$(AspNetCoreVersion)" />
<BundledDotnetTools Include="dotnet-ef" Version="$(AspNetCoreVersion)" ObsoletesCliTool="Microsoft.EntityFrameworkCore.Tools.DotNet" />
<BundledDotnetTools Include="dotnet-sql-cache" Version="$(AspNetCoreVersion)" ObsoletesCliTool="Microsoft.Extensions.Caching.SqlConfig.Tools" />

View file

@ -55,13 +55,6 @@
</PropertyGroup>
<ItemGroup>
<_DownloadAndExtractItem Include="AspNetCoreSharedFxArchiveFile"
Condition="!Exists('$(AspNetCoreSharedFxArchiveFile)') And ( '$(AspNetCoreSharedFxArchiveRid)' == 'linux-arm' OR !$(Architecture.StartsWith('arm')) )">
<Url>$(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam)</Url>
<DownloadFileName>$(AspNetCoreSharedFxArchiveFile)</DownloadFileName>
<ExtractDestination>$(AspNetCoreSharedFxPublishDirectory)</ExtractDestination>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="CombinedSharedHostAndFrameworkArchive"
Condition="!Exists('$(CombinedSharedHostAndFrameworkArchive)')">
<Url>$(CoreSetupRootUrl)$(MicrosoftNETCoreAppPackageVersion)/$(CombinedFrameworkHostCompressedFileName)$(CoreSetupBlobAccessTokenParam)</Url>
@ -96,6 +89,15 @@
<DownloadFileName>$(DownloadedHostFxrInstallerFile)</DownloadFileName>
<ExtractDestination></ExtractDestination>
</_DownloadAndExtractItem>
</ItemGroup>
<ItemGroup Condition=" '$(IncludeAspNetCoreRuntime)' != 'false' ">
<_DownloadAndExtractItem Include="AspNetCoreSharedFxArchiveFile"
Condition="!Exists('$(AspNetCoreSharedFxArchiveFile)') And ( '$(AspNetCoreSharedFxArchiveRid)' == 'linux-arm' OR !$(Architecture.StartsWith('arm')) )">
<Url>$(AspNetCoreSharedFxRootUrl)$(AspNetCoreVersion)/$(AspNetCoreSharedFxArchiveFileName)$(CoreSetupBlobAccessTokenParam)</Url>
<DownloadFileName>$(AspNetCoreSharedFxArchiveFile)</DownloadFileName>
<ExtractDestination>$(AspNetCoreSharedFxPublishDirectory)</ExtractDestination>
</_DownloadAndExtractItem>
<_DownloadAndExtractItem Include="DownloadedAspNetCoreSharedFxInstallerFile"
Condition="'$(SkipBuildingInstallers)' != 'true' AND '$(DownloadedAspNetCoreSharedFxInstallerFile)' != '' AND !Exists($(DownloadedAspNetCoreSharedFxInstallerFile)) And '$(InstallerExtension)' != '' And !$(Architecture.StartsWith('arm'))">

View file

@ -123,7 +123,29 @@
<_AspNetCoreAppTargetFrameworkVersion>$(_AspNetCoreAllTargetFrameworkVersion)</_AspNetCoreAppTargetFrameworkVersion>
<_NETCoreSdkIsPreview Condition=" '$(DropSuffix)' == '' ">true</_NETCoreSdkIsPreview>
</PropertyGroup>
<ItemGroup>
<BundledVersionsVariable Include="BundledAspNetCoreAllTargetFrameworkVersion" Value="$(_AspNetCoreAllTargetFrameworkVersion)" />
<BundledVersionsVariable Include="BundledAspNetCoreAllPackageVersion" Value="$(_AspNetCoreAllPackageVersion)" />
<BundledVersionsVariable Include="BundledAspNetCoreAppTargetFrameworkVersion" Value="$(_AspNetCoreAppTargetFrameworkVersion)" />
<BundledVersionsVariable Include="BundledAspNetCoreAppPackageVersion" Value="$(_AspNetCoreAppPackageVersion)" />
</ItemGroup>
<ItemGroup Condition=" '$(IncludeAspNetCoreRuntime)' == 'false' ">
<!--
These properties indicate that the ASP.NET Core shared runtime is not bundled on this platform, so the SDK should not
treat these packages as the 'platform' base.
The bundled aspnet packages versions should still be set, however, so the default, version-less PackageReference
still works.
See also https://github.com/aspnet/Universe/pull/1130.
-->
<BundledVersionsVariable Include="_AspNetCoreAppSharedFxIsEnabled" Value="false" />
<BundledVersionsVariable Include="_AspNetCoreAllSharedFxIsEnabled" Value="false" />
</ItemGroup>
<PropertyGroup>
<BundledVersionsPropsContent>
<![CDATA[
<!--
@ -144,10 +166,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<BundledNETStandardTargetFrameworkVersion>$(_NETStandardTargetFrameworkVersion)</BundledNETStandardTargetFrameworkVersion>
<BundledNETStandardPackageVersion>$(_NETStandardLibraryPackageVersion)</BundledNETStandardPackageVersion>
<BundledNETCorePlatformsPackageVersion>$(_NETCorePlatformsPackageVersion)</BundledNETCorePlatformsPackageVersion>
<BundledAspNetCoreAllTargetFrameworkVersion>$(_AspNetCoreAllTargetFrameworkVersion)</BundledAspNetCoreAllTargetFrameworkVersion>
<BundledAspNetCoreAllPackageVersion>$(_AspNetCoreAllPackageVersion)</BundledAspNetCoreAllPackageVersion>
<BundledAspNetCoreAppTargetFrameworkVersion>$(_AspNetCoreAppTargetFrameworkVersion)</BundledAspNetCoreAppTargetFrameworkVersion>
<BundledAspNetCoreAppPackageVersion>$(_AspNetCoreAppPackageVersion)</BundledAspNetCoreAppPackageVersion>
@(BundledVersionsVariable->'<%(Identity)>%(Value)</%(Identity)>', '%0A ')
<NETCoreSdkVersion>$(SdkVersion)</NETCoreSdkVersion>
<_NETCoreSdkIsPreview>$(_NETCoreSdkIsPreview)</_NETCoreSdkIsPreview>

View file

@ -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;

View file

@ -9,6 +9,7 @@
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/dotnet/cli</RepositoryUrl>
<DefineConstants Condition="'$(IncludeAspNetCoreRuntime)' == 'false'">$(DefineConstants);EXCLUDE_ASPNETCORE</DefineConstants>
</PropertyGroup>
<ItemGroup>
@ -26,4 +27,4 @@
<ProjectReference Include="..\Microsoft.DotNet.InternalAbstractions\Microsoft.DotNet.InternalAbstractions.csproj" />
<ProjectReference Include="..\Microsoft.DotNet.Cli.Utils\Microsoft.DotNet.Cli.Utils.csproj" />
</ItemGroup>
</Project>
</Project>

View file

@ -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_ASPNETCORE
Microsoft.AspNetCore.DeveloperCertificates.XPlat.CertificateGenerator.GenerateAspNetHttpsCertificate();
#endif
}
}
}

View file

@ -9,6 +9,7 @@
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<AssetTargetFallback>dotnet5.4</AssetTargetFallback>
<RootNamespace>Microsoft.DotNet.Cli</RootNamespace>
<DefineConstants Condition="'$(IncludeAspNetCoreRuntime)' == 'false'">$(DefineConstants);EXCLUDE_ASPNETCORE</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Compile Remove="commands\dotnet-new\**" />
@ -60,7 +61,6 @@
<PackageReference Include="System.Diagnostics.TextWriterTraceListener" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Primitives" Version="4.3.0" />
<PackageReference Include="System.Private.DataContractSerialization" Version="4.3.0" />
<PackageReference Include="Microsoft.AspNetCore.DeveloperCertificates.XPlat" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.3.0" />
<PackageReference Include="Microsoft.Build" Version="$(MicrosoftBuildPackageVersion)" />
<PackageReference Include="Microsoft.DotNet.PlatformAbstractions" Version="$(MicrosoftDotNetPlatformAbstractionsPackageVersion)" />
@ -75,6 +75,11 @@
<PackageReference Include="Microsoft.DotNet.Archive" Version="$(MicrosoftDotNetArchivePackageVersion)" />
<PackageReference Include="XliffTasks" Version="$(XliffTasksPackageVersion)" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition=" '$(IncludeAspNetCoreRuntime)' != 'false' ">
<PackageReference Include="Microsoft.AspNetCore.DeveloperCertificates.XPlat" Version="$(AspNetCoreVersion)" />
</ItemGroup>
<ItemGroup>
<Folder Include="commands\dotnet-migrate\xlf" />
<Folder Include="dotnet-complete\commands\" />