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:
Zlatko Knezevic 2016-03-28 21:40:15 -07:00
parent e11fd2f910
commit c066ef1540
6 changed files with 67 additions and 3 deletions

View file

@ -0,0 +1,11 @@
using System;
namespace ClassLibrary
{
public class Class1
{
public void Method1()
{
}
}
}

View file

@ -0,0 +1,9 @@
{
"version": "1.0.0-*",
"dependencies": {
"NETStandard.Library": "1.5.0-rc3-24126-00"
},
"frameworks": {
"netstandard1.5": {}
}
}

View file

@ -0,0 +1,14 @@
using System;
using Xunit;
namespace Tests
{
public class Tests
{
[Fact]
public void Test1()
{
Assert.True(true);
}
}
}

View file

@ -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"
]
}
}
}

View file

@ -84,9 +84,9 @@ namespace Microsoft.DotNet.Tools.New
var dotnetNew = new NewCommand();
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" } };
string languageValue = lang.Value() ?? csharp.Name;
var language = new[] { csharp, fsharp }

View file

@ -5,6 +5,8 @@
"embed": {
"include": [
"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/CSharp_Web.zip"
]
@ -13,7 +15,9 @@
"exclude": [
"commands/dotnet-new/CSharp_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/**"
]
}
},