Addressing code review comments and adding a DOTNET_SKIP_FIRST_TIME_EXPERIENCE env variable to have a way to turn off the feature.

This commit is contained in:
Livar Cunha 2016-06-10 13:02:48 -07:00
parent 4d631cc1b1
commit ed7e583ab6
8 changed files with 91 additions and 51 deletions

View file

@ -55,10 +55,10 @@ namespace Microsoft.DotNet.Cli
try
{
ConfigureDotNetForFirstTimeUse();
using (PerfTrace.Current.CaptureTiming())
{
ConfigureDotNetForFirstTimeUse();
return ProcessArgs(args, new Telemetry());
}
}
@ -162,15 +162,23 @@ namespace Microsoft.DotNet.Cli
private static void ConfigureDotNetForFirstTimeUse()
{
using (var nugetPackagesArchiver = new NuGetPackagesArchiver())
using (PerfTrace.Current.CaptureTiming())
{
var nugetCacheSentinel = new NuGetCacheSentinel();
var commandFactory = new DotNetCommandFactory();
var nugetCachePrimer = new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(nugetCachePrimer, nugetCacheSentinel);
using (var nugetPackagesArchiver = new NuGetPackagesArchiver())
{
var environmentProvider = new EnvironmentProvider();
var nugetCacheSentinel = new NuGetCacheSentinel();
var commandFactory = new DotNetCommandFactory();
var nugetCachePrimer =
new NuGetCachePrimer(commandFactory, nugetPackagesArchiver, nugetCacheSentinel);
var dotnetConfigurer = new DotnetFirstTimeUseConfigurer(
nugetCachePrimer,
nugetCacheSentinel,
environmentProvider);
dotnetConfigurer.Configure();
}
dotnetConfigurer.Configure();
}
}
}
private static void InitializeProcess()