Skip to content

Commit

Permalink
Merge pull request #12424 from rainersigwald/merge-3.1
Browse files Browse the repository at this point in the history
Merge 3.1.4xx branches to 5.0.100/master
  • Loading branch information
rainersigwald authored Jul 20, 2020
2 parents fb52d59 + 1a8a8a3 commit 2e12384
Show file tree
Hide file tree
Showing 13 changed files with 166 additions and 57 deletions.
4 changes: 2 additions & 2 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
<Uri>https://github.com/dotnet/fsharp</Uri>
<Sha>66042d33b998a180edbd99af6064da85f8977bf3</Sha>
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.7.0-5.20365.2">
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="3.7.0-5.20367.1">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>598796cd274b852b5be35398133516e19f543744</Sha>
<Sha>f96dcbb6597fcc801970ee09688e733b64ce9040</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.DeveloperCertificates.XPlat" Version="5.0.0-rc.1.20367.16">
<Uri>https://github.com/dotnet/aspnetcore</Uri>
Expand Down
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/dotnet/roslyn -->
<MicrosoftNetCompilersToolsetPackageVersion>3.7.0-5.20365.2</MicrosoftNetCompilersToolsetPackageVersion>
<MicrosoftNetCompilersToolsetPackageVersion>3.7.0-5.20367.1</MicrosoftNetCompilersToolsetPackageVersion>
</PropertyGroup>
<PropertyGroup>
<!-- Dependencies from https://github.com/aspnet/AspNetCore -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ public class DotnetFirstRunConfiguration
public bool GenerateAspNetCertificate { get; }

public bool TelemetryOptout { get; }

public bool AddGlobalToolsToPath { get; }

public bool NoLogo { get; }

public DotnetFirstRunConfiguration(
bool generateAspNetCertificate,
bool telemetryOptout,
bool addGlobalToolsToPath)
bool addGlobalToolsToPath,
bool nologo)
{
GenerateAspNetCertificate = generateAspNetCertificate;
TelemetryOptout = telemetryOptout;
AddGlobalToolsToPath = addGlobalToolsToPath;
NoLogo = nologo;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,17 @@ public void Configure()

if (ShouldPrintFirstTimeUseNotice())
{
PrintFirstTimeMessageWelcome();
if (ShouldPrintTelemetryMessageWhenFirstTimeUseNoticeIsEnabled())
if (!_dotnetFirstRunConfiguration.NoLogo)
{
PrintTelemetryMessage();
PrintFirstTimeMessageWelcome();
if (ShouldPrintTelemetryMessageWhenFirstTimeUseNoticeIsEnabled())
{
PrintTelemetryMessage();
}

PrintFirstTimeMessageMoreInformation();
}

PrintFirstTimeMessageMoreInformation();
_firstTimeUseNoticeSentinel.CreateIfNotExists();
}

Expand Down
7 changes: 5 additions & 2 deletions src/Cli/dotnet/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ internal static int ProcessArgs(string[] args, ITelemetry telemetryClient = null
environmentProvider.GetEnvironmentVariableAsBool("DOTNET_CLI_TELEMETRY_OPTOUT", defaultValue: false);
bool addGlobalToolsToPath =
environmentProvider.GetEnvironmentVariableAsBool("DOTNET_ADD_GLOBAL_TOOLS_TO_PATH", defaultValue: true);
bool nologo =
environmentProvider.GetEnvironmentVariableAsBool("DOTNET_NOLOGO", defaultValue: false);

ReportDotnetHomeUsage(environmentProvider);

Expand All @@ -158,13 +160,14 @@ internal static int ProcessArgs(string[] args, ITelemetry telemetryClient = null
aspNetCertificateSentinel = new NoOpAspNetCertificateSentinel();
firstTimeUseNoticeSentinel = new NoOpFirstTimeUseNoticeSentinel();
toolPathSentinel = new NoOpFileSentinel(exists: false);
isDotnetBeingInvokedFromNativeInstaller = true;
isDotnetBeingInvokedFromNativeInstaller = true;
}

var dotnetFirstRunConfiguration = new DotnetFirstRunConfiguration(
generateAspNetCertificate: generateAspNetCertificate,
telemetryOptout: telemetryOptout,
addGlobalToolsToPath: addGlobalToolsToPath);
addGlobalToolsToPath: addGlobalToolsToPath,
nologo: nologo);

ConfigureDotNetForFirstTimeUse(
firstTimeUseNoticeSentinel,
Expand Down
3 changes: 2 additions & 1 deletion src/Cli/dotnet/commands/dotnet-nuget/NuGetCommandParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ public static Command NuGet() =>
Create.Option("-d|--disable-buffering", Parser.CompletionOnlyDescription),
Create.Option("-n|--no-symbols", Parser.CompletionOnlyDescription),
Create.Option("--no-service-endpoint", Parser.CompletionOnlyDescription),
Create.Option("--interactive", Parser.CompletionOnlyDescription)
Create.Option("--interactive", Parser.CompletionOnlyDescription),
Create.Option("--skip-duplicate", Parser.CompletionOnlyDescription)
));
}
}
2 changes: 1 addition & 1 deletion src/Layout/redist/minimumMSBuildVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.5.0
16.7.0
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<WarningsAsErrors>true</WarningsAsErrors>
<StrongNameKeyId>MicrosoftAspNetCore</StrongNameKeyId>
<IsPackable>true</IsPackable>
<!-- Create FileDefinitions items for ResolveHostfxrCopyLocalContent target -->
<EmitLegacyAssetsFileItems>true</EmitLegacyAssetsFileItems>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ Copyright (c) .NET Foundation. All rights reserved.
_ComputeResolvedFilesToPublishTypes
Splits ResolvedFileToPublish items into 'PreserveNewest' and 'Always' buckets.
Then further splits those into 'Unbundled' buckets based on the single file setting.
============================================================
-->
<Target Name="_ComputeResolvedFilesToPublishTypes">
Expand All @@ -461,6 +462,19 @@ Copyright (c) .NET Foundation. All rights reserved.
<_ResolvedFileToPublishAlways Include="@(ResolvedFileToPublish)"
Condition="'%(ResolvedFileToPublish.CopyToPublishDirectory)'=='Always'" />
</ItemGroup>

