2020-05-06 09:59:23 -05:00
// 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.
2021-04-30 15:20:20 +03:00
using System ;
2023-02-14 14:06:02 +01:00
using System.Collections.Generic ;
2018-11-20 10:53:39 -08:00
using System.IO ;
2020-10-16 09:39:31 -07:00
using System.Linq ;
2020-04-21 20:54:31 +00:00
using System.Runtime.InteropServices ;
2018-11-20 10:53:39 -08:00
using System.Xml.Linq ;
2021-04-30 15:20:20 +03:00
using FluentAssertions ;
2018-11-20 10:53:39 -08:00
using Microsoft.DotNet.TestFramework ;
using Microsoft.DotNet.Tools.Test.Utilities ;
using Xunit ;
namespace EndToEnd.Tests
{
public class ProjectBuildTests : TestBase
{
[Fact]
public void ItCanNewRestoreBuildRunCleanMSBuildProject ( )
{
var directory = TestAssets . CreateTestDirectory ( ) ;
string projectDirectory = directory . FullName ;
2022-11-28 16:20:21 +01:00
string newArgs = "console --no-restore" ;
2018-11-20 10:53:39 -08:00
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
new RestoreCommand ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( )
. Should ( ) . Pass ( ) ;
new BuildCommand ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( )
. Should ( ) . Pass ( ) ;
var runCommand = new RunCommand ( )
2019-10-02 12:32:23 -07:00
. WithWorkingDirectory ( projectDirectory )
. ExecuteWithCapturedOutput ( )
2021-07-14 21:04:21 +03:00
. Should ( ) . Pass ( ) . And . HaveStdOutContaining ( "Hello, World!" ) ;
2018-11-20 10:53:39 -08:00
var binDirectory = new DirectoryInfo ( projectDirectory ) . Sub ( "bin" ) ;
binDirectory . Should ( ) . HaveFilesMatching ( "*.dll" , SearchOption . AllDirectories ) ;
new CleanCommand ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( )
. Should ( ) . Pass ( ) ;
binDirectory . Should ( ) . NotHaveFilesMatching ( "*.dll" , SearchOption . AllDirectories ) ;
}
2019-10-02 12:32:23 -07:00
[Fact]
2019-01-07 13:55:18 -08:00
public void ItCanRunAnAppUsingTheWebSdk ( )
{
var directory = TestAssets . CreateTestDirectory ( ) ;
string projectDirectory = directory . FullName ;
2022-11-28 16:20:21 +01:00
string newArgs = "console --no-restore" ;
2019-01-07 13:55:18 -08:00
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
string projectPath = Path . Combine ( projectDirectory , directory . Name + ".csproj" ) ;
var project = XDocument . Load ( projectPath ) ;
var ns = project . Root . Name . Namespace ;
project . Root . Attribute ( "Sdk" ) . Value = "Microsoft.NET.Sdk.Web" ;
project . Save ( projectPath ) ;
new BuildCommand ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( )
. Should ( ) . Pass ( ) ;
var runCommand = new RunCommand ( )
2019-10-02 12:32:23 -07:00
. WithWorkingDirectory ( projectDirectory )
. ExecuteWithCapturedOutput ( )
2021-07-14 21:04:21 +03:00
. Should ( ) . Pass ( ) . And . HaveStdOutContaining ( "Hello, World!" ) ;
2019-01-07 13:55:18 -08:00
}
2021-11-12 16:37:43 -08:00
[WindowsOnlyTheory]
2023-08-16 13:41:15 -07:00
// [InlineData("net6.0", true)]
2023-08-16 15:17:12 -07:00
// [InlineData("net6.0", false)]
2023-05-10 14:55:29 -07:00
[InlineData("current", true)]
[InlineData("current", false)]
public void ItCanPublishArm64Winforms ( string TargetFramework , bool selfContained )
2020-10-16 09:39:31 -07:00
{
DirectoryInfo directory = TestAssets . CreateTestDirectory ( ) ;
string projectDirectory = directory . FullName ;
2021-11-19 13:34:59 -08:00
string TargetFrameworkParameter = "" ;
2020-10-16 09:39:31 -07:00
2021-11-19 13:34:59 -08:00
if ( TargetFramework ! = "current" )
{
2021-11-22 13:05:25 -08:00
TargetFrameworkParameter = $"-f {TargetFramework}" ;
2021-11-19 13:34:59 -08:00
}
string newArgs = $"winforms {TargetFrameworkParameter} --no-restore" ;
2020-10-16 09:39:31 -07:00
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
2023-05-10 14:55:29 -07:00
string selfContainedArgs = selfContained ? " --self-contained" : "" ;
string publishArgs = "-r win-arm64" + selfContainedArgs ;
2020-10-16 09:39:31 -07:00
new PublishCommand ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( publishArgs )
. Should ( ) . Pass ( ) ;
2021-09-16 23:14:23 +00:00
2020-10-16 09:39:31 -07:00
var selfContainedPublishDir = new DirectoryInfo ( projectDirectory )
2023-01-30 20:53:16 -06:00
. Sub ( "bin" ) . Sub ( TargetFramework ! = "current" ? "Debug" : "Release" ) . GetDirectories ( ) . FirstOrDefault ( )
2020-10-16 09:39:31 -07:00
. Sub ( "win-arm64" ) . Sub ( "publish" ) ;
2023-05-10 14:55:29 -07:00
if ( selfContained )
{
selfContainedPublishDir . Should ( ) . HaveFilesMatching ( "System.Windows.Forms.dll" , SearchOption . TopDirectoryOnly ) ;
}
2020-10-16 09:39:31 -07:00
selfContainedPublishDir . Should ( ) . HaveFilesMatching ( $"{directory.Name}.dll" , SearchOption . TopDirectoryOnly ) ;
}
2021-09-16 23:14:23 +00:00
2021-11-12 16:37:43 -08:00
[WindowsOnlyTheory]
2023-08-16 13:41:15 -07:00
// [InlineData("net6.0", true)]
2023-08-16 15:17:12 -07:00
// [InlineData("net6.0", false)]
2023-05-10 14:55:29 -07:00
[InlineData("current", true)]
[InlineData("current", false)]
public void ItCanPublishArm64Wpf ( string TargetFramework , bool selfContained )
2020-10-16 09:39:31 -07:00
{
DirectoryInfo directory = TestAssets . CreateTestDirectory ( ) ;
string projectDirectory = directory . FullName ;
2021-11-19 13:34:59 -08:00
string TargetFrameworkParameter = "" ;
2020-10-16 09:39:31 -07:00
2021-11-19 13:34:59 -08:00
if ( TargetFramework ! = "current" )
{
2021-11-22 13:05:25 -08:00
TargetFrameworkParameter = $"-f {TargetFramework}" ;
2021-11-19 13:34:59 -08:00
}
string newArgs = $"wpf {TargetFrameworkParameter} --no-restore" ;
2020-10-16 09:39:31 -07:00
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
2023-05-10 14:55:29 -07:00
string selfContainedArgs = selfContained ? " --self-contained" : "" ;
string publishArgs = "-r win-arm64" + selfContainedArgs ;
2020-10-16 09:39:31 -07:00
new PublishCommand ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( publishArgs )
2021-01-22 15:49:06 -08:00
. Should ( ) . Pass ( ) ;
var selfContainedPublishDir = new DirectoryInfo ( projectDirectory )
2023-01-30 20:53:16 -06:00
. Sub ( "bin" ) . Sub ( TargetFramework ! = "current" ? "Debug" : "Release" ) . GetDirectories ( ) . FirstOrDefault ( )
2021-01-22 15:49:06 -08:00
. Sub ( "win-arm64" ) . Sub ( "publish" ) ;
2023-05-10 14:55:29 -07:00
if ( selfContained )
{
selfContainedPublishDir . Should ( ) . HaveFilesMatching ( "PresentationCore.dll" , SearchOption . TopDirectoryOnly ) ;
selfContainedPublishDir . Should ( ) . HaveFilesMatching ( "PresentationNative_*.dll" , SearchOption . TopDirectoryOnly ) ;
}
2021-01-22 15:49:06 -08:00
selfContainedPublishDir . Should ( ) . HaveFilesMatching ( $"{directory.Name}.dll" , SearchOption . TopDirectoryOnly ) ;
2020-10-16 09:39:31 -07:00
}
2018-11-20 10:53:39 -08:00
[Theory]
2021-04-30 15:20:20 +03:00
// microsoft.dotnet.common.projectemplates templates
2018-11-20 10:53:39 -08:00
[InlineData("console")]
2021-04-30 15:20:20 +03:00
[InlineData("console", "C#")]
[InlineData("console", "VB")]
[InlineData("console", "F#")]
2018-11-20 10:53:39 -08:00
[InlineData("classlib")]
2021-04-30 15:20:20 +03:00
[InlineData("classlib", "C#")]
[InlineData("classlib", "VB")]
[InlineData("classlib", "F#")]
2018-11-20 10:53:39 -08:00
[InlineData("mstest")]
[InlineData("nunit")]
2018-11-20 18:55:46 -08:00
[InlineData("web")]
2019-05-20 12:40:08 -07:00
[InlineData("mvc")]
2021-04-30 15:20:20 +03:00
public void ItCanBuildTemplates ( string templateName , string language = "" )
{
TestTemplateCreateAndBuild ( templateName , language : language ) ;
}
2021-06-11 12:37:13 +03:00
/// <summary>
/// The test checks if dotnet new shows curated list correctly after the SDK installation and template insertion.
/// </summary>
[Fact]
public void DotnetNewShowsCuratedListCorrectly ( )
{
2021-07-02 13:32:30 +03:00
string locale = System . Threading . Thread . CurrentThread . CurrentUICulture . Name ;
2021-09-16 23:14:23 +00:00
if ( ! string . IsNullOrWhiteSpace ( locale )
2021-07-02 13:32:30 +03:00
& & ! locale . StartsWith ( "en" , StringComparison . OrdinalIgnoreCase ) )
{
Console . WriteLine ( $"[{nameof(DotnetNewShowsCuratedListCorrectly)}] CurrentUICulture: {locale}" ) ;
Console . WriteLine ( $"[{nameof(DotnetNewShowsCuratedListCorrectly)}] Test is skipped as it supports only 'en' or invariant culture." ) ;
return ;
}
2021-06-11 12:37:13 +03:00
string expectedOutput =
@ "[\-\s]+
2023-12-04 15:41:28 +00:00
[\w \.\(\)] + blazor \ s + \ [ C # \ ] [ \ w \ \ / ] +
2023-10-11 12:02:22 -05:00
[\w \.\(\)] + classlib \ s + \ [ C # \ ] , F # , VB [ \ w \ \ / ] +
[\w \.\(\)] + console \ s + \ [ C # \ ] , F # , VB [ \ w \ \ / ] +
2021-06-11 12:37:13 +03:00
";
if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
{
expectedOutput + =
2023-10-11 12:02:22 -05:00
@ "[\w \.\(\)]+winforms\s+\[C#\],VB[\w\ \/]+
[\w \.\(\)] + \ wpf \ s + \ [ C # \ ] , VB [ \ w \ \ / ] +
2021-06-11 12:37:13 +03:00
";
}
//list should end with new line
expectedOutput + = Environment . NewLine ;
new NewCommandShim ( )
. Execute ( )
. Should ( ) . Pass ( )
. And . HaveStdOutMatching ( expectedOutput ) ;
}
2021-04-30 15:20:20 +03:00
[Theory]
// microsoft.dotnet.common.itemtemplates templates
[InlineData("globaljson")]
[InlineData("nugetconfig")]
[InlineData("webconfig")]
[InlineData("gitignore")]
[InlineData("tool-manifest")]
[InlineData("sln")]
public void ItCanCreateItemTemplate ( string templateName )
2018-11-20 19:43:45 -08:00
{
2021-04-30 15:20:20 +03:00
DirectoryInfo directory = TestAssets . CreateTestDirectory ( identifier : templateName ) ;
string projectDirectory = directory . FullName ;
2022-11-28 16:20:21 +01:00
string newArgs = $"{templateName}" ;
2021-04-30 15:20:20 +03:00
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
//check if the template created files
Assert . True ( directory . Exists ) ;
Assert . True ( directory . EnumerateFileSystemInfos ( ) . Any ( ) ) ;
2022-12-06 17:29:15 -08:00
// delete test directory for some tests so we aren't leaving behind non-compliant nuget files
if ( templateName . Equals ( "nugetconfig" ) )
{
directory . Delete ( true ) ;
}
2018-11-20 19:43:45 -08:00
}
2023-02-14 14:06:02 +01:00
[Theory]
// microsoft.dotnet.common.itemtemplates templates
[InlineData("class")]
[InlineData("struct")]
[InlineData("enum")]
[InlineData("record")]
[InlineData("interface")]
[InlineData("class", "C#")]
[InlineData("class", "VB")]
[InlineData("struct", "VB")]
[InlineData("enum", "VB")]
[InlineData("interface", "VB")]
public void ItCanCreateItemTemplateWithProjectRestriction ( string templateName , string language = "" )
{
var languageExtensionMap = new Dictionary < string , string > ( )
{
{ "" , ".cs" } ,
{ "C#" , ".cs" } ,
{ "VB" , ".vb" }
} ;
DirectoryInfo directory = InstantiateProjectTemplate ( "classlib" , language , withNoRestore : false ) ;
string projectDirectory = directory . FullName ;
string expectedItemName = $"TestItem_{templateName}" ;
string newArgs = $"{templateName} --name {expectedItemName} --debug:ephemeral-hive" ;
if ( ! string . IsNullOrWhiteSpace ( language ) )
{
newArgs + = $" --language {language}" ;
}
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
//check if the template created files
Assert . True ( directory . Exists ) ;
Assert . True ( directory . EnumerateFileSystemInfos ( ) . Any ( ) ) ;
Assert . True ( directory . GetFile ( $"{expectedItemName}.{languageExtensionMap[language]}" ) ! = null ) ;
}
2018-11-20 19:43:45 -08:00
[WindowsOnlyTheory]
2022-09-06 17:53:47 -07:00
[InlineData("wpf")]
[InlineData("winforms")]
2018-11-20 19:43:45 -08:00
public void ItCanBuildDesktopTemplates ( string templateName )
{
2021-04-30 15:20:20 +03:00
TestTemplateCreateAndBuild ( templateName ) ;
2018-11-20 19:43:45 -08:00
}
2019-10-02 12:32:23 -07:00
[WindowsOnlyTheory]
2022-09-06 17:53:47 -07:00
[InlineData("wpf")]
2019-10-02 12:32:23 -07:00
public void ItCanBuildDesktopTemplatesSelfContained ( string templateName )
{
2023-05-10 14:55:29 -07:00
TestTemplateCreateAndBuild ( templateName , selfContained : true ) ;
2019-10-02 12:32:23 -07:00
}
[Theory]
[InlineData("web")]
[InlineData("console")]
public void ItCanBuildTemplatesSelfContained ( string templateName )
{
2021-04-30 15:20:20 +03:00
TestTemplateCreateAndBuild ( templateName , selfContained : true ) ;
}
/// <summary>
/// The test checks if the template creates the template for correct framework by default.
2021-09-16 23:14:23 +00:00
/// For .NET 6 the templates should create the projects targeting net6.0
2021-04-30 15:20:20 +03:00
/// </summary>
[Theory]
[InlineData("console")]
[InlineData("console", "C#")]
[InlineData("console", "VB")]
[InlineData("console", "F#")]
[InlineData("classlib")]
[InlineData("classlib", "C#")]
[InlineData("classlib", "VB")]
[InlineData("classlib", "F#")]
[InlineData("worker")]
[InlineData("worker", "C#")]
[InlineData("worker", "F#")]
[InlineData("mstest")]
[InlineData("mstest", "C#")]
[InlineData("mstest", "VB")]
[InlineData("mstest", "F#")]
[InlineData("nunit")]
[InlineData("nunit", "C#")]
[InlineData("nunit", "VB")]
[InlineData("nunit", "F#")]
[InlineData("xunit")]
[InlineData("xunit", "C#")]
[InlineData("xunit", "VB")]
[InlineData("xunit", "F#")]
[InlineData("blazorwasm")]
[InlineData("web")]
[InlineData("web", "C#")]
[InlineData("web", "F#")]
[InlineData("mvc")]
[InlineData("mvc", "C#")]
[InlineData("mvc", "F#")]
[InlineData("webapi")]
[InlineData("webapi", "C#")]
[InlineData("webapi", "F#")]
[InlineData("webapp")]
[InlineData("razorclasslib")]
public void ItCanCreateAndBuildTemplatesWithDefaultFramework ( string templateName , string language = "" )
{
2022-01-13 12:35:14 -08:00
string framework = DetectExpectedDefaultFramework ( templateName ) ;
2023-05-10 14:55:29 -07:00
TestTemplateCreateAndBuild ( templateName , selfContained : false , language : language , framework : framework ) ;
2021-04-30 15:20:20 +03:00
}
/// <summary>
/// [Windows only tests]
/// The test checks if the template creates the template for correct framework by default.
/// For .NET 6 the templates should create the projects targeting net6.0.
/// </summary>
[WindowsOnlyTheory]
[InlineData("wpf")]
[InlineData("wpf", "C#")]
[InlineData("wpf", "VB")]
[InlineData("wpflib")]
[InlineData("wpflib", "C#")]
[InlineData("wpflib", "VB")]
[InlineData("wpfcustomcontrollib")]
[InlineData("wpfcustomcontrollib", "C#")]
[InlineData("wpfcustomcontrollib", "VB")]
[InlineData("wpfusercontrollib")]
[InlineData("wpfusercontrollib", "C#")]
[InlineData("wpfusercontrollib", "VB")]
[InlineData("winforms")]
[InlineData("winforms", "C#")]
[InlineData("winforms", "VB")]
[InlineData("winformslib")]
[InlineData("winformslib", "C#")]
[InlineData("winformslib", "VB")]
[InlineData("winformscontrollib")]
[InlineData("winformscontrollib", "C#")]
[InlineData("winformscontrollib", "VB")]
public void ItCanCreateAndBuildTemplatesWithDefaultFramework_Windows ( string templateName , string language = "" )
{
2021-12-17 21:28:08 +00:00
string framework = DetectExpectedDefaultFramework ( templateName ) ;
2023-05-10 14:55:29 -07:00
TestTemplateCreateAndBuild ( templateName , selfContained : false , language : language , framework : $"{framework}-windows" ) ;
2021-04-30 15:20:20 +03:00
}
/// <summary>
/// [project is not built on linux-musl]
/// The test checks if the template creates the template for correct framework by default.
/// For .NET 6 the templates should create the projects targeting net6.0.
/// </summary>
[Theory]
[InlineData("grpc")]
public void ItCanCreateAndBuildTemplatesWithDefaultFramework_DisableBuildOnLinuxMusl ( string templateName )
{
2022-09-06 17:53:47 -07:00
string framework = DetectExpectedDefaultFramework ( templateName ) ;
2021-04-30 15:20:20 +03:00
2023-08-15 02:20:42 +00:00
if ( RuntimeInformation . RuntimeIdentifier . StartsWith ( "linux-musl" ) )
2021-04-30 15:20:20 +03:00
{
TestTemplateCreateAndBuild ( templateName , build : false , framework : framework ) ;
}
else
{
TestTemplateCreateAndBuild ( templateName , selfContained : true , framework : framework ) ;
}
}
2021-12-17 21:28:08 +00:00
private static string DetectExpectedDefaultFramework ( string template = "" )
2021-04-30 15:20:20 +03:00
{
string dotnetFolder = Path . GetDirectoryName ( RepoDirectoriesProvider . DotnetUnderTest ) ;
string [ ] runtimeFolders = Directory . GetDirectories ( Path . Combine ( dotnetFolder , "shared" , "Microsoft.NETCore.App" ) ) ;
int latestMajorVersion = runtimeFolders . Select ( folder = > int . Parse ( Path . GetFileName ( folder ) . Split ( '.' ) . First ( ) ) ) . Max ( ) ;
2022-08-25 15:07:25 -07:00
if ( latestMajorVersion = = 8 )
2021-04-30 15:20:20 +03:00
{
2022-01-13 11:23:58 -08:00
return $"net{latestMajorVersion}.0" ;
2021-04-30 15:20:20 +03:00
}
2021-12-17 21:28:08 +00:00
2021-04-30 15:20:20 +03:00
throw new Exception ( "Unsupported version of SDK" ) ;
2019-10-02 12:32:23 -07:00
}
2022-12-06 17:29:15 -08:00
private static void TestTemplateCreateAndBuild ( string templateName , bool build = true , bool selfContained = false , string language = "" , string framework = "" , bool deleteTestDirectory = false )
2018-11-20 10:53:39 -08:00
{
2023-02-14 14:06:02 +01:00
DirectoryInfo directory = InstantiateProjectTemplate ( templateName , language ) ;
2018-11-20 10:53:39 -08:00
string projectDirectory = directory . FullName ;
2021-04-30 15:20:20 +03:00
if ( ! string . IsNullOrWhiteSpace ( framework ) )
{
//check if MSBuild TargetFramework property for *proj is set to expected framework
string expectedExtension = language switch
{
"C#" = > "*.csproj" ,
"F#" = > "*.fsproj" ,
"VB" = > "*.vbproj" ,
_ = > "*.csproj"
} ;
string projectFile = Directory . GetFiles ( projectDirectory , expectedExtension ) . Single ( ) ;
XDocument projectXml = XDocument . Load ( projectFile ) ;
XNamespace ns = projectXml . Root . Name . Namespace ;
Assert . Equal ( framework , projectXml . Root . Element ( ns + "PropertyGroup" ) . Element ( ns + "TargetFramework" ) . Value ) ;
}
if ( build )
{
2023-05-10 14:55:29 -07:00
string buildArgs = selfContained ? $"-r {RuntimeInformation.RuntimeIdentifier} --self-contained" : "" ;
2021-04-30 15:20:20 +03:00
if ( ! string . IsNullOrWhiteSpace ( framework ) )
{
buildArgs + = $" --framework {framework}" ;
}
2023-01-30 20:53:16 -06:00
2021-10-21 13:26:34 -07:00
// Remove this (or formalize it) after https://github.com/dotnet/installer/issues/12479 is resolved.
if ( language = = "F#" )
{
buildArgs + = $" /p:_NETCoreSdkIsPreview=true" ;
}
2023-01-30 20:53:16 -06:00
2021-04-30 15:20:20 +03:00
string dotnetRoot = Path . GetDirectoryName ( RepoDirectoriesProvider . DotnetUnderTest ) ;
new BuildCommand ( )
. WithEnvironmentVariable ( "PATH" , dotnetRoot ) // override PATH since razor rely on PATH to find dotnet
. WithWorkingDirectory ( projectDirectory )
. Execute ( buildArgs )
. Should ( ) . Pass ( ) ;
}
2022-12-06 17:29:15 -08:00
// delete test directory for some tests so we aren't leaving behind non-compliant package files
if ( deleteTestDirectory )
{
directory . Delete ( true ) ;
}
2018-11-20 10:53:39 -08:00
}
2023-02-14 14:06:02 +01:00
private static DirectoryInfo InstantiateProjectTemplate ( string templateName , string language = "" , bool withNoRestore = true )
{
DirectoryInfo directory = TestAssets . CreateTestDirectory (
identifier : string . IsNullOrWhiteSpace ( language )
? templateName
: $"{templateName}[{language}]" ) ;
string projectDirectory = directory . FullName ;
string newArgs = $"{templateName} --debug:ephemeral-hive {(withNoRestore ? " - - no - restore " : " ")}" ;
if ( ! string . IsNullOrWhiteSpace ( language ) )
{
newArgs + = $" --language {language}" ;
}
new NewCommandShim ( )
. WithWorkingDirectory ( projectDirectory )
. Execute ( newArgs )
. Should ( ) . Pass ( ) ;
return directory ;
}
2018-11-20 10:53:39 -08:00
}
}