From 0dd4f123d2245ab552e44cf783b54145140d5f4d Mon Sep 17 00:00:00 2001 From: Mike Lorbetske Date: Thu, 29 Jun 2017 19:08:33 -0700 Subject: [PATCH 1/6] Update Template Engine and templates for 1.x --- ...rosoft.DotNet.Cli.DependencyVersions.props | 4 +-- src/dotnet/Program.cs | 1 + .../commands/dotnet-new/NewCommandShim.cs | 29 +++++++------------ test/dotnet-new.Tests/NewCommandTests.cs | 4 +-- ...atTheUserIsRunningDotNetForTheFirstTime.cs | 1 - 5 files changed, 15 insertions(+), 24 deletions(-) diff --git a/build/Microsoft.DotNet.Cli.DependencyVersions.props b/build/Microsoft.DotNet.Cli.DependencyVersions.props index fa216040c..f7d5d560f 100644 --- a/build/Microsoft.DotNet.Cli.DependencyVersions.props +++ b/build/Microsoft.DotNet.Cli.DependencyVersions.props @@ -9,8 +9,8 @@ 4.3.0-preview3-4168 1.0.0-alpha-20170516-2-509 15.0.0 - 1.0.0-beta1-20170202-111 - 1.0.0-beta1-20170427-174 + 1.0.0-beta2-20170629-269 + 1.0.0-beta2-20170629-269 1.0.3 1.0.3 diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs index 63119cdba..de3736386 100644 --- a/src/dotnet/Program.cs +++ b/src/dotnet/Program.cs @@ -28,6 +28,7 @@ using Microsoft.DotNet.Tools.Sln; using Microsoft.DotNet.Tools.Test; using Microsoft.DotNet.Tools.VSTest; using NuGet.Frameworks; +using Command = Microsoft.DotNet.Cli.Utils.Command; namespace Microsoft.DotNet.Cli { diff --git a/src/dotnet/commands/dotnet-new/NewCommandShim.cs b/src/dotnet/commands/dotnet-new/NewCommandShim.cs index e979ecb74..52c94239b 100644 --- a/src/dotnet/commands/dotnet-new/NewCommandShim.cs +++ b/src/dotnet/commands/dotnet-new/NewCommandShim.cs @@ -6,8 +6,11 @@ using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; -using System.Runtime.CompilerServices; +using System.Reflection; +using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Configurer; +using Microsoft.DotNet.Tools.MSBuild; using Microsoft.TemplateEngine.Abstractions; using Microsoft.TemplateEngine.Cli; using Microsoft.TemplateEngine.Edge; @@ -25,29 +28,17 @@ namespace Microsoft.DotNet.Tools.New public static int Run(string[] args) { - return New3Command.Run(CommandName, CreateHost(), FirstRun, args); + var logger = new TelemetryLogger(null); + return New3Command.Run(CommandName, CreateHost(), logger, FirstRun, args); } private static ITemplateEngineHost CreateHost() { - var builtIns = new Dictionary> + var builtIns = new AssemblyComponentCatalog(new[] { - { new Guid("0C434DF7-E2CB-4DEE-B216-D7C58C8EB4B3"), () => typeof(RunnableProjectGenerator) }, - { new Guid("3147965A-08E5-4523-B869-02C8E9A8AAA1"), () => typeof(BalancedNestingConfig) }, - { new Guid("3E8BCBF0-D631-45BA-A12D-FBF1DE03AA38"), () => typeof(ConditionalConfig) }, - { new Guid("A1E27A4B-9608-47F1-B3B8-F70DF62DC521"), () => typeof(FlagsConfig) }, - { new Guid("3FAE1942-7257-4247-B44D-2DDE07CB4A4A"), () => typeof(IncludeConfig) }, - { new Guid("3D33B3BF-F40E-43EB-A14D-F40516F880CD"), () => typeof(RegionConfig) }, - { new Guid("62DB7F1F-A10E-46F0-953F-A28A03A81CD1"), () => typeof(ReplacementConfig) }, - { new Guid("370996FE-2943-4AED-B2F6-EC03F0B75B4A"), () => typeof(ConstantMacro) }, - { new Guid("BB625F71-6404-4550-98AF-B2E546F46C5F"), () => typeof(EvaluateMacro) }, - { new Guid("10919008-4E13-4FA8-825C-3B4DA855578E"), () => typeof(GuidMacro) }, - { new Guid("F2B423D7-3C23-4489-816A-41D8D2A98596"), () => typeof(NowMacro) }, - { new Guid("011E8DC1-8544-4360-9B40-65FD916049B7"), () => typeof(RandomMacro) }, - { new Guid("8A4D4937-E23F-426D-8398-3BDBD1873ADB"), () => typeof(RegexMacro) }, - { new Guid("B57D64E0-9B4F-4ABE-9366-711170FD5294"), () => typeof(SwitchMacro) }, - { new Guid("10919118-4E13-4FA9-825C-3B4DA855578E"), () => typeof(CaseChangeMacro) } - }.ToList(); + typeof(RunnableProjectGenerator).GetTypeInfo().Assembly, + typeof(ConditionalConfig).GetTypeInfo().Assembly, + }); var preferences = new Dictionary { diff --git a/test/dotnet-new.Tests/NewCommandTests.cs b/test/dotnet-new.Tests/NewCommandTests.cs index 4a9c7d115..45eccf5c7 100644 --- a/test/dotnet-new.Tests/NewCommandTests.cs +++ b/test/dotnet-new.Tests/NewCommandTests.cs @@ -16,7 +16,7 @@ namespace Microsoft.DotNet.New.Tests cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().StartWith("No templates matched the input template name: [Web1.1]"); + cmd.StdErr.Should().StartWith("No templates matched the input template name: Web1.1."); } [Fact] @@ -26,7 +26,7 @@ namespace Microsoft.DotNet.New.Tests cmd.ExitCode.Should().NotBe(0); - cmd.StdErr.Should().StartWith("Unable to determine the desired template from the input template name: [c]"); + cmd.StdErr.Should().StartWith("Unable to determine the desired template from the input template name: c."); } } } diff --git a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs index 273d4fd21..1f352ec38 100644 --- a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs +++ b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs @@ -105,7 +105,6 @@ A command is running to initially populate your local package cache, to improve "microsoft.extensions.logging.console", "microsoft.extensions.logging.debug", "microsoft.extensions.options.configurationextensions", - "microsoft.visualstudio.web.browserlink", }; _nugetCacheFolder From 4454c4e19133007c8072067e8b418f86d00d6f9d Mon Sep 17 00:00:00 2001 From: Livar Date: Fri, 30 Jun 2017 10:15:07 -0700 Subject: [PATCH 2/6] Update the SDK to 1.1.0-alpha-20170630-2 This SDK contains the F# targets. --- build/Microsoft.DotNet.Cli.DependencyVersions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Microsoft.DotNet.Cli.DependencyVersions.props b/build/Microsoft.DotNet.Cli.DependencyVersions.props index f7d5d560f..b9516fa31 100644 --- a/build/Microsoft.DotNet.Cli.DependencyVersions.props +++ b/build/Microsoft.DotNet.Cli.DependencyVersions.props @@ -5,7 +5,7 @@ 15.3.0-preview-000402-01 2.3.0-beta3-61816-04 4.2.0-rc-170621-0 - 1.1.0-alpha-20170615-3 + 1.1.0-alpha-20170630-2 4.3.0-preview3-4168 1.0.0-alpha-20170516-2-509 15.0.0 From 47ef990e66c5d97219c9334f579a9102bad95ddc Mon Sep 17 00:00:00 2001 From: Kevin Ransom Date: Fri, 30 Jun 2017 11:58:16 -0700 Subject: [PATCH 3/6] chmod .sh files --- build/Microsoft.DotNet.Cli.Compile.targets | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets index a5a3a67a3..954b23ee6 100644 --- a/build/Microsoft.DotNet.Cli.Compile.targets +++ b/build/Microsoft.DotNet.Cli.Compile.targets @@ -226,6 +226,15 @@ u=rwx,g=rx,o=rx + + 755 + + + 755 + + + 755 + Date: Fri, 30 Jun 2017 12:03:04 -0700 Subject: [PATCH 4/6] Copy Paste error --- build/Microsoft.DotNet.Cli.Compile.targets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Microsoft.DotNet.Cli.Compile.targets b/build/Microsoft.DotNet.Cli.Compile.targets index 954b23ee6..804db01f2 100644 --- a/build/Microsoft.DotNet.Cli.Compile.targets +++ b/build/Microsoft.DotNet.Cli.Compile.targets @@ -232,7 +232,7 @@ 755 - + 755 From 207a7e4307924b55d958a4166380918e5f13a8d6 Mon Sep 17 00:00:00 2001 From: Zhi Li Date: Fri, 30 Jun 2017 14:25:46 -0700 Subject: [PATCH 5/6] update nuget to 4.3.0-preview4-4258 --- build/Microsoft.DotNet.Cli.DependencyVersions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Microsoft.DotNet.Cli.DependencyVersions.props b/build/Microsoft.DotNet.Cli.DependencyVersions.props index fa216040c..a4d674c7e 100644 --- a/build/Microsoft.DotNet.Cli.DependencyVersions.props +++ b/build/Microsoft.DotNet.Cli.DependencyVersions.props @@ -6,7 +6,7 @@ 2.3.0-beta3-61816-04 4.2.0-rc-170621-0 1.1.0-alpha-20170615-3 - 4.3.0-preview3-4168 + 4.3.0-preview4-4258 1.0.0-alpha-20170516-2-509 15.0.0 1.0.0-beta1-20170202-111 From cb9290e3a3f4c9d9518da1e8e136ada4bc9925bb Mon Sep 17 00:00:00 2001 From: Ashley Hauck Date: Thu, 6 Jul 2017 08:30:32 -0700 Subject: [PATCH 6/6] Update Roslyn to 2.3.0-beta4-61830-03 --- build/Microsoft.DotNet.Cli.DependencyVersions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/Microsoft.DotNet.Cli.DependencyVersions.props b/build/Microsoft.DotNet.Cli.DependencyVersions.props index 3343c25bf..7e1a4b2e7 100644 --- a/build/Microsoft.DotNet.Cli.DependencyVersions.props +++ b/build/Microsoft.DotNet.Cli.DependencyVersions.props @@ -3,7 +3,7 @@ 1.1.2 15.3.0-preview-000402-01 - 2.3.0-beta3-61816-04 + 2.3.0-beta4-61830-03 4.2.0-rc-170630-0 1.1.0-alpha-20170630-2 4.3.0-preview3-4168