<ItemGroup>

<_ResolvedUnbundledFileToPublishPreserveNewest
Include="@(_ResolvedFileToPublishPreserveNewest)"
Condition="'$(PublishSingleFile)' != 'true' or
'%(_ResolvedFileToPublishPreserveNewest.ExcludeFromSingleFile)'=='true'" />

<_ResolvedUnbundledFileToPublishAlways
Include="@(_ResolvedFileToPublishAlways)"
Condition="'$(PublishSingleFile)' != 'true' or
'%(_ResolvedFileToPublishAlways.ExcludeFromSingleFile)'=='true'" />
</ItemGroup>
</Target>

<!--
Expand Down Expand Up @@ -541,7 +555,7 @@ Copyright (c) .NET Foundation. All rights reserved.

<!-- Copy generated COM References. -->
<ResolvedFileToPublish Include="@(ReferenceComWrappersToCopyLocal)">
<RelativePath>@(ReferenceComWrappersToCopyLocal->'%(Filename)%(Extension)')</RelativePath>
<RelativePath>%(Filename)%(Extension)</RelativePath>
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</ResolvedFileToPublish>

Expand Down Expand Up @@ -1112,7 +1126,7 @@ Copyright (c) .NET Foundation. All rights reserved.
============================================================
ComputeFilesCopiedToPublishDir
Gathers all the files that were copied to the publish directory. This is used by wapproj and is required for back compat.
Gathers all the files that will be copied to the publish directory. This is used by wapproj and is required for back compat.
============================================================
-->
<Target Name="ComputeFilesCopiedToPublishDir"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public void It_does_not_print_the_first_time_use_notice_if_the_sentinel_exists()
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -72,7 +73,8 @@ public void It_prints_the_telemetry_if_the_sentinel_does_not_exist()
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -98,7 +100,8 @@ public void It_adds_the_tool_path_to_the_environment_if_the_tool_path_sentinel_d
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -124,7 +127,8 @@ public void It_does_not_add_the_tool_path_to_the_environment_if_the_tool_path_se
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -150,7 +154,8 @@ public void It_does_not_generate_the_aspnet_https_development_certificate_if_the
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -175,7 +180,8 @@ public void It_does_not_generate_the_aspnet_https_development_certificate_when_t
(
generateAspNetCertificate: false,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -200,7 +206,8 @@ public void It_generates_the_aspnet_https_development_certificate_if_the_sentine
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -224,7 +231,8 @@ public void It_adds_the_tool_path_to_the_environment_if_addGlobalToolsToPath_is_
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: true
addGlobalToolsToPath: true,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand All @@ -247,7 +255,8 @@ public void It_does_not_add_the_tool_path_to_the_environment_if_addGlobalToolsTo
(
generateAspNetCertificate: true,
telemetryOptout: false,
addGlobalToolsToPath: false
addGlobalToolsToPath: false,
nologo: false
),
_reporterMock.Object,
CliFallbackFolderPath,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,27 @@ private void ResetObjectState()
}

