From 70659385155a789dfc6d70e3f4fad27d4211fb60 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Wed, 21 Dec 2022 12:30:28 +0100 Subject: [PATCH 01/16] add class templates --- .../localize/templatestrings.cs.json | 5 + .../localize/templatestrings.de.json | 5 + .../localize/templatestrings.en.json | 5 + .../localize/templatestrings.es.json | 5 + .../localize/templatestrings.fr.json | 5 + .../localize/templatestrings.it.json | 5 + .../localize/templatestrings.ja.json | 5 + .../localize/templatestrings.ko.json | 5 + .../localize/templatestrings.pl.json | 5 + .../localize/templatestrings.pt-BR.json | 5 + .../localize/templatestrings.ru.json | 5 + .../localize/templatestrings.tr.json | 5 + .../localize/templatestrings.zh-Hans.json | 5 + .../localize/templatestrings.zh-Hant.json | 5 + .../.template.config/template.json | 75 +++++++++++++++ .../content/Class-CSharp/Class1.cs | 19 ++++ .../localize/templatestrings.cs.json | 5 + .../localize/templatestrings.de.json | 5 + .../localize/templatestrings.en.json | 5 + .../localize/templatestrings.es.json | 5 + .../localize/templatestrings.fr.json | 5 + .../localize/templatestrings.it.json | 5 + .../localize/templatestrings.ja.json | 5 + .../localize/templatestrings.ko.json | 5 + .../localize/templatestrings.pl.json | 5 + .../localize/templatestrings.pt-BR.json | 5 + .../localize/templatestrings.ru.json | 5 + .../localize/templatestrings.tr.json | 5 + .../localize/templatestrings.zh-Hans.json | 5 + .../localize/templatestrings.zh-Hant.json | 5 + .../.template.config/template.json | 71 ++++++++++++++ .../content/Enum-CSharp/Class1.cs | 15 +++ .../localize/templatestrings.cs.json | 5 + .../localize/templatestrings.de.json | 5 + .../localize/templatestrings.en.json | 5 + .../localize/templatestrings.es.json | 5 + .../localize/templatestrings.fr.json | 5 + .../localize/templatestrings.it.json | 5 + .../localize/templatestrings.ja.json | 5 + .../localize/templatestrings.ko.json | 5 + .../localize/templatestrings.pl.json | 5 + .../localize/templatestrings.pt-BR.json | 5 + .../localize/templatestrings.ru.json | 5 + .../localize/templatestrings.tr.json | 5 + .../localize/templatestrings.zh-Hans.json | 5 + .../localize/templatestrings.zh-Hant.json | 5 + .../.template.config/template.json | 75 +++++++++++++++ .../content/Interface-CSharp/Interface1.cs | 19 ++++ .../localize/templatestrings.cs.json | 5 + .../localize/templatestrings.de.json | 5 + .../localize/templatestrings.en.json | 5 + .../localize/templatestrings.es.json | 5 + .../localize/templatestrings.fr.json | 5 + .../localize/templatestrings.it.json | 5 + .../localize/templatestrings.ja.json | 5 + .../localize/templatestrings.ko.json | 5 + .../localize/templatestrings.pl.json | 5 + .../localize/templatestrings.pt-BR.json | 5 + .../localize/templatestrings.ru.json | 5 + .../localize/templatestrings.tr.json | 5 + .../localize/templatestrings.zh-Hans.json | 5 + .../localize/templatestrings.zh-Hant.json | 5 + .../.template.config/template.json | 93 +++++++++++++++++++ .../content/Record-CSharp/Class1.cs | 25 +++++ .../localize/templatestrings.cs.json | 5 + .../localize/templatestrings.de.json | 5 + .../localize/templatestrings.en.json | 5 + .../localize/templatestrings.es.json | 5 + .../localize/templatestrings.fr.json | 5 + .../localize/templatestrings.it.json | 5 + .../localize/templatestrings.ja.json | 5 + .../localize/templatestrings.ko.json | 5 + .../localize/templatestrings.pl.json | 5 + .../localize/templatestrings.pt-BR.json | 5 + .../localize/templatestrings.ru.json | 5 + .../localize/templatestrings.tr.json | 5 + .../localize/templatestrings.zh-Hans.json | 5 + .../localize/templatestrings.zh-Hant.json | 5 + .../.template.config/template.json | 75 +++++++++++++++ .../content/Struct-CSharp/Class1.cs | 19 ++++ 80 files changed, 836 insertions(+) create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.cs.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.de.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.en.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.es.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.fr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.it.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ja.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ko.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pl.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pt-BR.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ru.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.tr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hans.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hant.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/Class1.cs create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.cs.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.de.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.en.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.es.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.fr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.it.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ja.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ko.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pl.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pt-BR.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ru.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.tr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hans.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hant.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.cs.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.de.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.en.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.es.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.fr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.it.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ja.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ko.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pl.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pt-BR.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ru.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.tr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hans.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hant.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/Interface1.cs create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.cs.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.de.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.en.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.es.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.fr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.it.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ja.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ko.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pl.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pt-BR.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ru.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.tr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hans.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hant.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.cs.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.de.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.en.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.es.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.fr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.it.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ja.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ko.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pl.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pt-BR.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ru.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.tr.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hans.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hant.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json create mode 100644 template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.cs.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.cs.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.cs.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.de.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.de.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.de.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.en.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.en.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.en.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.es.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.es.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.es.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.fr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.fr.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.fr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.it.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.it.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.it.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ja.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ja.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ja.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ko.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ko.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ko.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pl.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pl.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pl.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pt-BR.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pt-BR.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.pt-BR.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ru.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ru.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.ru.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.tr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.tr.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.tr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hans.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hans.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hans.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hant.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hant.json new file mode 100644 index 000000000000..c37a32ef30aa --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/localize/templatestrings.zh-Hant.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Class", + "description": "Creates a new C# class" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json new file mode 100644 index 000000000000..96e7ff82ddd7 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json @@ -0,0 +1,75 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Common" + ], + "name": "Class", + "generatorVersions": "[1.0.0.0-*)", + "description": "Creates a new C# class", + "tags": { + "language": "C#", + "type": "item" + }, + "groupIdentity": "DotNet.Common.Class", + "precedence": "0", + "identity": "DotNet.Common.Class.CSharp", + "shortName": "class", + "sourceName": "Class1", + "primaryOutputs": [ + { + "path": "Class1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "NETCoreSdkVersion": { + "type": "bind", + "binding": "msbuild:NETCoreSdkVersion" + }, + "ImplicitUsings": { + "type": "bind", + "binding": "msbuild:ImplicitUsings" + }, + "net6orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^([6-9]\\.0\\.).*", + "source": "NETCoreSdkVersion" + } + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion" + }, + "csharp9orOlder": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(ISO-1|ISO-2|[1-7]|[8-9]|[8-9]\\.0|7\\.[0-3])$", + "source": "langVersion" + } + }, + "csharp10orLater": { + "type": "computed", + "value": "!csharp9orOlder" + }, + "csharpFeature_FileScopedNamespaces": { + "type": "computed", + "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/Class1.cs new file mode 100644 index 000000000000..ba364e17cb62 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/Class1.cs @@ -0,0 +1,19 @@ +#if (ImplicitUsings != "enable") +using System; + +#endif +#if (csharpFeature_FileScopedNamespaces) +namespace Company.ClassLibrary1; +public class Class1 +{ + +} +#else +namespace Company.ClassLibrary1 +{ + public class Class1 + { + + } +} +#endif diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.cs.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.cs.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.cs.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.de.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.de.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.de.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.en.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.en.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.en.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.es.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.es.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.es.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.fr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.fr.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.fr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.it.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.it.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.it.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ja.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ja.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ja.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ko.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ko.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ko.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pl.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pl.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pl.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pt-BR.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pt-BR.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.pt-BR.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ru.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ru.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.ru.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.tr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.tr.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.tr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hans.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hans.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hans.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hant.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hant.json new file mode 100644 index 000000000000..598c48a6521e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/localize/templatestrings.zh-Hant.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Enum", + "description": "Creates a new C# enum" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json new file mode 100644 index 000000000000..8b6c67803aa5 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json @@ -0,0 +1,71 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Common" + ], + "name": "Enum", + "generatorVersions": "[1.0.0.0-*)", + "description": "Creates a new C# enum", + "tags": { + "language": "C#", + "type": "item" + }, + "groupIdentity": "DotNet.Common.Enum", + "precedence": "0", + "identity": "DotNet.Common.Enum.CSharp", + "shortName": "enum", + "sourceName": "Class1", + "primaryOutputs": [ + { + "path": "Class1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "NETCoreSdkVersion": { + "type": "bind", + "binding": "msbuild:NETCoreSdkVersion" + }, + "net6orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^([6-9]\\.0\\.).*", + "source": "NETCoreSdkVersion" + } + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion" + }, + "csharp9orOlder": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(ISO-1|ISO-2|[1-7]|[8-9]|[8-9]\\.0|7\\.[0-3])$", + "source": "langVersion" + } + }, + "csharp10orLater": { + "type": "computed", + "value": "!csharp9orOlder" + }, + "csharpFeature_FileScopedNamespaces": { + "type": "computed", + "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs new file mode 100644 index 000000000000..19ae4f3d26ed --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs @@ -0,0 +1,15 @@ +#if (csharpFeature_FileScopedNamespaces) +namespace Company.ClassLibrary1; +public enum Class1 +{ + +} +#else +namespace Company.ClassLibrary1 +{ + public enum Class1 + { + + } +} +#endif diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.cs.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.cs.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.cs.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.de.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.de.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.de.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.en.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.en.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.en.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.es.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.es.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.es.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.fr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.fr.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.fr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.it.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.it.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.it.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ja.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ja.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ja.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ko.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ko.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ko.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pl.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pl.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pl.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pt-BR.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pt-BR.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.pt-BR.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ru.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ru.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.ru.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.tr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.tr.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.tr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hans.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hans.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hans.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hant.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hant.json new file mode 100644 index 000000000000..d11e179d0d9e --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/localize/templatestrings.zh-Hant.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Interface", + "description": "Creates a new C# interface" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json new file mode 100644 index 000000000000..1d6615ec637b --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json @@ -0,0 +1,75 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Common" + ], + "name": "Interface", + "generatorVersions": "[1.0.0.0-*)", + "description": "Creates a new C# interface", + "tags": { + "language": "C#", + "type": "item" + }, + "groupIdentity": "DotNet.Common.Interface", + "precedence": "0", + "identity": "DotNet.Common.Interface.CSharp", + "shortName": "interface", + "sourceName": "Interface1", + "primaryOutputs": [ + { + "path": "Interface1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "NETCoreSdkVersion": { + "type": "bind", + "binding": "msbuild:NETCoreSdkVersion" + }, + "ImplicitUsings": { + "type": "bind", + "binding": "msbuild:ImplicitUsings" + }, + "net6orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^([6-9]\\.0\\.).*", + "source": "NETCoreSdkVersion" + } + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion" + }, + "csharp9orOlder": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(ISO-1|ISO-2|[1-7]|[8-9]|[8-9]\\.0|7\\.[0-3])$", + "source": "langVersion" + } + }, + "csharp10orLater": { + "type": "computed", + "value": "!csharp9orOlder" + }, + "csharpFeature_FileScopedNamespaces": { + "type": "computed", + "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/Interface1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/Interface1.cs new file mode 100644 index 000000000000..9999398f3c26 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/Interface1.cs @@ -0,0 +1,19 @@ +#if (ImplicitUsings != "enable") +using System; + +#endif +#if (csharpFeature_FileScopedNamespaces) +namespace Company.ClassLibrary1; +public interface Interface1 +{ + +} +#else +namespace Company.ClassLibrary1 +{ + public interface Interface1 + { + + } +} +#endif diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.cs.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.cs.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.cs.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.de.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.de.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.de.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.en.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.en.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.en.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.es.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.es.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.es.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.fr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.fr.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.fr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.it.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.it.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.it.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ja.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ja.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ja.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ko.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ko.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ko.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pl.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pl.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pl.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pt-BR.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pt-BR.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.pt-BR.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ru.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ru.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.ru.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.tr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.tr.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.tr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hans.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hans.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hans.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hant.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hant.json new file mode 100644 index 000000000000..107a4c27e7a6 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/localize/templatestrings.zh-Hant.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Record", + "description": "Creates a new C# record" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json new file mode 100644 index 000000000000..c57cef4e9362 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json @@ -0,0 +1,93 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Common" + ], + "name": "Record", + "generatorVersions": "[1.0.0.0-*)", + "description": "Creates a new C# record", + "tags": { + "language": "C#", + "type": "item" + }, + "groupIdentity": "DotNet.Common.Record", + "precedence": "0", + "identity": "DotNet.Common.Record.CSharp", + "shortName": "record", + "sourceName": "Class1", + "primaryOutputs": [ + { + "path": "Class1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "NETCoreSdkVersion": { + "type": "bind", + "binding": "msbuild:NETCoreSdkVersion" + }, + "net5orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^([5-9]\\.0\\.).*", + "source": "NETCoreSdkVersion" + } + }, + "net6orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^([6-9]\\.0\\.).*", + "source": "NETCoreSdkVersion" + } + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion" + }, + "csharp8orOlder": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(ISO-1|ISO-2|[1-7]|8|8\\.0|7\\.[0-3])$", + "source": "langVersion" + } + }, + "csharp9": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(9|9\\.0)$", + "source": "langVersion" + } + }, + "csharp10orLater": { + "type": "computed", + "value": "!(csharp8orOlder || csharp9)" + }, + "csharpFeature_RecordClass": { + "type": "computed", + "value": "net6orLater && csharp10orLater" + }, + "csharpFeature_Record": { + "type": "computed", + "value": "net5orLater && csharp9" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs new file mode 100644 index 000000000000..8816f20d20db --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs @@ -0,0 +1,25 @@ +#if (csharpFeature_RecordClass) +namespace Company.ClassLibrary1; +public record class Class1 +{ + +} +#elseif (csharpFeature_Record) +namespace Company.ClassLibrary1 +{ + public record Class1 + { + + } +} +#else +namespace Company.ClassLibrary1 +{ + //Record was added in C# 9 and later, so Class was used instead. + //See more info: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record + public class Class1 + { + + } +} +#endif diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.cs.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.cs.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.cs.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.de.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.de.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.de.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.en.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.en.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.en.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.es.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.es.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.es.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.fr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.fr.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.fr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.it.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.it.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.it.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ja.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ja.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ja.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ko.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ko.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ko.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pl.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pl.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pl.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pt-BR.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pt-BR.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.pt-BR.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ru.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ru.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.ru.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.tr.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.tr.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.tr.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hans.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hans.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hans.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hant.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hant.json new file mode 100644 index 000000000000..fbe86cf82d09 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/localize/templatestrings.zh-Hant.json @@ -0,0 +1,5 @@ +{ + "author": "Microsoft", + "name": "Struct", + "description": "Creates a new C# struct" +} \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json new file mode 100644 index 000000000000..2786e7c79501 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json @@ -0,0 +1,75 @@ +{ + "$schema": "http://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ + "Common" + ], + "name": "Struct", + "generatorVersions": "[1.0.0.0-*)", + "description": "Creates a new C# struct", + "tags": { + "language": "C#", + "type": "item" + }, + "groupIdentity": "DotNet.Common.Struct", + "precedence": "0", + "identity": "DotNet.Common.Struct.CSharp", + "shortName": "struct", + "sourceName": "Class1", + "primaryOutputs": [ + { + "path": "Class1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "NETCoreSdkVersion": { + "type": "bind", + "binding": "msbuild:NETCoreSdkVersion" + }, + "ImplicitUsings": { + "type": "bind", + "binding": "msbuild:ImplicitUsings" + }, + "net6orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^([6-9]\\.0\\.).*", + "source": "NETCoreSdkVersion" + } + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion" + }, + "csharp9orOlder": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(ISO-1|ISO-2|[1-7]|[8-9]|[8-9]\\.0|7\\.[0-3])$", + "source": "langVersion" + } + }, + "csharp10orLater": { + "type": "computed", + "value": "!csharp9orOlder" + }, + "csharpFeature_FileScopedNamespaces": { + "type": "computed", + "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs new file mode 100644 index 000000000000..f0a8fd38cf74 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs @@ -0,0 +1,19 @@ +#if (ImplicitUsings != "enable") +using System; + +#endif +#if (csharpFeature_FileScopedNamespaces) +namespace Company.ClassLibrary1; +public struct Class1 +{ + +} +#else +namespace Company.ClassLibrary1 +{ + public struct Class1 + { + + } +} +#endif From 7093900fc82f8c1208298fd81eb36abb45f622af Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Wed, 21 Dec 2022 15:57:07 +0100 Subject: [PATCH 02/16] add test cases --- .../DotnetClassTemplateTests.cs | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs diff --git a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs new file mode 100644 index 000000000000..e82201de3c14 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -0,0 +1,83 @@ +// 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.Extensions.Logging; +using Microsoft.NET.TestFramework; +using Microsoft.NET.TestFramework.Commands; +using Microsoft.TemplateEngine.Authoring.TemplateVerifier; +using Microsoft.TemplateEngine.TestHelper; +using Xunit.Abstractions; + +namespace Microsoft.DotNet.Cli.New.IntegrationTests +{ + public class DotnetClassTemplateTests : BaseIntegrationTest, IClassFixture + { + private readonly SharedHomeDirectory _fixture; + private readonly ITestOutputHelper _log; + private readonly ILogger _logger; + + public DotnetClassTemplateTests(SharedHomeDirectory fixture, ITestOutputHelper log) : base(log) + { + _fixture = fixture; + _log = log; + _logger = new XunitLoggerProvider(log) + .CreateLogger("TestRun"); + } + + [Theory] + [InlineData("class")] + [InlineData("class", "9.0", "net5.0")] + [InlineData("interface")] + [InlineData("interface", "9.0", "net5.0")] + [InlineData("record")] + [InlineData("record", "9.0", "net5.0")] + [InlineData("record", "8.0", "netcoreapp3.1")] + [InlineData("struct")] + [InlineData("struct", "9.0", "net5.0")] + [InlineData("enum")] + [InlineData("enum", "9.0", "net5.0")] + public async void DotnetCSharpClassTemplatesTest( + string templateShortName, + string langVersion = "11.0", + string targetFramework = "net7.0") + { + string scenarioName = $"{nameof(DotnetCSharpClassTemplatesTest)}.{templateShortName}"; + string workingDir = CreateTemporaryFolder(scenarioName); + CreateTestProject(workingDir, langVersion, targetFramework); + + TemplateVerifierOptions options = new TemplateVerifierOptions(templateName: templateShortName) + { + SnapshotsDirectory = "Approvals", + VerifyCommandOutput = true, + VerificationExcludePatterns = new[] { "*/stderr.txt", "*\\stderr.txt" }, + SettingsDirectory = _fixture.HomeDirectory, + DotnetExecutablePath = TestContext.Current.ToolsetUnderTest.DotNetHostPath, + DoNotPrependCallerMethodNameToScenarioName = true, + DoNotAppendTemplateArgsToScenarioName = true, + ScenarioName = scenarioName, + OutputDirectory = workingDir + }; + + VerificationEngine engine = new VerificationEngine(_logger); + await engine.Execute(options) + .ConfigureAwait(false); + } + + private void CreateTestProject( + string workingDir, + string langVersion, + string targetFramework) + { + new DotnetNewCommand(Log, "classlib", "-o", workingDir, "--framework", targetFramework, "--langVersion", langVersion, "--no-restore") + .WithVirtualHive() + .WithWorkingDirectory(workingDir) + .Execute(); + + foreach (string classFile in Directory.GetFiles(workingDir, "*.cs")) + { + File.Delete(classFile); + } + } + } +} From 18eb1ab8ed8e6fc19b26f4bd1c418f2164748b6f Mon Sep 17 00:00:00 2001 From: v-wuzhai <46013274+v-wuzhai@users.noreply.github.com> Date: Wed, 21 Dec 2022 18:08:03 -0800 Subject: [PATCH 03/16] [main] Update dependencies from dotnet/templating (#29638) --- eng/Version.Details.xml | 293 +++++++++++++++++++--------------------- eng/Versions.props | 72 +++++----- 2 files changed, 173 insertions(+), 192 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bf441a46d013..71bd0a8e7f45 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,50 +1,46 @@ - + https://github.com/dotnet/templating - 01c412e0fe40730c2b96a0366b520af707e4291d - - - https://github.com/dotnet/templating - 01c412e0fe40730c2b96a0366b520af707e4291d + fc5766dd66284feaf3826c6fcb1a121c84ce2722 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c https://github.com/dotnet/msbuild @@ -63,9 +59,9 @@ 1c1ccfdc7c7bbd44ca4aac6d7efcc09f1fd1f5d8 - + https://github.com/dotnet/format - 49c2ef651359526841d13e66129b71d1bcd9cef9 + 92fd2c51105779f8442ccef788e90b04c68c2927 @@ -97,124 +93,111 @@ https://github.com/dotnet/roslyn c80d6495d55ebbd64372755d236d0e5971b2dfc7 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 https://github.com/nuget/nuget.client dccbd304b11103e08b97abf4cf4bcc1499d9235a - + https://github.com/microsoft/vstest - be79eb4393631df7c6431ed1c0aa14c1bbaca731 + 6710cdf0419bccc782090b37940d19462a649b75 - + https://github.com/dotnet/linker - 8db10f44053ed4cb95a99676ac7b8ccae681b79d + 7a613cd550199d78d439ac374e1c10bb26aaca17 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 - - - + https://github.com/dotnet/linker - 8db10f44053ed4cb95a99676ac7b8ccae681b79d - - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 - - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + 7a613cd550199d78d439ac374e1c10bb26aaca17 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - - https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop - 417429fc040af552532bb07aad29e5e8639b840f + + https://github.com/dotnet/windowsdesktop + 1ceaea618eb31db25b18963d2fd1a342e689b840 - - https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop - 417429fc040af552532bb07aad29e5e8639b840f + + https://github.com/dotnet/windowsdesktop + 1ceaea618eb31db25b18963d2fd1a342e689b840 - - https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop - 417429fc040af552532bb07aad29e5e8639b840f + + https://github.com/dotnet/windowsdesktop + 1ceaea618eb31db25b18963d2fd1a342e689b840 - - https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop - 417429fc040af552532bb07aad29e5e8639b840f + + https://github.com/dotnet/windowsdesktop + 1ceaea618eb31db25b18963d2fd1a342e689b840 - - https://dev.azure.com/dnceng/internal/_git/dotnet-wpf - 636e2b7a00a434a354a126f510a56e16ce3c6bbc + + https://github.com/dotnet/wpf + ca0aecdb68840ba5d66ade7414e0ad5ee0cd73a5 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 https://github.com/dotnet/razor @@ -233,76 +216,76 @@ https://github.com/dotnet/razor 2775d3945bd37848ddfc17dc897ac3d365178439 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 - - https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore - bb01bbf4433e27289b99001b7de6a582879d1835 + + https://github.com/dotnet/aspnetcore + 589aa11b5c631ce719e0530d66be8324a6d79169 https://github.com/dotnet/xdt 9a1c3e1b7f0c8763d4c96e593961a61a72679a7b - + https://github.com/dotnet/roslyn-analyzers - ea9fb45000311153bfc91690f306cca2b80e6b83 + f10e7f219ee2ce9894e358be7642a9f3a13bf7f5 - + https://github.com/dotnet/roslyn-analyzers - ea9fb45000311153bfc91690f306cca2b80e6b83 + f10e7f219ee2ce9894e358be7642a9f3a13bf7f5 - + https://github.com/dotnet/command-line-api - 605dd1d76ddfea34aa42b4337dfb3f7b467acb0d + 8374d5fca634a93458c84414b1604c12f765d1ab - + https://github.com/dotnet/command-line-api - 605dd1d76ddfea34aa42b4337dfb3f7b467acb0d + 8374d5fca634a93458c84414b1604c12f765d1ab - + https://github.com/dotnet/source-build-externals - c47ba6c19d50081f90008da8bc61b3ac20348f20 + 0c829ba73b00f015ab35d14f3cc974e79eb79ef0 - + https://github.com/dotnet/arcade - c01ccbc9554b39205750bf5bda7aad29f89bc0c9 + 57ba56de330e50f9012493b8ba24818e24ec7817 - + https://github.com/dotnet/arcade - c01ccbc9554b39205750bf5bda7aad29f89bc0c9 + 57ba56de330e50f9012493b8ba24818e24ec7817 - + https://github.com/dotnet/arcade - c01ccbc9554b39205750bf5bda7aad29f89bc0c9 + 57ba56de330e50f9012493b8ba24818e24ec7817 - + https://github.com/dotnet/arcade - c01ccbc9554b39205750bf5bda7aad29f89bc0c9 + 57ba56de330e50f9012493b8ba24818e24ec7817 - - https://dev.azure.com/dnceng/internal/_git/dotnet-runtime - d099f075e45d2aa6007a22b71b45a08758559f80 + + https://github.com/dotnet/runtime + 551a44dbe9895c91d9b8bbc9205b57816f070b9c - + https://github.com/dotnet/xliff-tasks - 740189d758fb3bbdc118c5b6171ef1a7351a8c44 + 154c8a905b47c5c127b7fca905c0c407a1329470 diff --git a/eng/Versions.props b/eng/Versions.props index a72c764d1e75..56319a191284 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,10 +11,9 @@ - 7.0.200 - preview - - + 8.0.100 + alpha + 1 false release @@ -26,7 +25,7 @@ 15.4.8 1.0.0-20200708.1 2.1.0-preview2-26306-03 - 2.20.0 + 2.19.0 2.0.1-servicing-26011-01 13.0.1 $(NewtonsoftJsonPackageVersion) @@ -34,32 +33,32 @@ 6.0.0 4.0.0 6.0.0 - 7.0.0-beta.22601.6 + 8.0.0-beta.22616.1 7.0.0-preview.22423.2 - 7.0.0 + 8.0.0-alpha.1.22619.5 4.3.0 4.3.0 4.0.5 6.0.0 - 7.0.0 + 8.0.0-alpha.1.22619.5 4.6.0 - 2.0.0-beta4.22526.1 + 2.0.0-beta4.22564.1 1.0.0-preview5.1.22263.1 3.0.4496 - 7.0.0 - 7.0.0-rtm.22518.5 - 7.0.0 + 8.0.0-alpha.1.22619.5 + 8.0.0-alpha.1.22619.5 + 8.0.0-alpha.1.22619.5 $(MicrosoftNETCoreAppRuntimewinx64PackageVersion) - 7.0.0 - 7.0.0 - 7.0.0-rtm.22518.5 + 8.0.0-alpha.1.22619.5 + 8.0.0-alpha.1.22619.5 + 8.0.0-alpha.1.22619.5 6.0.0 $(MicrosoftExtensionsDependencyModelPackageVersion) 6.0.0 - 7.0.0 + 7.0.0-preview.4.22201.3 @@ -80,29 +79,28 @@ - 17.5.0-release-20221220-01 + 17.6.0-preview-20221219-02 $(MicrosoftNETTestSdkPackageVersion) $(MicrosoftNETTestSdkPackageVersion) - 7.0.100-1.22579.2 + 8.0.100-1.22619.1 $(MicrosoftNETILLinkTasksPackageVersion) - 7.0.0 - 7.0.0 - 7.0.0 - 7.0.0 + 8.0.0-alpha.1.22619.5 + 8.0.0-alpha.1.22619.5 + 8.0.0-alpha.1.22619.5 - 7.0.357101 + 8.0.361901 - 7.0.0-preview1.22513.1 + 8.0.0-preview1.22620.4 @@ -126,13 +124,13 @@ - 7.0.200-alpha.1.22621.2 + 8.0.100-alpha.1.22621.4 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) - 7.0.200-alpha.1.22621.2 + $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) @@ -153,14 +151,14 @@ - 7.0.0-rtm.22518.19 - 7.0.0-rtm.22518.19 - 7.0.0-rtm.22518.19 - 7.0.0-rtm.22518.19 - 7.0.0-rtm.22518.19 - 7.0.0 + 8.0.0-alpha.1.22620.2 + 8.0.0-alpha.1.22620.2 + 8.0.0-alpha.1.22620.2 + 8.0.0-alpha.1.22620.2 + 8.0.0-alpha.1.22620.2 + 8.0.0-alpha.1.22620.2 - + 7.0.0-preview.22619.1 7.0.0-preview.22619.1 @@ -169,16 +167,16 @@ - 7.0.0-rtm.22518.2 + 8.0.0-alpha.1.22603.1 - 1.4.1 + 1.5.3 4.0.1 - 1.0.0-beta.22427.1 + 1.0.0-beta.22614.1 @@ -188,7 +186,7 @@ 6.8.0 6.1.0 - 7.0.0-beta.22601.6 + 8.0.0-beta.22616.1 4.8.2 6.0.0-beta.22262.1 From a99ebe85fca469667f271041b169600a5d3874a7 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Thu, 22 Dec 2022 11:50:46 +0100 Subject: [PATCH 04/16] Revert "[main] Update dependencies from dotnet/templating (#29638)" This reverts commit 18eb1ab8ed8e6fc19b26f4bd1c418f2164748b6f. --- eng/Version.Details.xml | 293 +++++++++++++++++++++------------------- eng/Versions.props | 72 +++++----- 2 files changed, 192 insertions(+), 173 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 71bd0a8e7f45..bf441a46d013 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,46 +1,50 @@ - + https://github.com/dotnet/templating - fc5766dd66284feaf3826c6fcb1a121c84ce2722 + 01c412e0fe40730c2b96a0366b520af707e4291d + + + https://github.com/dotnet/templating + 01c412e0fe40730c2b96a0366b520af707e4291d - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 https://github.com/dotnet/msbuild @@ -59,9 +63,9 @@ 1c1ccfdc7c7bbd44ca4aac6d7efcc09f1fd1f5d8 - + https://github.com/dotnet/format - 92fd2c51105779f8442ccef788e90b04c68c2927 + 49c2ef651359526841d13e66129b71d1bcd9cef9 @@ -93,111 +97,124 @@ https://github.com/dotnet/roslyn c80d6495d55ebbd64372755d236d0e5971b2dfc7 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 https://github.com/nuget/nuget.client dccbd304b11103e08b97abf4cf4bcc1499d9235a - + https://github.com/microsoft/vstest - 6710cdf0419bccc782090b37940d19462a649b75 + be79eb4393631df7c6431ed1c0aa14c1bbaca731 - + https://github.com/dotnet/linker - 7a613cd550199d78d439ac374e1c10bb26aaca17 + 8db10f44053ed4cb95a99676ac7b8ccae681b79d - + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 + + + https://github.com/dotnet/linker - 7a613cd550199d78d439ac374e1c10bb26aaca17 + 8db10f44053ed4cb95a99676ac7b8ccae681b79d + + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 + + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - - https://github.com/dotnet/windowsdesktop - 1ceaea618eb31db25b18963d2fd1a342e689b840 + + https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop + 417429fc040af552532bb07aad29e5e8639b840f - - https://github.com/dotnet/windowsdesktop - 1ceaea618eb31db25b18963d2fd1a342e689b840 + + https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop + 417429fc040af552532bb07aad29e5e8639b840f - - https://github.com/dotnet/windowsdesktop - 1ceaea618eb31db25b18963d2fd1a342e689b840 + + https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop + 417429fc040af552532bb07aad29e5e8639b840f - - https://github.com/dotnet/windowsdesktop - 1ceaea618eb31db25b18963d2fd1a342e689b840 + + https://dev.azure.com/dnceng/internal/_git/dotnet-windowsdesktop + 417429fc040af552532bb07aad29e5e8639b840f - - https://github.com/dotnet/wpf - ca0aecdb68840ba5d66ade7414e0ad5ee0cd73a5 + + https://dev.azure.com/dnceng/internal/_git/dotnet-wpf + 636e2b7a00a434a354a126f510a56e16ce3c6bbc - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 https://github.com/dotnet/razor @@ -216,76 +233,76 @@ https://github.com/dotnet/razor 2775d3945bd37848ddfc17dc897ac3d365178439 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 - - https://github.com/dotnet/aspnetcore - 589aa11b5c631ce719e0530d66be8324a6d79169 + + https://dev.azure.com/dnceng/internal/_git/dotnet-aspnetcore + bb01bbf4433e27289b99001b7de6a582879d1835 https://github.com/dotnet/xdt 9a1c3e1b7f0c8763d4c96e593961a61a72679a7b - + https://github.com/dotnet/roslyn-analyzers - f10e7f219ee2ce9894e358be7642a9f3a13bf7f5 + ea9fb45000311153bfc91690f306cca2b80e6b83 - + https://github.com/dotnet/roslyn-analyzers - f10e7f219ee2ce9894e358be7642a9f3a13bf7f5 + ea9fb45000311153bfc91690f306cca2b80e6b83 - + https://github.com/dotnet/command-line-api - 8374d5fca634a93458c84414b1604c12f765d1ab + 605dd1d76ddfea34aa42b4337dfb3f7b467acb0d - + https://github.com/dotnet/command-line-api - 8374d5fca634a93458c84414b1604c12f765d1ab + 605dd1d76ddfea34aa42b4337dfb3f7b467acb0d - + https://github.com/dotnet/source-build-externals - 0c829ba73b00f015ab35d14f3cc974e79eb79ef0 + c47ba6c19d50081f90008da8bc61b3ac20348f20 - + https://github.com/dotnet/arcade - 57ba56de330e50f9012493b8ba24818e24ec7817 + c01ccbc9554b39205750bf5bda7aad29f89bc0c9 - + https://github.com/dotnet/arcade - 57ba56de330e50f9012493b8ba24818e24ec7817 + c01ccbc9554b39205750bf5bda7aad29f89bc0c9 - + https://github.com/dotnet/arcade - 57ba56de330e50f9012493b8ba24818e24ec7817 + c01ccbc9554b39205750bf5bda7aad29f89bc0c9 - + https://github.com/dotnet/arcade - 57ba56de330e50f9012493b8ba24818e24ec7817 + c01ccbc9554b39205750bf5bda7aad29f89bc0c9 - - https://github.com/dotnet/runtime - 551a44dbe9895c91d9b8bbc9205b57816f070b9c + + https://dev.azure.com/dnceng/internal/_git/dotnet-runtime + d099f075e45d2aa6007a22b71b45a08758559f80 - + https://github.com/dotnet/xliff-tasks - 154c8a905b47c5c127b7fca905c0c407a1329470 + 740189d758fb3bbdc118c5b6171ef1a7351a8c44 diff --git a/eng/Versions.props b/eng/Versions.props index 56319a191284..a72c764d1e75 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -11,9 +11,10 @@ - 8.0.100 - alpha - 1 + 7.0.200 + preview + + false release @@ -25,7 +26,7 @@ 15.4.8 1.0.0-20200708.1 2.1.0-preview2-26306-03 - 2.19.0 + 2.20.0 2.0.1-servicing-26011-01 13.0.1 $(NewtonsoftJsonPackageVersion) @@ -33,32 +34,32 @@ 6.0.0 4.0.0 6.0.0 - 8.0.0-beta.22616.1 + 7.0.0-beta.22601.6 7.0.0-preview.22423.2 - 8.0.0-alpha.1.22619.5 + 7.0.0 4.3.0 4.3.0 4.0.5 6.0.0 - 8.0.0-alpha.1.22619.5 + 7.0.0 4.6.0 - 2.0.0-beta4.22564.1 + 2.0.0-beta4.22526.1 1.0.0-preview5.1.22263.1 3.0.4496 - 8.0.0-alpha.1.22619.5 - 8.0.0-alpha.1.22619.5 - 8.0.0-alpha.1.22619.5 + 7.0.0 + 7.0.0-rtm.22518.5 + 7.0.0 $(MicrosoftNETCoreAppRuntimewinx64PackageVersion) - 8.0.0-alpha.1.22619.5 - 8.0.0-alpha.1.22619.5 - 8.0.0-alpha.1.22619.5 + 7.0.0 + 7.0.0 + 7.0.0-rtm.22518.5 6.0.0 $(MicrosoftExtensionsDependencyModelPackageVersion) 6.0.0 - 7.0.0-preview.4.22201.3 + 7.0.0 @@ -79,28 +80,29 @@ - 17.6.0-preview-20221219-02 + 17.5.0-release-20221220-01 $(MicrosoftNETTestSdkPackageVersion) $(MicrosoftNETTestSdkPackageVersion) - 8.0.100-1.22619.1 + 7.0.100-1.22579.2 $(MicrosoftNETILLinkTasksPackageVersion) - 8.0.0-alpha.1.22619.5 - 8.0.0-alpha.1.22619.5 - 8.0.0-alpha.1.22619.5 + 7.0.0 + 7.0.0 + 7.0.0 + 7.0.0 - 8.0.361901 + 7.0.357101 - 8.0.0-preview1.22620.4 + 7.0.0-preview1.22513.1 @@ -124,13 +126,13 @@ - 8.0.100-alpha.1.22621.4 + 7.0.200-alpha.1.22621.2 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) - $(MicrosoftTemplateEngineAbstractionsPackageVersion) + 7.0.200-alpha.1.22621.2 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) @@ -151,14 +153,14 @@ - 8.0.0-alpha.1.22620.2 - 8.0.0-alpha.1.22620.2 - 8.0.0-alpha.1.22620.2 - 8.0.0-alpha.1.22620.2 - 8.0.0-alpha.1.22620.2 - 8.0.0-alpha.1.22620.2 + 7.0.0-rtm.22518.19 + 7.0.0-rtm.22518.19 + 7.0.0-rtm.22518.19 + 7.0.0-rtm.22518.19 + 7.0.0-rtm.22518.19 + 7.0.0 - + 7.0.0-preview.22619.1 7.0.0-preview.22619.1 @@ -167,16 +169,16 @@ - 8.0.0-alpha.1.22603.1 + 7.0.0-rtm.22518.2 - 1.5.3 + 1.4.1 4.0.1 - 1.0.0-beta.22614.1 + 1.0.0-beta.22427.1 @@ -186,7 +188,7 @@ 6.8.0 6.1.0 - 8.0.0-beta.22616.1 + 7.0.0-beta.22601.6 4.8.2 6.0.0-beta.22262.1 From eef3334e05357207031601804b0b8cd70b2a93ad Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Thu, 22 Dec 2022 18:49:31 +0100 Subject: [PATCH 05/16] cover class templates with tests --- eng/Version.Details.xml | 10 +++++----- eng/Versions.props | 6 +++--- .../Class-CSharp/.template.config/template.json | 6 +++--- .../content/Enum-CSharp/.template.config/template.json | 2 +- .../Interface-CSharp/.template.config/template.json | 2 +- .../Record-CSharp/.template.config/template.json | 2 +- .../Struct-CSharp/.template.config/template.json | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index bf441a46d013..01d874e2d66d 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,13 +1,13 @@ - + https://github.com/dotnet/templating - 01c412e0fe40730c2b96a0366b520af707e4291d + 5cb2698587a5f5f83e58f800705308850e774800 - + https://github.com/dotnet/templating - 01c412e0fe40730c2b96a0366b520af707e4291d + 5cb2698587a5f5f83e58f800705308850e774800 @@ -306,4 +306,4 @@ - + \ No newline at end of file diff --git a/eng/Versions.props b/eng/Versions.props index a72c764d1e75..5321453ce0f9 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -126,13 +126,13 @@ - 7.0.200-alpha.1.22621.2 + 7.0.200-alpha.1.22622.2 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) - 7.0.200-alpha.1.22621.2 + 7.0.200-alpha.1.22622.2 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) @@ -201,4 +201,4 @@ <_DotNetHiveRoot Condition="!HasTrailingSlash('$(_DotNetHiveRoot)')">$(_DotNetHiveRoot)/ $(_DotNetHiveRoot)dotnet$(ExeExtension) - + \ No newline at end of file diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json index 96e7ff82ddd7..2ab113209b08 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json @@ -40,10 +40,10 @@ "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.).*", + "pattern": "^([6-9]\\.0\\.*)", "source": "NETCoreSdkVersion" - } - }, + } + }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion" diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json index 8b6c67803aa5..d89755f3bd1c 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json @@ -36,7 +36,7 @@ "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.).*", + "pattern": "^([6-9]\\.0\\.*)", "source": "NETCoreSdkVersion" } }, diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json index 1d6615ec637b..348a14960c01 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json @@ -40,7 +40,7 @@ "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.).*", + "pattern": "^([6-9]\\.0\\.*)", "source": "NETCoreSdkVersion" } }, diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json index c57cef4e9362..3ac6d5de0418 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json @@ -45,7 +45,7 @@ "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.).*", + "pattern": "^([6-9]\\.0\\.*)", "source": "NETCoreSdkVersion" } }, diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json index 2786e7c79501..527e84d5cd6a 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json @@ -40,7 +40,7 @@ "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.).*", + "pattern": "^([6-9]\\.0\\.*)", "source": "NETCoreSdkVersion" } }, From be23348451c6f89fe4175b612460f2526cc22afe Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Thu, 22 Dec 2022 18:49:54 +0100 Subject: [PATCH 06/16] cover class templates with tests --- .../class/Class1.cs | 9 ++++ .../std-streams/stdout.txt | 3 ++ .../class/Class1.cs | 5 ++ .../std-streams/stdout.txt | 1 + .../enum/Class1.cs | 7 +++ .../std-streams/stdout.txt | 1 + .../enum/Class1.cs | 5 ++ .../std-streams/stdout.txt | 1 + .../interface/Class1.cs | 9 ++++ .../std-streams/stdout.txt | 3 ++ .../interface/Class1.cs | 5 ++ .../std-streams/stdout.txt | 1 + .../record/Class1.cs | 9 ++++ .../std-streams/stdout.txt | 1 + .../record/Class1.cs | 7 +++ .../std-streams/stdout.txt | 1 + .../record/Class1.cs | 5 ++ .../std-streams/stdout.txt | 1 + .../std-streams/stdout.txt | 3 ++ .../struct/Class1.cs | 9 ++++ .../std-streams/stdout.txt | 1 + .../struct/Class1.cs | 5 ++ .../DotnetClassTemplateTests.cs | 53 ++++++++++++------- 23 files changed, 127 insertions(+), 18 deletions(-) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs new file mode 100644 index 000000000000..670533c4df2f --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs @@ -0,0 +1,9 @@ +using System; + +namespace ClassLib +{ + public class Class1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..93732d5a7789 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -0,0 +1,3 @@ +Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. +Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. +The template "Class" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs new file mode 100644 index 000000000000..1d3ca57baa6a --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public class Class1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..7adbba1f468a --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Class" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs new file mode 100644 index 000000000000..ed8ef524abde --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs @@ -0,0 +1,7 @@ +namespace ClassLib +{ + public enum Class1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..26f7130c2e3b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Enum" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs new file mode 100644 index 000000000000..d8954891becb --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public enum Class1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..26f7130c2e3b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Enum" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs new file mode 100644 index 000000000000..8c98a59d5606 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs @@ -0,0 +1,9 @@ +using System; + +namespace ClassLib +{ + public interface Class1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..34178e7570a6 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -0,0 +1,3 @@ +Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. +Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. +The template "Interface" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs new file mode 100644 index 000000000000..40631a80663b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public interface Class1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..b33c356fab08 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Interface" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs new file mode 100644 index 000000000000..b5b033576146 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs @@ -0,0 +1,9 @@ +namespace ClassLib +{ + //Record was added in C# 9 and later, so Class was used instead. + //See more info: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record + public class Class1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..19b646ad3f8b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Record" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs new file mode 100644 index 000000000000..9245d1443634 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs @@ -0,0 +1,7 @@ +namespace ClassLib +{ + public record Class1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..19b646ad3f8b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Record" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs new file mode 100644 index 000000000000..ad6e156509bf --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public record class Class1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..19b646ad3f8b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Record" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..488a541af9f5 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -0,0 +1,3 @@ +Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. +Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. +The template "Struct" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs new file mode 100644 index 000000000000..eac4f6a60d92 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs @@ -0,0 +1,9 @@ +using System; + +namespace ClassLib +{ + public struct Class1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..a818dbe58324 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Struct" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs new file mode 100644 index 000000000000..8507c91520f0 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public struct Class1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs index e82201de3c14..f19139ce4b3e 100644 --- a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Logging; using Microsoft.NET.TestFramework; +using Microsoft.NET.TestFramework.Assertions; using Microsoft.NET.TestFramework.Commands; using Microsoft.TemplateEngine.Authoring.TemplateVerifier; using Microsoft.TemplateEngine.TestHelper; @@ -27,57 +28,73 @@ public DotnetClassTemplateTests(SharedHomeDirectory fixture, ITestOutputHelper l [Theory] [InlineData("class")] - [InlineData("class", "9.0", "net5.0")] + [InlineData("class", "9.0", "netstandard2.0")] [InlineData("interface")] - [InlineData("interface", "9.0", "net5.0")] + [InlineData("interface", "9.0", "netstandard2.0")] [InlineData("record")] - [InlineData("record", "9.0", "net5.0")] - [InlineData("record", "8.0", "netcoreapp3.1")] + [InlineData("record", "9.0")] + [InlineData("record", "8.0", "netstandard2.0")] [InlineData("struct")] - [InlineData("struct", "9.0", "net5.0")] + [InlineData("struct", "9.0", "netstandard2.0")] [InlineData("enum")] - [InlineData("enum", "9.0", "net5.0")] + [InlineData("enum", "9.0", "netstandard2.0")] public async void DotnetCSharpClassTemplatesTest( string templateShortName, - string langVersion = "11.0", + string langVersion = "preview", string targetFramework = "net7.0") { - string scenarioName = $"{nameof(DotnetCSharpClassTemplatesTest)}.{templateShortName}"; - string workingDir = CreateTemporaryFolder(scenarioName); - CreateTestProject(workingDir, langVersion, targetFramework); + string expectedProjectName = $"{templateShortName}.langVersion={langVersion}.targetFramework={targetFramework}"; + string workingDir = CreateTemporaryFolder($"{nameof(DotnetCSharpClassTemplatesTest)}.{expectedProjectName}"); + string projectName = CreateTestProject(workingDir, langVersion, targetFramework); TemplateVerifierOptions options = new TemplateVerifierOptions(templateName: templateShortName) { SnapshotsDirectory = "Approvals", VerifyCommandOutput = true, - VerificationExcludePatterns = new[] { "*/stderr.txt", "*\\stderr.txt" }, + TemplateSpecificArgs = new[] { "--name", "Class1" }, + VerificationExcludePatterns = new[] + { + "*/stderr.txt", + "*\\stderr.txt", + $"*{projectName}.*", + "*project.*.*" + }, SettingsDirectory = _fixture.HomeDirectory, DotnetExecutablePath = TestContext.Current.ToolsetUnderTest.DotNetHostPath, - DoNotPrependCallerMethodNameToScenarioName = true, DoNotAppendTemplateArgsToScenarioName = true, - ScenarioName = scenarioName, - OutputDirectory = workingDir - }; + DoNotPrependTemplateNameToScenarioName = true, + ScenarioName = expectedProjectName, + OutputDirectory = workingDir, + EnsureEmptyOutputDirectory = false + } + .WithCustomScrubbers( + ScrubbersDefinition.Empty + .AddScrubber(sb => sb.Replace($"_{projectName}", $"{expectedProjectName}"))); VerificationEngine engine = new VerificationEngine(_logger); await engine.Execute(options) .ConfigureAwait(false); } - private void CreateTestProject( + private string CreateTestProject( string workingDir, string langVersion, string targetFramework) { - new DotnetNewCommand(Log, "classlib", "-o", workingDir, "--framework", targetFramework, "--langVersion", langVersion, "--no-restore") + new DotnetNewCommand(Log, "classlib", "-o", workingDir, "--name", "ClassLib", "--framework", targetFramework, "--langVersion", langVersion) .WithVirtualHive() .WithWorkingDirectory(workingDir) - .Execute(); + .Execute() + .Should() + .Pass() + .And.NotHaveStdErr(); foreach (string classFile in Directory.GetFiles(workingDir, "*.cs")) { File.Delete(classFile); } + + return Path.GetFileNameWithoutExtension(Directory.GetFiles(workingDir, "*.csproj")?.FirstOrDefault() ?? string.Empty); } } } From 3629192f33d28a935e14583320e8cabb7b175e54 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 09:46:04 +0100 Subject: [PATCH 07/16] fix failed test after adding class template --- ...otShowHelpForTemplate_PartialNameMatch.verified.txt | 10 ++++------ .../dotnet-new.Tests/DotnetNewHelpTests.Approval.cs | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetNewHelpTests.CannotShowHelpForTemplate_PartialNameMatch.verified.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetNewHelpTests.CannotShowHelpForTemplate_PartialNameMatch.verified.txt index b4e662fb420f..b0fbc223aa1e 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetNewHelpTests.CannotShowHelpForTemplate_PartialNameMatch.verified.txt +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetNewHelpTests.CannotShowHelpForTemplate_PartialNameMatch.verified.txt @@ -1,10 +1,8 @@ -No templates or subcommands found matching: 'class'. +No templates or subcommands found matching: 'classli'. Did you mean one of the following templates? dotnet new classlib -h -Did you mean one of the following subcommands? - dotnet new list -h -To list installed templates similar to 'class', run: - dotnet new list class +To list installed templates similar to 'classli', run: + dotnet new list classli To search for the templates on NuGet.org, run: - dotnet new search class \ No newline at end of file + dotnet new search classli \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/DotnetNewHelpTests.Approval.cs b/src/Tests/dotnet-new.Tests/DotnetNewHelpTests.Approval.cs index 9f9936ddedb1..c65c4d3b8df8 100644 --- a/src/Tests/dotnet-new.Tests/DotnetNewHelpTests.Approval.cs +++ b/src/Tests/dotnet-new.Tests/DotnetNewHelpTests.Approval.cs @@ -187,7 +187,7 @@ public Task CannotShowHelpForTemplate_PartialNameMatch() { string workingDirectory = CreateTemporaryFolder(); - CommandResult commandResult = new DotnetNewCommand(_log, "class", "-h") + CommandResult commandResult = new DotnetNewCommand(_log, "classli", "-h") .WithCustomHive(_fixture.HomeDirectory) .WithWorkingDirectory(workingDirectory) .Execute(); From 26d5918830b3d61b6724160716d6fcd12c45475a Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 10:08:34 +0100 Subject: [PATCH 08/16] add disabling logging welcome message from sdk installation --- src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs index f19139ce4b3e..8d3269096608 100644 --- a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -43,6 +43,9 @@ public async void DotnetCSharpClassTemplatesTest( string langVersion = "preview", string targetFramework = "net7.0") { + // prevents logging welcome message from sdk installation + Dictionary environmentUnderTest = new() { ["DOTNET_NOLOGO"] = false.ToString() }; + string expectedProjectName = $"{templateShortName}.langVersion={langVersion}.targetFramework={targetFramework}"; string workingDir = CreateTemporaryFolder($"{nameof(DotnetCSharpClassTemplatesTest)}.{expectedProjectName}"); string projectName = CreateTestProject(workingDir, langVersion, targetFramework); @@ -67,6 +70,7 @@ public async void DotnetCSharpClassTemplatesTest( OutputDirectory = workingDir, EnsureEmptyOutputDirectory = false } + .WithCustomEnvironment(environmentUnderTest) .WithCustomScrubbers( ScrubbersDefinition.Empty .AddScrubber(sb => sb.Replace($"_{projectName}", $"{expectedProjectName}"))); From b9e9e1e19e85ead2a810b3b48ca460778ad14d73 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 12:47:12 +0100 Subject: [PATCH 09/16] fix review comments --- .../content/Class-CSharp/.template.config/template.json | 3 ++- .../content/Enum-CSharp/.template.config/template.json | 7 ++++--- .../content/Enum-CSharp/{Class1.cs => Enum1.cs} | 4 ++-- .../Interface-CSharp/.template.config/template.json | 3 ++- .../content/Record-CSharp/.template.config/template.json | 7 ++++--- .../content/Record-CSharp/{Class1.cs => Record1.cs} | 6 +++--- .../content/Struct-CSharp/.template.config/template.json | 7 ++++--- .../content/Struct-CSharp/{Class1.cs => Struct1.cs} | 4 ++-- 8 files changed, 23 insertions(+), 18 deletions(-) rename template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/{Class1.cs => Enum1.cs} (77%) rename template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/{Class1.cs => Record1.cs} (83%) rename template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/{Class1.cs => Struct1.cs} (80%) diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json index 2ab113209b08..b4b6abf9d83a 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json @@ -46,7 +46,8 @@ }, "langVersion": { "type": "bind", - "binding": "msbuild:LangVersion" + "binding": "msbuild:LangVersion", + "dataType": "string" }, "csharp9orOlder": { "type": "generated", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json index d89755f3bd1c..2c8c052010d3 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json @@ -15,10 +15,10 @@ "precedence": "0", "identity": "DotNet.Common.Enum.CSharp", "shortName": "enum", - "sourceName": "Class1", + "sourceName": "Enum1", "primaryOutputs": [ { - "path": "Class1.cs" + "path": "Enum1.cs" } ], "symbols": { @@ -42,7 +42,8 @@ }, "langVersion": { "type": "bind", - "binding": "msbuild:LangVersion" + "binding": "msbuild:LangVersion", + "dataType": "string" }, "csharp9orOlder": { "type": "generated", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Enum1.cs similarity index 77% rename from template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs rename to template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Enum1.cs index 19ae4f3d26ed..e690ee3d05dd 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Class1.cs +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Enum1.cs @@ -1,13 +1,13 @@ #if (csharpFeature_FileScopedNamespaces) namespace Company.ClassLibrary1; -public enum Class1 +public enum Enum1 { } #else namespace Company.ClassLibrary1 { - public enum Class1 + public enum Enum1 { } diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json index 348a14960c01..44d161bec6f9 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json @@ -46,7 +46,8 @@ }, "langVersion": { "type": "bind", - "binding": "msbuild:LangVersion" + "binding": "msbuild:LangVersion", + "dataType": "string" }, "csharp9orOlder": { "type": "generated", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json index 3ac6d5de0418..6c9b941c7d3a 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json @@ -15,10 +15,10 @@ "precedence": "0", "identity": "DotNet.Common.Record.CSharp", "shortName": "record", - "sourceName": "Class1", + "sourceName": "Record1", "primaryOutputs": [ { - "path": "Class1.cs" + "path": "Record1.cs" } ], "symbols": { @@ -51,7 +51,8 @@ }, "langVersion": { "type": "bind", - "binding": "msbuild:LangVersion" + "binding": "msbuild:LangVersion", + "dataType": "string" }, "csharp8orOlder": { "type": "generated", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Record1.cs similarity index 83% rename from template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs rename to template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Record1.cs index 8816f20d20db..530e427646a5 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Class1.cs +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Record1.cs @@ -1,13 +1,13 @@ #if (csharpFeature_RecordClass) namespace Company.ClassLibrary1; -public record class Class1 +public record class Record1 { } #elseif (csharpFeature_Record) namespace Company.ClassLibrary1 { - public record Class1 + public record Record1 { } @@ -17,7 +17,7 @@ namespace Company.ClassLibrary1 { //Record was added in C# 9 and later, so Class was used instead. //See more info: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record - public class Class1 + public class Record1 { } diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json index 527e84d5cd6a..4a8f382baee5 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json @@ -15,10 +15,10 @@ "precedence": "0", "identity": "DotNet.Common.Struct.CSharp", "shortName": "struct", - "sourceName": "Class1", + "sourceName": "Struct1", "primaryOutputs": [ { - "path": "Class1.cs" + "path": "Struct1.cs" } ], "symbols": { @@ -46,7 +46,8 @@ }, "langVersion": { "type": "bind", - "binding": "msbuild:LangVersion" + "binding": "msbuild:LangVersion", + "dataType": "string" }, "csharp9orOlder": { "type": "generated", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Struct1.cs similarity index 80% rename from template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs rename to template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Struct1.cs index f0a8fd38cf74..73c919187561 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Class1.cs +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Struct1.cs @@ -4,14 +4,14 @@ #endif #if (csharpFeature_FileScopedNamespaces) namespace Company.ClassLibrary1; -public struct Class1 +public struct Struct1 { } #else namespace Company.ClassLibrary1 { - public struct Class1 + public struct Struct1 { } From 9a214454c8a26ac77bbf3fefedf02ef745cb69c5 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 14:06:50 +0100 Subject: [PATCH 10/16] fix review comments --- eng/template-engine.yml | 4 ++-- .../class/{Class1.cs => TestItem1.cs} | 2 +- .../class/TestItem1.cs} | 2 +- .../enum/{Class1.cs => TestItem1.cs} | 2 +- .../enum/Class1.cs | 5 ----- .../enum/TestItem1.cs} | 2 +- .../interface/TestItem1.cs} | 2 +- .../interface/TestItem1.cs} | 2 +- .../record/{Class1.cs => TestItem1.cs} | 2 +- .../record/{Class1.cs => TestItem1.cs} | 2 +- .../record/TestItem1.cs | 5 +++++ .../struct/TestItem1.cs} | 2 +- .../struct/TestItem1.cs} | 2 +- .../DotnetClassTemplateTests.cs | 6 ++++-- .../.template.config/template.json | 20 +++++++++++-------- .../.template.config/template.json | 12 ++++++----- .../.template.config/template.json | 16 +++++++++------ .../.template.config/template.json | 16 ++++++++------- .../.template.config/template.json | 16 +++++++++------ 19 files changed, 69 insertions(+), 51 deletions(-) rename src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/{Class1.cs => TestItem1.cs} (66%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs => DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/TestItem1.cs} (54%) rename src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/{Class1.cs => TestItem1.cs} (60%) delete mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs => DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/TestItem1.cs} (56%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs => DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/TestItem1.cs} (63%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs => DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/TestItem1.cs} (50%) rename src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/{Class1.cs => TestItem1.cs} (88%) rename src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/{Class1.cs => TestItem1.cs} (58%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/TestItem1.cs rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs => DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/TestItem1.cs} (65%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs => DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/TestItem1.cs} (53%) diff --git a/eng/template-engine.yml b/eng/template-engine.yml index 5d7957e9d815..f6e2f5a1e37f 100644 --- a/eng/template-engine.yml +++ b/eng/template-engine.yml @@ -50,9 +50,9 @@ jobs: pool: vmImage: 'macOS-latest' ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1015.Amd64.Open + helixTargetQueue: OSX.1100.Amd64.Open ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1015.Amd64 + helixTargetQueue: OSX.1100.Amd64 strategy: matrix: Build_Release: diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/TestItem1.cs similarity index 66% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/TestItem1.cs index 670533c4df2f..396ac96a7017 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/TestItem1.cs @@ -2,7 +2,7 @@ namespace ClassLib { - public class Class1 + public class TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/TestItem1.cs similarity index 54% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/TestItem1.cs index 8507c91520f0..14b142daa879 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/TestItem1.cs @@ -1,5 +1,5 @@ namespace ClassLib; -public struct Class1 +public class TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/TestItem1.cs similarity index 60% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/TestItem1.cs index ed8ef524abde..3f2b630659f0 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/TestItem1.cs @@ -1,6 +1,6 @@ namespace ClassLib { - public enum Class1 + public enum TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs deleted file mode 100644 index d8954891becb..000000000000 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/Class1.cs +++ /dev/null @@ -1,5 +0,0 @@ -namespace ClassLib; -public enum Class1 -{ - -} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/TestItem1.cs similarity index 56% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/TestItem1.cs index 1d3ca57baa6a..37d0cdb89439 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/TestItem1.cs @@ -1,5 +1,5 @@ namespace ClassLib; -public class Class1 +public enum TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/TestItem1.cs similarity index 63% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/TestItem1.cs index eac4f6a60d92..7530e29c35e8 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/TestItem1.cs @@ -2,7 +2,7 @@ namespace ClassLib { - public struct Class1 + public interface TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/TestItem1.cs similarity index 50% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/TestItem1.cs index ad6e156509bf..478d75986a45 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/TestItem1.cs @@ -1,5 +1,5 @@ namespace ClassLib; -public record class Class1 +public interface TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/TestItem1.cs similarity index 88% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/TestItem1.cs index b5b033576146..5cc0b777b41a 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/TestItem1.cs @@ -2,7 +2,7 @@ { //Record was added in C# 9 and later, so Class was used instead. //See more info: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record - public class Class1 + public class TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/TestItem1.cs similarity index 58% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/TestItem1.cs index 9245d1443634..6141cdd5c892 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/TestItem1.cs @@ -1,6 +1,6 @@ namespace ClassLib { - public record Class1 + public record TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/TestItem1.cs new file mode 100644 index 000000000000..3fac67ecd67b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public record class TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/TestItem1.cs similarity index 65% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/TestItem1.cs index 8c98a59d5606..6bfad4fafcb8 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/TestItem1.cs @@ -2,7 +2,7 @@ namespace ClassLib { - public interface Class1 + public struct TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/TestItem1.cs similarity index 53% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/TestItem1.cs index 40631a80663b..8f8d5afdd9cc 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/Class1.cs +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/TestItem1.cs @@ -1,5 +1,5 @@ namespace ClassLib; -public interface Class1 +public struct TestItem1 { } diff --git a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs index 8d3269096608..c4ba8cddc796 100644 --- a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -43,7 +43,7 @@ public async void DotnetCSharpClassTemplatesTest( string langVersion = "preview", string targetFramework = "net7.0") { - // prevents logging welcome message from sdk installation + // prevents logging a welcome message from sdk installation Dictionary environmentUnderTest = new() { ["DOTNET_NOLOGO"] = false.ToString() }; string expectedProjectName = $"{templateShortName}.langVersion={langVersion}.targetFramework={targetFramework}"; @@ -54,12 +54,14 @@ public async void DotnetCSharpClassTemplatesTest( { SnapshotsDirectory = "Approvals", VerifyCommandOutput = true, - TemplateSpecificArgs = new[] { "--name", "Class1" }, + TemplateSpecificArgs = new[] { "--name", "TestItem1" }, VerificationExcludePatterns = new[] { "*/stderr.txt", "*\\stderr.txt", + // csproj file $"*{projectName}.*", + // restored files in obj folder "*project.*.*" }, SettingsDirectory = _fixture.HomeDirectory, diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json index b4b6abf9d83a..78f8ea41be1c 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json @@ -16,6 +16,8 @@ "identity": "DotNet.Common.Class.CSharp", "shortName": "class", "sourceName": "Class1", + "preferDefaultName": true, + "defaultName": "Class1", "primaryOutputs": [ { "path": "Class1.cs" @@ -27,23 +29,25 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "NETCoreSdkVersion": { + "TargetFramework": { "type": "bind", - "binding": "msbuild:NETCoreSdkVersion" + "binding": "msbuild:TargetFramework" }, "ImplicitUsings": { "type": "bind", - "binding": "msbuild:ImplicitUsings" + "binding": "msbuild:ImplicitUsings", + "datatype": "string", + "defaultValue": "disable" }, "net6orLater": { "type": "generated", "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.*)", - "source": "NETCoreSdkVersion" - } - }, + "pattern": "^(net6.0|net7.0|net8.0)$", + "source": "TargetFramework" + } + }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion", @@ -64,7 +68,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" } }, "constraints": { diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json index 2c8c052010d3..0f6cc4b167b7 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json @@ -16,6 +16,8 @@ "identity": "DotNet.Common.Enum.CSharp", "shortName": "enum", "sourceName": "Enum1", + "preferDefaultName": true, + "defaultName": "Enum1", "primaryOutputs": [ { "path": "Enum1.cs" @@ -27,17 +29,17 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "NETCoreSdkVersion": { + "TargetFramework": { "type": "bind", - "binding": "msbuild:NETCoreSdkVersion" + "binding": "msbuild:TargetFramework" }, "net6orLater": { "type": "generated", "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.*)", - "source": "NETCoreSdkVersion" + "pattern": "^(net6.0|net7.0|net8.0)$", + "source": "TargetFramework" } }, "langVersion": { @@ -60,7 +62,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" } }, "constraints": { diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json index 44d161bec6f9..28362a9d6ae4 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json @@ -16,6 +16,8 @@ "identity": "DotNet.Common.Interface.CSharp", "shortName": "interface", "sourceName": "Interface1", + "preferDefaultName": true, + "defaultName": "Interface1", "primaryOutputs": [ { "path": "Interface1.cs" @@ -27,21 +29,23 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "NETCoreSdkVersion": { + "TargetFramework": { "type": "bind", - "binding": "msbuild:NETCoreSdkVersion" + "binding": "msbuild:TargetFramework" }, "ImplicitUsings": { "type": "bind", - "binding": "msbuild:ImplicitUsings" + "binding": "msbuild:ImplicitUsings", + "datatype": "string", + "defaultValue": "disable" }, "net6orLater": { "type": "generated", "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.*)", - "source": "NETCoreSdkVersion" + "pattern": "^(net6.0|net7.0|net8.0)$", + "source": "TargetFramework" } }, "langVersion": { @@ -64,7 +68,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" } }, "constraints": { diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json index 6c9b941c7d3a..d3d9576bb8be 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json @@ -16,6 +16,8 @@ "identity": "DotNet.Common.Record.CSharp", "shortName": "record", "sourceName": "Record1", + "preferDefaultName": true, + "defaultName": "Record1", "primaryOutputs": [ { "path": "Record1.cs" @@ -27,17 +29,17 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "NETCoreSdkVersion": { + "TargetFramework": { "type": "bind", - "binding": "msbuild:NETCoreSdkVersion" + "binding": "msbuild:TargetFramework" }, "net5orLater": { "type": "generated", "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([5-9]\\.0\\.).*", - "source": "NETCoreSdkVersion" + "pattern": "^(net5.0|net6.0|net7.0|net8.0)$*", + "source": "TargetFramework" } }, "net6orLater": { @@ -45,8 +47,8 @@ "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.*)", - "source": "NETCoreSdkVersion" + "pattern": "^(net6.0|net7.0|net8.0)$", + "source": "TargetFramework" } }, "langVersion": { @@ -78,7 +80,7 @@ }, "csharpFeature_RecordClass": { "type": "computed", - "value": "net6orLater && csharp10orLater" + "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" }, "csharpFeature_Record": { "type": "computed", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json index 4a8f382baee5..78e378feae4e 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json @@ -16,6 +16,8 @@ "identity": "DotNet.Common.Struct.CSharp", "shortName": "struct", "sourceName": "Struct1", + "preferDefaultName": true, + "defaultName": "Struct1", "primaryOutputs": [ { "path": "Struct1.cs" @@ -27,21 +29,23 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "NETCoreSdkVersion": { + "TargetFramework": { "type": "bind", - "binding": "msbuild:NETCoreSdkVersion" + "binding": "msbuild:TargetFramework" }, "ImplicitUsings": { "type": "bind", - "binding": "msbuild:ImplicitUsings" + "binding": "msbuild:ImplicitUsings", + "datatype": "string", + "defaultValue": "disable" }, "net6orLater": { "type": "generated", "generator": "regexMatch", "datatype": "bool", "parameters": { - "pattern": "^([6-9]\\.0\\.*)", - "source": "NETCoreSdkVersion" + "pattern": "^(net6.0|net7.0|net8.0)$", + "source": "TargetFramework" } }, "langVersion": { @@ -64,7 +68,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "(net6orLater == \"true\" || langVersion != \"\") && csharp10orLater == \"true\"" + "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" } }, "constraints": { From 0cf06bcc7521e7434add798364e67ad961efbbc5 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 14:30:16 +0100 Subject: [PATCH 11/16] cleaup condition --- .../Class-CSharp/.template.config/template.json | 15 +-------------- .../Enum-CSharp/.template.config/template.json | 15 +-------------- .../.template.config/template.json | 15 +-------------- .../Record-CSharp/.template.config/template.json | 11 +---------- .../Struct-CSharp/.template.config/template.json | 15 +-------------- 5 files changed, 5 insertions(+), 66 deletions(-) diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json index 78f8ea41be1c..acb742e0e079 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json @@ -29,25 +29,12 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "TargetFramework": { - "type": "bind", - "binding": "msbuild:TargetFramework" - }, "ImplicitUsings": { "type": "bind", "binding": "msbuild:ImplicitUsings", "datatype": "string", "defaultValue": "disable" }, - "net6orLater": { - "type": "generated", - "generator": "regexMatch", - "datatype": "bool", - "parameters": { - "pattern": "^(net6.0|net7.0|net8.0)$", - "source": "TargetFramework" - } - }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion", @@ -68,7 +55,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" + "value": "csharp10orLater == \"true\"" } }, "constraints": { diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json index 0f6cc4b167b7..3d1445272247 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json @@ -29,19 +29,6 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "TargetFramework": { - "type": "bind", - "binding": "msbuild:TargetFramework" - }, - "net6orLater": { - "type": "generated", - "generator": "regexMatch", - "datatype": "bool", - "parameters": { - "pattern": "^(net6.0|net7.0|net8.0)$", - "source": "TargetFramework" - } - }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion", @@ -62,7 +49,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" + "value": "csharp10orLater == \"true\"" } }, "constraints": { diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json index 28362a9d6ae4..949b7be0f66a 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json @@ -29,25 +29,12 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "TargetFramework": { - "type": "bind", - "binding": "msbuild:TargetFramework" - }, "ImplicitUsings": { "type": "bind", "binding": "msbuild:ImplicitUsings", "datatype": "string", "defaultValue": "disable" }, - "net6orLater": { - "type": "generated", - "generator": "regexMatch", - "datatype": "bool", - "parameters": { - "pattern": "^(net6.0|net7.0|net8.0)$", - "source": "TargetFramework" - } - }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion", @@ -68,7 +55,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" + "value": "csharp10orLater == \"true\"" } }, "constraints": { diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json index d3d9576bb8be..f925e0516195 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json @@ -42,15 +42,6 @@ "source": "TargetFramework" } }, - "net6orLater": { - "type": "generated", - "generator": "regexMatch", - "datatype": "bool", - "parameters": { - "pattern": "^(net6.0|net7.0|net8.0)$", - "source": "TargetFramework" - } - }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion", @@ -80,7 +71,7 @@ }, "csharpFeature_RecordClass": { "type": "computed", - "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" + "value": "csharp10orLater == \"true\"" }, "csharpFeature_Record": { "type": "computed", diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json index 78e378feae4e..3bd2e8883ff1 100644 --- a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json @@ -29,25 +29,12 @@ "binding": "msbuild:RootNamespace", "replaces": "Company.ClassLibrary1" }, - "TargetFramework": { - "type": "bind", - "binding": "msbuild:TargetFramework" - }, "ImplicitUsings": { "type": "bind", "binding": "msbuild:ImplicitUsings", "datatype": "string", "defaultValue": "disable" }, - "net6orLater": { - "type": "generated", - "generator": "regexMatch", - "datatype": "bool", - "parameters": { - "pattern": "^(net6.0|net7.0|net8.0)$", - "source": "TargetFramework" - } - }, "langVersion": { "type": "bind", "binding": "msbuild:LangVersion", @@ -68,7 +55,7 @@ }, "csharpFeature_FileScopedNamespaces": { "type": "computed", - "value": "net6orLater == \"true\" && csharp10orLater == \"true\"" + "value": "csharp10orLater == \"true\"" } }, "constraints": { From d0c37fc60c892aaeccf0c50609ea35592637458f Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 15:31:21 +0100 Subject: [PATCH 12/16] fix review comments --- eng/Version.Details.xml | 8 +-- eng/Versions.props | 4 +- .../ClassLib.csproj | 9 +++ .../std-streams/stdout.txt | 4 +- .../ClassLib.csproj | 10 ++++ .../ClassLib.csproj | 9 +++ .../class/TestItem1.cs | 5 ++ .../std-streams/stdout.txt | 1 + .../ClassLib.csproj | 9 +++ .../ClassLib.csproj | 9 +++ .../enum/TestItem1.cs | 0 .../std-streams/stdout.txt | 0 .../ClassLib.csproj | 9 +++ .../enum/TestItem1.cs | 5 ++ .../std-streams/stdout.txt | 1 + .../std-streams/stdout.txt | 3 - .../ClassLib.csproj | 9 +++ .../interface/TestItem1.cs | 0 .../std-streams/stdout.txt | 0 .../ClassLib.csproj | 9 +++ .../interface/TestItem1.cs | 0 .../std-streams/stdout.txt | 1 + .../ClassLib.csproj | 9 +++ .../ClassLib.csproj | 9 +++ .../record/TestItem1.cs | 0 .../std-streams/stdout.txt | 0 .../ClassLib.csproj | 9 +++ .../record/TestItem1.cs | 0 .../std-streams/stdout.txt | 0 .../ClassLib.csproj | 10 ++++ .../std-streams/stdout.txt | 0 .../struct/TestItem1.cs | 0 .../ClassLib.csproj | 9 +++ .../std-streams/stdout.txt | 4 +- .../ClassLib.csproj | 9 +++ .../std-streams/stdout.txt | 1 + .../struct/TestItem1.cs | 5 ++ .../DotnetClassTemplateTests.cs | 59 +++++++++++++++---- 38 files changed, 201 insertions(+), 28 deletions(-) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/class/TestItem1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/ClassLib.csproj rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified}/enum/TestItem1.cs (100%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified}/std-streams/stdout.txt (100%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/enum/TestItem1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/std-streams/stdout.txt delete mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/ClassLib.csproj rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified => DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified}/interface/TestItem1.cs (100%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified}/std-streams/stdout.txt (100%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/ClassLib.csproj rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.interface.verified}/interface/TestItem1.cs (100%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/ClassLib.csproj rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified}/record/TestItem1.cs (100%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified}/std-streams/stdout.txt (100%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/ClassLib.csproj rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.record.verified}/record/TestItem1.cs (100%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.record.verified}/std-streams/stdout.txt (100%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/ClassLib.csproj rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified}/std-streams/stdout.txt (100%) rename src/Tests/dotnet-new.Tests/Approvals/{DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified => DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified}/struct/TestItem1.cs (100%) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/struct/TestItem1.cs diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 01d874e2d66d..8a2b5e02d82f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,13 +1,13 @@ - + https://github.com/dotnet/templating - 5cb2698587a5f5f83e58f800705308850e774800 + 0e4dd290455badd78fcf862cf420a2d8fe5cf039 - + https://github.com/dotnet/templating - 5cb2698587a5f5f83e58f800705308850e774800 + 0e4dd290455badd78fcf862cf420a2d8fe5cf039 diff --git a/eng/Versions.props b/eng/Versions.props index 5321453ce0f9..7e46b79648b1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -126,13 +126,13 @@ - 7.0.200-alpha.1.22622.2 + 7.0.200-alpha.1.22623.4 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) - 7.0.200-alpha.1.22622.2 + 7.0.200-alpha.1.22623.4 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..e1795a719140 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + netstandard2.0 + 9.0 + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt index 93732d5a7789..7adbba1f468a 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -1,3 +1 @@ -Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. -Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. -The template "Class" was created successfully. \ No newline at end of file +The template "Class" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..1d5824356773 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net7.0 + preview + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/ClassLib.csproj new file mode 100644 index 000000000000..a1ed5b3f0a72 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/class/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/class/TestItem1.cs new file mode 100644 index 000000000000..14b142daa879 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/class/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public class TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..7adbba1f468a --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Class" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..e1795a719140 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + netstandard2.0 + 9.0 + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..a1ed5b3f0a72 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/enum/TestItem1.cs similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/enum/TestItem1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/enum/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/std-streams/stdout.txt similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/std-streams/stdout.txt diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/ClassLib.csproj new file mode 100644 index 000000000000..a1ed5b3f0a72 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/enum/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/enum/TestItem1.cs new file mode 100644 index 000000000000..37d0cdb89439 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/enum/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public enum TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..26f7130c2e3b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Enum" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt deleted file mode 100644 index 34178e7570a6..000000000000 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt +++ /dev/null @@ -1,3 +0,0 @@ -Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. -Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. -The template "Interface" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..047fc66e51f0 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + netstandard2.0 + 9 + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/interface/TestItem1.cs similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.0.targetFramework=netstandard2.0.verified/interface/TestItem1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/interface/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/std-streams/stdout.txt similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/std-streams/stdout.txt diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/ClassLib.csproj new file mode 100644 index 000000000000..a1ed5b3f0a72 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/interface/TestItem1.cs similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=preview.targetFramework=net7.0.verified/interface/TestItem1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/interface/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..b33c356fab08 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Interface" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..7f7258a5f6e4 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + netstandard2.0 + 8.0 + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..4bc744534a78 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + 9.0 + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/record/TestItem1.cs similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/record/TestItem1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/record/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/std-streams/stdout.txt similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.targetFramework=net7.0.verified/std-streams/stdout.txt rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/std-streams/stdout.txt diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/ClassLib.csproj new file mode 100644 index 000000000000..a1ed5b3f0a72 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/record/TestItem1.cs similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/record/TestItem1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/record/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/std-streams/stdout.txt similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/std-streams/stdout.txt diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/ClassLib.csproj new file mode 100644 index 000000000000..116397300508 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net7.0 + 10 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/std-streams/stdout.txt similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/std-streams/stdout.txt rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/std-streams/stdout.txt diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/struct/TestItem1.cs similarity index 100% rename from src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=preview.targetFramework=net7.0.verified/struct/TestItem1.cs rename to src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/struct/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..e1795a719140 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + netstandard2.0 + 9.0 + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt index 488a541af9f5..a818dbe58324 100644 --- a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/std-streams/stdout.txt @@ -1,3 +1 @@ -Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. -Warning: Failed to evaluate bind symbol 'ImplicitUsings', it will be skipped. -The template "Struct" was created successfully. \ No newline at end of file +The template "Struct" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/ClassLib.csproj new file mode 100644 index 000000000000..a1ed5b3f0a72 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/ClassLib.csproj @@ -0,0 +1,9 @@ + + + + net7.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..a818dbe58324 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Struct" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/struct/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/struct/TestItem1.cs new file mode 100644 index 000000000000..8f8d5afdd9cc --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.verified/struct/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public struct TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs index c4ba8cddc796..dc77642f4f51 100644 --- a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -2,12 +2,14 @@ // Licensed under the MIT license. See LICENSE file in the project root for full license information. // +using System.Text; using Microsoft.Extensions.Logging; using Microsoft.NET.TestFramework; using Microsoft.NET.TestFramework.Assertions; using Microsoft.NET.TestFramework.Commands; using Microsoft.TemplateEngine.Authoring.TemplateVerifier; using Microsoft.TemplateEngine.TestHelper; +using NuGet.Packaging; using Xunit.Abstractions; namespace Microsoft.DotNet.Cli.New.IntegrationTests @@ -28,26 +30,33 @@ public DotnetClassTemplateTests(SharedHomeDirectory fixture, ITestOutputHelper l [Theory] [InlineData("class")] + [InlineData("class", "preview", "net7.0")] + // [InlineData("class", "10.0", "net6.0")] [InlineData("class", "9.0", "netstandard2.0")] [InlineData("interface")] - [InlineData("interface", "9.0", "netstandard2.0")] + //InlineData("interface", "10.0", "net6.0")] + [InlineData("interface", "9", "netstandard2.0")] [InlineData("record")] + //[InlineData("record", "10", "net6.0")] [InlineData("record", "9.0")] [InlineData("record", "8.0", "netstandard2.0")] [InlineData("struct")] + [InlineData("struct", "10")] [InlineData("struct", "9.0", "netstandard2.0")] [InlineData("enum")] + [InlineData("enum", "", "net7.0")] [InlineData("enum", "9.0", "netstandard2.0")] public async void DotnetCSharpClassTemplatesTest( string templateShortName, - string langVersion = "preview", - string targetFramework = "net7.0") + string langVersion = "", + string targetFramework = "") { // prevents logging a welcome message from sdk installation Dictionary environmentUnderTest = new() { ["DOTNET_NOLOGO"] = false.ToString() }; + TestContext.Current.AddTestEnvironmentVariables(environmentUnderTest); - string expectedProjectName = $"{templateShortName}.langVersion={langVersion}.targetFramework={targetFramework}"; - string workingDir = CreateTemporaryFolder($"{nameof(DotnetCSharpClassTemplatesTest)}.{expectedProjectName}"); + string folderName = GetFolderName(templateShortName, langVersion, targetFramework); + string workingDir = CreateTemporaryFolder($"{nameof(DotnetCSharpClassTemplatesTest)}.{folderName}"); string projectName = CreateTestProject(workingDir, langVersion, targetFramework); TemplateVerifierOptions options = new TemplateVerifierOptions(templateName: templateShortName) @@ -59,23 +68,19 @@ public async void DotnetCSharpClassTemplatesTest( { "*/stderr.txt", "*\\stderr.txt", - // csproj file - $"*{projectName}.*", // restored files in obj folder + $"*{projectName}.csproj.*", "*project.*.*" }, SettingsDirectory = _fixture.HomeDirectory, DotnetExecutablePath = TestContext.Current.ToolsetUnderTest.DotNetHostPath, DoNotAppendTemplateArgsToScenarioName = true, DoNotPrependTemplateNameToScenarioName = true, - ScenarioName = expectedProjectName, + ScenarioName = folderName, OutputDirectory = workingDir, EnsureEmptyOutputDirectory = false } - .WithCustomEnvironment(environmentUnderTest) - .WithCustomScrubbers( - ScrubbersDefinition.Empty - .AddScrubber(sb => sb.Replace($"_{projectName}", $"{expectedProjectName}"))); + .WithCustomEnvironment(environmentUnderTest); VerificationEngine engine = new VerificationEngine(_logger); await engine.Execute(options) @@ -87,7 +92,17 @@ private string CreateTestProject( string langVersion, string targetFramework) { - new DotnetNewCommand(Log, "classlib", "-o", workingDir, "--name", "ClassLib", "--framework", targetFramework, "--langVersion", langVersion) + IList projectArgs = new List() { "classlib", "-o", workingDir, "--name", "ClassLib" }; + if (!string.IsNullOrEmpty(langVersion)) + { + projectArgs.AddRange(new[] { "--langVersion", langVersion }); + } + if (!string.IsNullOrEmpty(targetFramework)) + { + projectArgs.AddRange(new[] { "--framework", targetFramework }); + } + + new DotnetNewCommand(Log, projectArgs.ToArray()) .WithVirtualHive() .WithWorkingDirectory(workingDir) .Execute() @@ -102,5 +117,23 @@ private string CreateTestProject( return Path.GetFileNameWithoutExtension(Directory.GetFiles(workingDir, "*.csproj")?.FirstOrDefault() ?? string.Empty); } + + private string GetFolderName(string templateShortName, string langVersion, string targetFramework) + { + StringBuilder sb = new StringBuilder(); + sb.Append($"{templateShortName}"); + + if (!string.IsNullOrEmpty(langVersion)) + { + sb.Append($".langVersion={langVersion}"); + } + + if (!string.IsNullOrEmpty(targetFramework)) + { + sb.Append($".targetFramework={targetFramework}"); + } + + return sb.ToString(); + } } } From ad08b21cd5092cd73e0b4a1aab26390d7812c873 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 15:49:44 +0100 Subject: [PATCH 13/16] add cases for net6.0 --- .../ClassLib.csproj | 10 ++++++++++ .../class/TestItem1.cs | 5 +++++ .../std-streams/stdout.txt | 1 + .../ClassLib.csproj | 10 ++++++++++ .../enum/TestItem1.cs | 5 +++++ .../std-streams/stdout.txt | 1 + .../ClassLib.csproj | 10 ++++++++++ .../interface/TestItem1.cs | 5 +++++ .../std-streams/stdout.txt | 1 + .../ClassLib.csproj | 10 ++++++++++ .../record/TestItem1.cs | 5 +++++ .../std-streams/stdout.txt | 1 + .../ClassLib.csproj | 10 ++++++++++ .../std-streams/stdout.txt | 1 + .../struct/TestItem1.cs | 5 +++++ src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs | 10 ++++++---- 16 files changed, 86 insertions(+), 4 deletions(-) create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/class/TestItem1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/enum/TestItem1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/interface/TestItem1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/record/TestItem1.cs create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt create mode 100644 src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/struct/TestItem1.cs diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..3917866d31d3 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + 10.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/class/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/class/TestItem1.cs new file mode 100644 index 000000000000..14b142daa879 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/class/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public class TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..7adbba1f468a --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Class" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..65df0f0b0c28 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + 10 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/enum/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/enum/TestItem1.cs new file mode 100644 index 000000000000..37d0cdb89439 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/enum/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public enum TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..26f7130c2e3b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Enum" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..3917866d31d3 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + 10.0 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/interface/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/interface/TestItem1.cs new file mode 100644 index 000000000000..478d75986a45 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/interface/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public interface TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..b33c356fab08 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=10.0.targetFramework=net6.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Interface" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..65df0f0b0c28 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + 10 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/record/TestItem1.cs new file mode 100644 index 000000000000..3fac67ecd67b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/record/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public record class TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..19b646ad3f8b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Record" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj new file mode 100644 index 000000000000..65df0f0b0c28 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/ClassLib.csproj @@ -0,0 +1,10 @@ + + + + net6.0 + 10 + enable + enable + + + diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..a818dbe58324 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/std-streams/stdout.txt @@ -0,0 +1 @@ +The template "Struct" was created successfully. \ No newline at end of file diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/struct/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/struct/TestItem1.cs new file mode 100644 index 000000000000..8f8d5afdd9cc --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.targetFramework=net6.0.verified/struct/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public struct TestItem1 +{ + +} diff --git a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs index dc77642f4f51..216c70975ad7 100644 --- a/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -31,19 +31,21 @@ public DotnetClassTemplateTests(SharedHomeDirectory fixture, ITestOutputHelper l [Theory] [InlineData("class")] [InlineData("class", "preview", "net7.0")] - // [InlineData("class", "10.0", "net6.0")] + [InlineData("class", "10.0", "net6.0")] [InlineData("class", "9.0", "netstandard2.0")] [InlineData("interface")] - //InlineData("interface", "10.0", "net6.0")] + [InlineData("interface", "10.0", "net6.0")] [InlineData("interface", "9", "netstandard2.0")] [InlineData("record")] - //[InlineData("record", "10", "net6.0")] + [InlineData("record", "10", "net6.0")] [InlineData("record", "9.0")] [InlineData("record", "8.0", "netstandard2.0")] [InlineData("struct")] [InlineData("struct", "10")] + [InlineData("struct", "10", "net6.0")] [InlineData("struct", "9.0", "netstandard2.0")] [InlineData("enum")] + [InlineData("enum", "10", "net6.0")] [InlineData("enum", "", "net7.0")] [InlineData("enum", "9.0", "netstandard2.0")] public async void DotnetCSharpClassTemplatesTest( @@ -103,7 +105,7 @@ private string CreateTestProject( } new DotnetNewCommand(Log, projectArgs.ToArray()) - .WithVirtualHive() + .WithCustomHive(_fixture.HomeDirectory) .WithWorkingDirectory(workingDir) .Execute() .Should() From 952cd97e3267df8b3bee9bee9c797eeb6ad5b7a6 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 16:18:51 +0100 Subject: [PATCH 14/16] fix queue for helix machines --- .vsts-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 8ed07e8e332c..bf1e66e7813f 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -158,9 +158,9 @@ stages: pool: vmImage: 'macOS-latest' ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1015.Amd64.Open + helixTargetQueue: OSX.1100.Amd64.Open ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1015.Amd64 + helixTargetQueue: OSX.1100.Amd64 strategy: matrix: Build_Release: From 9193175dbac99d0d04e78800bfb415329136742d Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Fri, 23 Dec 2022 20:25:13 +0100 Subject: [PATCH 15/16] undo changes in CI --- .vsts-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index bf1e66e7813f..8ed07e8e332c 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -158,9 +158,9 @@ stages: pool: vmImage: 'macOS-latest' ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1100.Amd64.Open + helixTargetQueue: OSX.1015.Amd64.Open ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1100.Amd64 + helixTargetQueue: OSX.1015.Amd64 strategy: matrix: Build_Release: From 02540da04df3cb95c6440bd977e701feb5fb4a6c Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Sat, 24 Dec 2022 08:36:52 +0100 Subject: [PATCH 16/16] Upgrade helix queues --- .vsts-ci.yml | 4 ++-- .../AppWithLibraryAndRid/LibraryWithRid/NativeCode.cs | 1 + .../AppWithLibraryAndRid/LibraryWithRids/NativeCode.cs | 1 + src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs | 5 ++--- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.vsts-ci.yml b/.vsts-ci.yml index 8ed07e8e332c..bf1e66e7813f 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -158,9 +158,9 @@ stages: pool: vmImage: 'macOS-latest' ${{ if eq(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1015.Amd64.Open + helixTargetQueue: OSX.1100.Amd64.Open ${{ if ne(variables['System.TeamProject'], 'public') }}: - helixTargetQueue: OSX.1015.Amd64 + helixTargetQueue: OSX.1100.Amd64 strategy: matrix: Build_Release: diff --git a/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRid/NativeCode.cs b/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRid/NativeCode.cs index 74d353689152..e562081c9e4e 100644 --- a/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRid/NativeCode.cs +++ b/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRid/NativeCode.cs @@ -28,6 +28,7 @@ public static string InvokeNativeCodeAndReturnAString() case "'osx.10.12-x64'": case "'osx.10.14-x64'": case "'osx.10.15-x64'": + case "'osx.11.0-x64'": return Marshal.PtrToStringAnsi(MacNativeMethods.sqlite3_libversion()); case "'win10-x64'": case "'win10-x86'": diff --git a/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRids/NativeCode.cs b/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRids/NativeCode.cs index 68c89f361516..872f97e8f675 100644 --- a/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRids/NativeCode.cs +++ b/src/Assets/TestProjects/AppWithLibraryAndRid/LibraryWithRids/NativeCode.cs @@ -28,6 +28,7 @@ public static string InvokeNativeCodeAndReturnAString() case "'osx.10.12-x64'": case "'osx.10.14-x64'": case "'osx.10.15-x64'": + case "'osx.11.0-x64'": return Marshal.PtrToStringAnsi(MacNativeMethods.sqlite3_libversion()); case "'win10-x64'": case "'win10-x86'": diff --git a/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs b/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs index 5a6ab5f7f840..5e90ab17bfed 100644 --- a/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs +++ b/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs @@ -24,9 +24,8 @@ public class ToolsetInfo public const string LatestWinRuntimeIdentifier = "win10"; public const string LatestLinuxRuntimeIdentifier = "ubuntu.22.04"; - public const string LatestMacRuntimeIdentifier = "osx.10.15"; - public const string LatestRuntimeIdentifiers = $"{LatestWinRuntimeIdentifier}-x64;{LatestWinRuntimeIdentifier}-x86;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;osx.10.14-x64;{LatestMacRuntimeIdentifier}-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;ubuntu.18.04-x64;ubuntu.20.04-x64;{LatestLinuxRuntimeIdentifier}-x64;centos.9-x64;rhel.9-x64;debian.9-x64;fedora.37-x64;opensuse.42.3-x64;linux-musl-x64"; - + public const string LatestMacRuntimeIdentifier = "osx.11.0"; + public const string LatestRuntimeIdentifiers = $"{LatestWinRuntimeIdentifier}-x64;{LatestWinRuntimeIdentifier}-x86;osx.10.10-x64;osx.10.11-x64;osx.10.12-x64;osx.10.14-x64;osx.10.15-x64;{LatestMacRuntimeIdentifier}-x64;ubuntu.14.04-x64;ubuntu.16.04-x64;ubuntu.16.10-x64;ubuntu.18.04-x64;ubuntu.20.04-x64;{LatestLinuxRuntimeIdentifier}-x64;centos.9-x64;rhel.9-x64;debian.9-x64;fedora.37-x64;opensuse.42.3-x64;linux-musl-x64"; public string DotNetRoot { get; } public string DotNetHostPath { get; }