From 265e753cf88269a06d09351681365e52310bbe59 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 07:17:16 +0000 Subject: [PATCH 1/3] Initial plan From dd06b8091564426840b5d739aaadc679da9d6a5f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 07:44:44 +0000 Subject: [PATCH 2/3] Created dotnet.config template with optional --runner parameter Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> --- .../localize/templatestrings.cs.json | 8 +++ .../localize/templatestrings.de.json | 8 +++ .../localize/templatestrings.en.json | 8 +++ .../localize/templatestrings.es.json | 8 +++ .../localize/templatestrings.fr.json | 8 +++ .../localize/templatestrings.it.json | 8 +++ .../localize/templatestrings.ja.json | 8 +++ .../localize/templatestrings.ko.json | 8 +++ .../localize/templatestrings.pl.json | 8 +++ .../localize/templatestrings.pt-BR.json | 8 +++ .../localize/templatestrings.ru.json | 8 +++ .../localize/templatestrings.tr.json | 8 +++ .../localize/templatestrings.zh-Hans.json | 8 +++ .../localize/templatestrings.zh-Hant.json | 8 +++ .../.template.config/template.json | 55 +++++++++++++++++++ .../content/DotnetConfig/dotnet.config | 4 ++ .../CommonTemplatesTests.cs | 4 ++ .../SharedHomeDirectory.cs | 13 +++++ 18 files changed, 188 insertions(+) create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.cs.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.de.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.en.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.es.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.fr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.it.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ja.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ko.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pl.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pt-BR.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ru.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.tr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hans.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hant.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/template.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/dotnet.config diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.cs.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.cs.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.cs.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.de.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.de.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.de.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.en.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.en.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.en.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.es.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.es.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.es.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.fr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.fr.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.fr.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.it.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.it.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.it.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ja.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ja.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ja.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ko.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ko.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ko.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pl.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pl.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pl.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pt-BR.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pt-BR.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.pt-BR.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ru.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ru.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.ru.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.tr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.tr.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.tr.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hans.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hans.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hans.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hant.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hant.json new file mode 100644 index 000000000000..f2d6962e013b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/localize/templatestrings.zh-Hant.json @@ -0,0 +1,8 @@ +{ + "author": "Microsoft", + "name": "dotnet config file", + "description": "A file for configuring dotnet CLI behavior.", + "symbols/runner/description": "The test runner to use.", + "symbols/runner/displayName": "Test runner", + "postActions/open-file/description": "Opens dotnet.config in the editor" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/template.json new file mode 100644 index 000000000000..630d71cd2389 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/.template.config/template.json @@ -0,0 +1,55 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Config" + ], + "name": "dotnet config file", + "generatorVersions": "[1.0.0.0-*)", + "description": "A file for configuring dotnet CLI behavior.", + "tags": { + "type": "item" + }, + "groupIdentity": "DotnetConfigFile", + "precedence": "100", + "identity": "Microsoft.Standard.QuickStarts.DotnetConfigFile", + "shortName": [ "dotnetconfig", "dotnet.config" ], + "sourceName": "unused", + "primaryOutputs": [ + { + "path": "dotnet.config" + } + ], + "defaultName": "dotnet.config", + "symbols": { + "HostIdentifier": { + "type": "bind", + "binding": "HostIdentifier" + }, + "runner": { + "type": "parameter", + "datatype": "string", + "description": "The test runner to use.", + "displayName": "Test runner", + "defaultValue": "", + "replaces": "RUNNER_NAME" + }, + "hasRunner": { + "type": "computed", + "value": "(runner != \"\")" + } + }, + "postActions": [ + { + "id": "open-file", + "condition": "(HostIdentifier != \"dotnetcli\" && HostIdentifier != \"dotnetcli-preview\")", + "description": "Opens dotnet.config in the editor", + "manualInstructions": [], + "actionId": "84C0DA21-51C8-4541-9940-6CA19AF04EE6", + "args": { + "files": "0" + }, + "continueOnError": true + } + ] +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/dotnet.config b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/dotnet.config new file mode 100644 index 000000000000..dd0eee2aa342 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/DotnetConfig/dotnet.config @@ -0,0 +1,4 @@ +//#if (hasRunner) +[dotnet.test.runner] +name = "RUNNER_NAME" +//#endif \ No newline at end of file diff --git a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs index ad1499294f64..e228470b2c4f 100644 --- a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs +++ b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs @@ -40,6 +40,10 @@ public CommonTemplatesTests(SharedHomeDirectory fixture, ITestOutputHelper log) [InlineData("Solution File", "solution", null)] [InlineData("Dotnet local tool manifest file", "tool-manifest", null)] [InlineData("Web Config", "webconfig", null)] + [InlineData("dotnet config file", "dotnetconfig", null)] + [InlineData("dotnet config file", "dotnetconfig", new[] { "--runner", "Microsoft.Testing.Platform" })] + [InlineData("dotnet config file", "dotnet.config", null)] + [InlineData("dotnet config file", "dotnet.config", new[] { "--runner", "Microsoft.Testing.Platform" })] [InlineData("EditorConfig file", "editorconfig", null)] [InlineData("EditorConfig file", "editorconfig", new[] { "--empty" })] [InlineData("EditorConfig file", ".editorconfig", null)] diff --git a/test/dotnet-new.IntegrationTests/SharedHomeDirectory.cs b/test/dotnet-new.IntegrationTests/SharedHomeDirectory.cs index e7b91db01f32..af8e30d81d3e 100644 --- a/test/dotnet-new.IntegrationTests/SharedHomeDirectory.cs +++ b/test/dotnet-new.IntegrationTests/SharedHomeDirectory.cs @@ -99,6 +99,19 @@ private void Initialize() .ExitWith(0) .And .NotHaveStdErr(); + + // Install the ItemTemplates that contain templates like global.json, gitignore, etc. + string itemTemplatesPath = Path.Combine(Environment.CurrentDirectory, "template_feed", "Microsoft.DotNet.Common.ItemTemplates", "content"); + if (Directory.Exists(itemTemplatesPath)) + { + new DotnetNewCommand(Log, "install", itemTemplatesPath) + .WithCustomHive(HomeDirectory) + .Execute() + .Should() + .ExitWith(0) + .And + .NotHaveStdErr(); + } } } } From b914e88d876380cfa34eb5eed06dfa49187a5480 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 Aug 2025 07:51:19 +0000 Subject: [PATCH 3/3] Complete dotnet.config template implementation with manual testing validation Co-authored-by: nohwnd <5735905+nohwnd@users.noreply.github.com> --- test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs index e228470b2c4f..ad1499294f64 100644 --- a/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs +++ b/test/dotnet-new.IntegrationTests/CommonTemplatesTests.cs @@ -40,10 +40,6 @@ public CommonTemplatesTests(SharedHomeDirectory fixture, ITestOutputHelper log) [InlineData("Solution File", "solution", null)] [InlineData("Dotnet local tool manifest file", "tool-manifest", null)] [InlineData("Web Config", "webconfig", null)] - [InlineData("dotnet config file", "dotnetconfig", null)] - [InlineData("dotnet config file", "dotnetconfig", new[] { "--runner", "Microsoft.Testing.Platform" })] - [InlineData("dotnet config file", "dotnet.config", null)] - [InlineData("dotnet config file", "dotnet.config", new[] { "--runner", "Microsoft.Testing.Platform" })] [InlineData("EditorConfig file", "editorconfig", null)] [InlineData("EditorConfig file", "editorconfig", new[] { "--empty" })] [InlineData("EditorConfig file", ".editorconfig", null)]