[Theory]
[InlineData(false, false, false, Never, FirstRun, FirstRun, true, true)]
[InlineData(true, false, false, FirstRun, FirstRun, FirstRun, true, true)]
[InlineData(false, true, false, Never, FirstRun, Never, false, false)]
[InlineData(true, true, false, FirstRun, FirstRun, Never, false, false)]
[InlineData(false, false, true, Never, SecondRun, SecondRun, true, true)]
[InlineData(true, false, true, SecondRun, SecondRun, SecondRun, true, true)]
[InlineData(false, true, true, Never, SecondRun, Never, false, false)]
[InlineData(true, true, true, SecondRun, SecondRun, Never, false, false)]
[InlineData(false, false, false, false, Never, FirstRun, FirstRun, true, true)]
[InlineData(true, false, false, false, FirstRun, FirstRun, FirstRun, true, true)]
[InlineData(false, true, false, false, Never, FirstRun, Never, false, false)]
[InlineData(true, true, false, false, FirstRun, FirstRun, Never, false, false)]
[InlineData(false, false, true, false, Never, Never, Never, true, true)]
[InlineData(true, false, true, false, FirstRun, Never, Never, true, true)]
[InlineData(false, true, true, false, Never, Never, Never, false, false)]
[InlineData(true, true, true, false, FirstRun, Never, Never, false, false)]
[InlineData(false, false, false, true, Never, SecondRun, SecondRun, true, true)]
[InlineData(true, false, false, true, SecondRun, SecondRun, SecondRun, true, true)]
[InlineData(false, true, false, true, Never, SecondRun, Never, false, false)]
[InlineData(true, true, false, true, SecondRun, SecondRun, Never, false, false)]
[InlineData(false, false, true, true, Never, Never, Never, true, true)]
[InlineData(true, false, true, true, SecondRun, Never, Never, true, true)]
[InlineData(false, true, true, true, Never, Never, Never, false, false)]
[InlineData(true, true, true, true, SecondRun, Never, Never, false, false)]
public void FlagsCombinationAndAction(
// Inputs
bool DOTNET_GENERATE_ASPNET_CERTIFICATE,
bool DOTNET_CLI_TELEMETRY_OPTOUT,
bool DOTNET_NOLOGO,
// true to simulate install via installer. The first run is during installer,
// silent but has sudo permission
// false to simulate install via zip/tar.gz
Expand All @@ -75,11 +84,14 @@ bool telemetrySecondRunShouldBeEnabled
ResetObjectState();

_environmentProvider
.Setup(p => p.GetEnvironmentVariableAsBool("DOTNET_GENERATE_ASPNET_CERTIFICATE", It.IsAny<bool>()))
.Returns(DOTNET_GENERATE_ASPNET_CERTIFICATE);
.Setup(p => p.GetEnvironmentVariableAsBool("DOTNET_GENERATE_ASPNET_CERTIFICATE", It.IsAny<bool>()))
.Returns(DOTNET_GENERATE_ASPNET_CERTIFICATE);
_environmentProvider
.Setup(p => p.GetEnvironmentVariableAsBool("DOTNET_CLI_TELEMETRY_OPTOUT", It.IsAny<bool>()))
.Returns(DOTNET_CLI_TELEMETRY_OPTOUT);
_environmentProvider
.Setup(p => p.GetEnvironmentVariableAsBool("DOTNET_NOLOGO", It.IsAny<bool>()))
.Returns(DOTNET_NOLOGO);
_environmentProvider
.Setup(p => p.GetEnvironmentVariableAsBool("DOTNET_ADD_GLOBAL_TOOLS_TO_PATH", It.IsAny<bool>()))
.Returns(true);
Expand Down Expand Up @@ -206,6 +218,8 @@ private Telemetry RunConfigUsingMocks(bool isInstallerRun)
_environmentProviderObject.GetEnvironmentVariableAsBool("DOTNET_CLI_TELEMETRY_OPTOUT", false);
bool addGlobalToolsToPath =
_environmentProviderObject.GetEnvironmentVariableAsBool("DOTNET_ADD_GLOBAL_TOOLS_TO_PATH", defaultValue: true);
bool nologo =
_environmentProviderObject.GetEnvironmentVariableAsBool("DOTNET_NOLOGO", defaultValue: false);

IAspNetCertificateSentinel aspNetCertificateSentinel;
IFirstTimeUseNoticeSentinel firstTimeUseNoticeSentinel;
Expand Down Expand Up @@ -233,7 +247,8 @@ private Telemetry RunConfigUsingMocks(bool isInstallerRun)
(
generateAspNetCertificate: generateAspNetCertificate,
telemetryOptout: telemetryOptout,
addGlobalToolsToPath: addGlobalToolsToPath
addGlobalToolsToPath: addGlobalToolsToPath,
nologo: nologo
),
reporter: _reporterMock,
cliFallbackFolderPath: CliFallbackFolderPath,
Expand Down
Loading

0 comments on commit 2e12384

Please sign in to comment.