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/eng/Version.Details.xml b/eng/Version.Details.xml index bf441a46d013..8a2b5e02d82f 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -1,13 +1,13 @@ - + https://github.com/dotnet/templating - 01c412e0fe40730c2b96a0366b520af707e4291d + 0e4dd290455badd78fcf862cf420a2d8fe5cf039 - + https://github.com/dotnet/templating - 01c412e0fe40730c2b96a0366b520af707e4291d + 0e4dd290455badd78fcf862cf420a2d8fe5cf039 @@ -306,4 +306,4 @@ - + \ No newline at end of file diff --git a/eng/Versions.props b/eng/Versions.props index a72c764d1e75..7e46b79648b1 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.22623.4 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) - 7.0.200-alpha.1.22621.2 + 7.0.200-alpha.1.22623.4 $(MicrosoftTemplateEngineAbstractionsPackageVersion) $(MicrosoftTemplateEngineAbstractionsPackageVersion) @@ -201,4 +201,4 @@ <_DotNetHiveRoot Condition="!HasTrailingSlash('$(_DotNetHiveRoot)')">$(_DotNetHiveRoot)/ $(_DotNetHiveRoot)dotnet$(ExeExtension) - + \ No newline at end of file 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/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; } 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.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/class/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/TestItem1.cs new file mode 100644 index 000000000000..396ac96a7017 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=9.0.targetFramework=netstandard2.0.verified/class/TestItem1.cs @@ -0,0 +1,9 @@ +using System; + +namespace ClassLib +{ + public class TestItem1 + { + + } +} 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..7adbba1f468a --- /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 @@ +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.langVersion=preview.targetFramework=net7.0.verified/class/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.0.verified/class/TestItem1.cs new file mode 100644 index 000000000000..14b142daa879 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.class.langVersion=preview.targetFramework=net7.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=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.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=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.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.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/TestItem1.cs new file mode 100644 index 000000000000..3f2b630659f0 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.langVersion=9.0.targetFramework=netstandard2.0.verified/enum/TestItem1.cs @@ -0,0 +1,7 @@ +namespace ClassLib +{ + public enum TestItem1 + { + + } +} 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.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.targetFramework=net7.0.verified/enum/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.0.verified/enum/TestItem1.cs new file mode 100644 index 000000000000..37d0cdb89439 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.targetFramework=net7.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.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 new file mode 100644 index 000000000000..26f7130c2e3b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.enum.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.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=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.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.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 new file mode 100644 index 000000000000..7530e29c35e8 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.0.verified/interface/TestItem1.cs @@ -0,0 +1,9 @@ +using System; + +namespace ClassLib +{ + public interface TestItem1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.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 new file mode 100644 index 000000000000..b33c356fab08 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.langVersion=9.targetFramework=netstandard2.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.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.verified/interface/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/interface/TestItem1.cs new file mode 100644 index 000000000000..478d75986a45 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.interface.verified/interface/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public interface TestItem1 +{ + +} 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=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.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=8.0.targetFramework=netstandard2.0.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/TestItem1.cs new file mode 100644 index 000000000000..5cc0b777b41a --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=8.0.targetFramework=netstandard2.0.verified/record/TestItem1.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 TestItem1 + { + + } +} 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.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.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/record/TestItem1.cs new file mode 100644 index 000000000000..6141cdd5c892 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/record/TestItem1.cs @@ -0,0 +1,7 @@ +namespace ClassLib +{ + public record TestItem1 + { + + } +} diff --git a/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.0.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.langVersion=9.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.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.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.verified/record/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/record/TestItem1.cs new file mode 100644 index 000000000000..3fac67ecd67b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.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.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.verified/std-streams/stdout.txt new file mode 100644 index 000000000000..19b646ad3f8b --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.record.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/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=10.verified/std-streams/stdout.txt b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.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.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.verified/struct/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/struct/TestItem1.cs new file mode 100644 index 000000000000..8f8d5afdd9cc --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=10.verified/struct/TestItem1.cs @@ -0,0 +1,5 @@ +namespace ClassLib; +public struct TestItem1 +{ + +} 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 new file mode 100644 index 000000000000..a818dbe58324 --- /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 @@ +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/TestItem1.cs b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/TestItem1.cs new file mode 100644 index 000000000000..6bfad4fafcb8 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/Approvals/DotnetCSharpClassTemplatesTest.struct.langVersion=9.0.targetFramework=netstandard2.0.verified/struct/TestItem1.cs @@ -0,0 +1,9 @@ +using System; + +namespace ClassLib +{ + public struct TestItem1 + { + + } +} 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/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/DotnetClassTemplateTests.cs b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs new file mode 100644 index 000000000000..216c70975ad7 --- /dev/null +++ b/src/Tests/dotnet-new.Tests/DotnetClassTemplateTests.cs @@ -0,0 +1,141 @@ +// 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 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 +{ + 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", "preview", "net7.0")] + [InlineData("class", "10.0", "net6.0")] + [InlineData("class", "9.0", "netstandard2.0")] + [InlineData("interface")] + [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", "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( + string templateShortName, + string langVersion = "", + string targetFramework = "") + { + // prevents logging a welcome message from sdk installation + Dictionary environmentUnderTest = new() { ["DOTNET_NOLOGO"] = false.ToString() }; + TestContext.Current.AddTestEnvironmentVariables(environmentUnderTest); + + string folderName = GetFolderName(templateShortName, langVersion, targetFramework); + string workingDir = CreateTemporaryFolder($"{nameof(DotnetCSharpClassTemplatesTest)}.{folderName}"); + string projectName = CreateTestProject(workingDir, langVersion, targetFramework); + + TemplateVerifierOptions options = new TemplateVerifierOptions(templateName: templateShortName) + { + SnapshotsDirectory = "Approvals", + VerifyCommandOutput = true, + TemplateSpecificArgs = new[] { "--name", "TestItem1" }, + VerificationExcludePatterns = new[] + { + "*/stderr.txt", + "*\\stderr.txt", + // restored files in obj folder + $"*{projectName}.csproj.*", + "*project.*.*" + }, + SettingsDirectory = _fixture.HomeDirectory, + DotnetExecutablePath = TestContext.Current.ToolsetUnderTest.DotNetHostPath, + DoNotAppendTemplateArgsToScenarioName = true, + DoNotPrependTemplateNameToScenarioName = true, + ScenarioName = folderName, + OutputDirectory = workingDir, + EnsureEmptyOutputDirectory = false + } + .WithCustomEnvironment(environmentUnderTest); + + VerificationEngine engine = new VerificationEngine(_logger); + await engine.Execute(options) + .ConfigureAwait(false); + } + + private string CreateTestProject( + string workingDir, + string langVersion, + string targetFramework) + { + 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()) + .WithCustomHive(_fixture.HomeDirectory) + .WithWorkingDirectory(workingDir) + .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); + } + + 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(); + } + } +} 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(); 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..acb742e0e079 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Class-CSharp/.template.config/template.json @@ -0,0 +1,67 @@ +{ + "$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", + "preferDefaultName": true, + "defaultName": "Class1", + "primaryOutputs": [ + { + "path": "Class1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "ImplicitUsings": { + "type": "bind", + "binding": "msbuild:ImplicitUsings", + "datatype": "string", + "defaultValue": "disable" + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion", + "dataType": "string" + }, + "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": "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..3d1445272247 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/.template.config/template.json @@ -0,0 +1,61 @@ +{ + "$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": "Enum1", + "preferDefaultName": true, + "defaultName": "Enum1", + "primaryOutputs": [ + { + "path": "Enum1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion", + "dataType": "string" + }, + "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": "csharp10orLater == \"true\"" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Enum1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Enum1.cs new file mode 100644 index 000000000000..e690ee3d05dd --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Enum-CSharp/Enum1.cs @@ -0,0 +1,15 @@ +#if (csharpFeature_FileScopedNamespaces) +namespace Company.ClassLibrary1; +public enum Enum1 +{ + +} +#else +namespace Company.ClassLibrary1 +{ + public enum Enum1 + { + + } +} +#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..949b7be0f66a --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Interface-CSharp/.template.config/template.json @@ -0,0 +1,67 @@ +{ + "$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", + "preferDefaultName": true, + "defaultName": "Interface1", + "primaryOutputs": [ + { + "path": "Interface1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "ImplicitUsings": { + "type": "bind", + "binding": "msbuild:ImplicitUsings", + "datatype": "string", + "defaultValue": "disable" + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion", + "dataType": "string" + }, + "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": "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..f925e0516195 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/.template.config/template.json @@ -0,0 +1,87 @@ +{ + "$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": "Record1", + "preferDefaultName": true, + "defaultName": "Record1", + "primaryOutputs": [ + { + "path": "Record1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "TargetFramework": { + "type": "bind", + "binding": "msbuild:TargetFramework" + }, + "net5orLater": { + "type": "generated", + "generator": "regexMatch", + "datatype": "bool", + "parameters": { + "pattern": "^(net5.0|net6.0|net7.0|net8.0)$*", + "source": "TargetFramework" + } + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion", + "dataType": "string" + }, + "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": "csharp10orLater == \"true\"" + }, + "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/Record1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Record1.cs new file mode 100644 index 000000000000..530e427646a5 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Record-CSharp/Record1.cs @@ -0,0 +1,25 @@ +#if (csharpFeature_RecordClass) +namespace Company.ClassLibrary1; +public record class Record1 +{ + +} +#elseif (csharpFeature_Record) +namespace Company.ClassLibrary1 +{ + public record Record1 + { + + } +} +#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 Record1 + { + + } +} +#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..3bd2e8883ff1 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/.template.config/template.json @@ -0,0 +1,67 @@ +{ + "$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": "Struct1", + "preferDefaultName": true, + "defaultName": "Struct1", + "primaryOutputs": [ + { + "path": "Struct1.cs" + } + ], + "symbols": { + "DefaultNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "Company.ClassLibrary1" + }, + "ImplicitUsings": { + "type": "bind", + "binding": "msbuild:ImplicitUsings", + "datatype": "string", + "defaultValue": "disable" + }, + "langVersion": { + "type": "bind", + "binding": "msbuild:LangVersion", + "dataType": "string" + }, + "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": "csharp10orLater == \"true\"" + } + }, + "constraints": { + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + } + } +} diff --git a/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Struct1.cs b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Struct1.cs new file mode 100644 index 000000000000..73c919187561 --- /dev/null +++ b/template_feed/Microsoft.DotNet.Common.ItemTemplates/content/Struct-CSharp/Struct1.cs @@ -0,0 +1,19 @@ +#if (ImplicitUsings != "enable") +using System; + +#endif +#if (csharpFeature_FileScopedNamespaces) +namespace Company.ClassLibrary1; +public struct Struct1 +{ + +} +#else +namespace Company.ClassLibrary1 +{ + public struct Struct1 + { + + } +} +#endif