Add C# Lib and xunittest templates
Adding the C# lib and xunittest templates to `dotnet new`. These need to be invoked with the `dotnet new -t lib` and `dotnet new -t xunittest` keywords respectively.
This commit is contained in:
parent
e11fd2f910
commit
c066ef1540
6 changed files with 67 additions and 3 deletions
11
src/dotnet/commands/dotnet-new/CSharp_Lib/Library.cs
Normal file
11
src/dotnet/commands/dotnet-new/CSharp_Lib/Library.cs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace ClassLibrary
|
||||||
|
{
|
||||||
|
public class Class1
|
||||||
|
{
|
||||||
|
public void Method1()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.5.0-rc3-24126-00"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.5": {}
|
||||||
|
}
|
||||||
|
}
|
14
src/dotnet/commands/dotnet-new/CSharp_xunittest/Tests.cs
Normal file
14
src/dotnet/commands/dotnet-new/CSharp_xunittest/Tests.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using Xunit;
|
||||||
|
|
||||||
|
namespace Tests
|
||||||
|
{
|
||||||
|
public class Tests
|
||||||
|
{
|
||||||
|
[Fact]
|
||||||
|
public void Test1()
|
||||||
|
{
|
||||||
|
Assert.True(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
|
||||||
|
"dependencies": {
|
||||||
|
"System.Runtime.Serialization.Primitives": "4.1.1-rc2-24008",
|
||||||
|
"xunit": "2.1.0",
|
||||||
|
"dotnet-test-xunit": "1.0.0-dev-140469-38"
|
||||||
|
},
|
||||||
|
|
||||||
|
"testRunner": "xunit",
|
||||||
|
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp1.0": {
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"type": "platform",
|
||||||
|
"version": "1.0.0-rc3-004312"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"imports": [
|
||||||
|
"dotnet5.4",
|
||||||
|
"portable-net451+win8"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -84,7 +84,7 @@ namespace Microsoft.DotNet.Tools.New
|
||||||
var dotnetNew = new NewCommand();
|
var dotnetNew = new NewCommand();
|
||||||
app.OnExecute(() => {
|
app.OnExecute(() => {
|
||||||
|
|
||||||
var csharp = new { Name = "C#", Alias = new[] { "c#", "cs", "csharp" }, TemplatePrefix = "CSharp", Templates = new[] { "Console", "Web" } };
|
var csharp = new { Name = "C#", Alias = new[] { "c#", "cs", "csharp" }, TemplatePrefix = "CSharp", Templates = new[] { "Console", "Web", "Lib", "xunittest" } };
|
||||||
var fsharp = new { Name = "F#", Alias = new[] { "f#", "fs", "fsharp" }, TemplatePrefix = "FSharp", Templates = new[] { "Console" } };
|
var fsharp = new { Name = "F#", Alias = new[] { "f#", "fs", "fsharp" }, TemplatePrefix = "FSharp", Templates = new[] { "Console" } };
|
||||||
|
|
||||||
string languageValue = lang.Value() ?? csharp.Name;
|
string languageValue = lang.Value() ?? csharp.Name;
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
"embed": {
|
"embed": {
|
||||||
"include": [
|
"include": [
|
||||||
"commands/dotnet-new/CSharp_Console.zip",
|
"commands/dotnet-new/CSharp_Console.zip",
|
||||||
|
"commands/dotnet-new/CSharp_Lib.zip",
|
||||||
|
"commands/dotnet-new/CSharp_xunittest.zip",
|
||||||
"commands/dotnet-new/FSharp_Console.zip",
|
"commands/dotnet-new/FSharp_Console.zip",
|
||||||
"commands/dotnet-new/CSharp_Web.zip"
|
"commands/dotnet-new/CSharp_Web.zip"
|
||||||
]
|
]
|
||||||
|
@ -13,7 +15,9 @@
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"commands/dotnet-new/CSharp_Console/**",
|
"commands/dotnet-new/CSharp_Console/**",
|
||||||
"commands/dotnet-new/FSharp_Console/**",
|
"commands/dotnet-new/FSharp_Console/**",
|
||||||
"commands/dotnet-new/CSharp_Web/**"
|
"commands/dotnet-new/CSharp_Web/**",
|
||||||
|
"commands/dotnet-new/CSharp_Lib/**",
|
||||||
|
"commands/dotnet-new/CSharp_xunittest/**"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue