Replacing the short form version of implicit msbuild parameters with longform ones.
This commit is contained in:
parent
10289504a8
commit
b1fca8c4d2
31 changed files with 173 additions and 161 deletions
|
@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
return null;
|
||||
}
|
||||
|
||||
return $"-p:RuntimeIdentifier={_runtime}";
|
||||
return $"-property:RuntimeIdentifier={_runtime}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
return null;
|
||||
}
|
||||
|
||||
return $"-p:RuntimeIdentifier={_runtime}";
|
||||
return $"-property:RuntimeIdentifier={_runtime}";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,25 +9,25 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
{
|
||||
public class GivenDotnetBuildInvocation
|
||||
{
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -m -v:m";
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -maxcpucount -verbosity:m";
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, "-t:Build")]
|
||||
[InlineData(new string[] { "-o", "foo" }, "-t:Build -p:OutputPath=foo")]
|
||||
[InlineData(new string[] { "-p:Verbosity=diag" }, "-t:Build -p:Verbosity=diag")]
|
||||
[InlineData(new string[] { "--output", "foo" }, "-t:Build -p:OutputPath=foo")]
|
||||
[InlineData(new string[] { "-o", "foo1 foo2" }, "-t:Build \"-p:OutputPath=foo1 foo2\"")]
|
||||
[InlineData(new string[] { "--no-incremental" }, "-t:Rebuild")]
|
||||
[InlineData(new string[] { "-r", "rid" }, "-t:Build -p:RuntimeIdentifier=rid")]
|
||||
[InlineData(new string[] { "--runtime", "rid" }, "-t:Build -p:RuntimeIdentifier=rid")]
|
||||
[InlineData(new string[] { "-c", "config" }, "-t:Build -p:Configuration=config")]
|
||||
[InlineData(new string[] { "--configuration", "config" }, "-t:Build -p:Configuration=config")]
|
||||
[InlineData(new string[] { "--version-suffix", "mysuffix" }, "-t:Build -p:VersionSuffix=mysuffix")]
|
||||
[InlineData(new string[] { "--no-dependencies" }, "-t:Build -p:BuildProjectReferences=false")]
|
||||
[InlineData(new string[] { "-v", "diag" }, "-t:Build -verbosity:diag")]
|
||||
[InlineData(new string[] { "--verbosity", "diag" }, "-t:Build -verbosity:diag")]
|
||||
[InlineData(new string[] { }, "-target:Build")]
|
||||
[InlineData(new string[] { "-o", "foo" }, "-target:Build -property:OutputPath=foo")]
|
||||
[InlineData(new string[] { "-property:Verbosity=diag" }, "-target:Build -property:Verbosity=diag")]
|
||||
[InlineData(new string[] { "--output", "foo" }, "-target:Build -property:OutputPath=foo")]
|
||||
[InlineData(new string[] { "-o", "foo1 foo2" }, "-target:Build \"-property:OutputPath=foo1 foo2\"")]
|
||||
[InlineData(new string[] { "--no-incremental" }, "-target:Rebuild")]
|
||||
[InlineData(new string[] { "-r", "rid" }, "-target:Build -property:RuntimeIdentifier=rid")]
|
||||
[InlineData(new string[] { "--runtime", "rid" }, "-target:Build -property:RuntimeIdentifier=rid")]
|
||||
[InlineData(new string[] { "-c", "config" }, "-target:Build -property:Configuration=config")]
|
||||
[InlineData(new string[] { "--configuration", "config" }, "-target:Build -property:Configuration=config")]
|
||||
[InlineData(new string[] { "--version-suffix", "mysuffix" }, "-target:Build -property:VersionSuffix=mysuffix")]
|
||||
[InlineData(new string[] { "--no-dependencies" }, "-target:Build -property:BuildProjectReferences=false")]
|
||||
[InlineData(new string[] { "-v", "diag" }, "-target:Build -verbosity:diag")]
|
||||
[InlineData(new string[] { "--verbosity", "diag" }, "-target:Build -verbosity:diag")]
|
||||
[InlineData(new string[] { "--no-incremental", "-o", "myoutput", "-r", "myruntime", "-v", "diag", "/ArbitrarySwitchForMSBuild" },
|
||||
"-t:Rebuild -p:OutputPath=myoutput -p:RuntimeIdentifier=myruntime -verbosity:diag /ArbitrarySwitchForMSBuild")]
|
||||
"-target:Rebuild -property:OutputPath=myoutput -property:RuntimeIdentifier=myruntime -verbosity:diag /ArbitrarySwitchForMSBuild")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
{
|
||||
expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}");
|
||||
|
@ -39,14 +39,14 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
|
||||
command.GetProcessStartInfo()
|
||||
.Arguments.Should()
|
||||
.Be($"{ExpectedPrefix} -restore -clp:Summary{expectedAdditionalArgs}");
|
||||
.Be($"{ExpectedPrefix} -restore -consoleloggerparameters:Summary{expectedAdditionalArgs}");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { "-f", "tfm" }, "-t:Restore", "-t:Build -p:TargetFramework=tfm")]
|
||||
[InlineData(new string[] { "-f", "tfm" }, "-target:Restore", "-target:Build -property:TargetFramework=tfm")]
|
||||
[InlineData(new string[] { "-o", "myoutput", "-f", "tfm", "-v", "diag", "/ArbitrarySwitchForMSBuild" },
|
||||
"-t:Restore -p:OutputPath=myoutput -verbosity:diag /ArbitrarySwitchForMSBuild",
|
||||
"-t:Build -p:OutputPath=myoutput -p:TargetFramework=tfm -verbosity:diag /ArbitrarySwitchForMSBuild")]
|
||||
"-target:Restore -property:OutputPath=myoutput -verbosity:diag /ArbitrarySwitchForMSBuild",
|
||||
"-target:Build -property:OutputPath=myoutput -property:TargetFramework=tfm -verbosity:diag /ArbitrarySwitchForMSBuild")]
|
||||
public void MsbuildInvocationIsCorrectForSeparateRestore(
|
||||
string[] args,
|
||||
string expectedAdditionalArgsForRestore,
|
||||
|
@ -63,7 +63,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
|
||||
command.GetProcessStartInfo()
|
||||
.Arguments.Should()
|
||||
.Be($"{ExpectedPrefix} -nologo -clp:Summary{expectedAdditionalArgs}");
|
||||
.Be($"{ExpectedPrefix} -nologo -consoleloggerparameters:Summary{expectedAdditionalArgs}");
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,24 +10,24 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
{
|
||||
public class GivenDotnetCleanInvocation
|
||||
{
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -m -v:m -v:normal -t:Clean";
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -maxcpucount -verbosity:m -verbosity:normal -target:Clean";
|
||||
|
||||
[Fact]
|
||||
public void ItAddsProjectToMsbuildInvocation()
|
||||
{
|
||||
var msbuildPath = "<msbuildpath>";
|
||||
CleanCommand.FromArgs(new string[] { "<project>" }, msbuildPath)
|
||||
.GetProcessStartInfo().Arguments.Should().Be("exec <msbuildpath> -m -v:m -v:normal <project> -t:Clean");
|
||||
.GetProcessStartInfo().Arguments.Should().Be("exec <msbuildpath> -maxcpucount -verbosity:m -verbosity:normal <project> -target:Clean");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, "")]
|
||||
[InlineData(new string[] { "-o", "<output>" }, "-p:OutputPath=<output>")]
|
||||
[InlineData(new string[] { "--output", "<output>" }, "-p:OutputPath=<output>")]
|
||||
[InlineData(new string[] { "-f", "<framework>" }, "-p:TargetFramework=<framework>")]
|
||||
[InlineData(new string[] { "--framework", "<framework>" }, "-p:TargetFramework=<framework>")]
|
||||
[InlineData(new string[] { "-c", "<configuration>" }, "-p:Configuration=<configuration>")]
|
||||
[InlineData(new string[] { "--configuration", "<configuration>" }, "-p:Configuration=<configuration>")]
|
||||
[InlineData(new string[] { "-o", "<output>" }, "-property:OutputPath=<output>")]
|
||||
[InlineData(new string[] { "--output", "<output>" }, "-property:OutputPath=<output>")]
|
||||
[InlineData(new string[] { "-f", "<framework>" }, "-property:TargetFramework=<framework>")]
|
||||
[InlineData(new string[] { "--framework", "<framework>" }, "-property:TargetFramework=<framework>")]
|
||||
[InlineData(new string[] { "-c", "<configuration>" }, "-property:Configuration=<configuration>")]
|
||||
[InlineData(new string[] { "--configuration", "<configuration>" }, "-property:Configuration=<configuration>")]
|
||||
[InlineData(new string[] { "-v", "diag" }, "-verbosity:diag")]
|
||||
[InlineData(new string[] { "--verbosity", "diag" }, "-verbosity:diag")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
|
|
|
@ -86,8 +86,12 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
result.StdOut.Should().Contain(MSBuildHelpText);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WhenRestoreSourcesStartsWithUnixPathThenHttpsSourceIsParsedCorrectly()
|
||||
[Theory]
|
||||
[InlineData("/p")]
|
||||
[InlineData("/property")]
|
||||
[InlineData("-p")]
|
||||
[InlineData("-property")]
|
||||
public void WhenRestoreSourcesStartsWithUnixPathThenHttpsSourceIsParsedCorrectly(string propertyFormat)
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
|
@ -104,7 +108,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
|
||||
var result = new DotnetCommand()
|
||||
.WithWorkingDirectory(root)
|
||||
.Execute($"msbuild /p:RestoreSources={somePathThatExists};https://api.nuget.org/v3/index.json /t:restore LibraryWithUnresolvablePackageReference.csproj");
|
||||
.Execute($"msbuild {propertyFormat}:RestoreSources={somePathThatExists};https://api.nuget.org/v3/index.json /t:restore LibraryWithUnresolvablePackageReference.csproj");
|
||||
|
||||
_output.WriteLine($"[STDOUT]\n{result.StdOut}\n[STDERR]\n{result.StdErr}");
|
||||
|
||||
|
|
|
@ -11,21 +11,21 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
{
|
||||
public class GivenDotnetPackInvocation
|
||||
{
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -m -v:m -restore -t:pack";
|
||||
const string ExpectedNoBuildPrefix = "exec <msbuildpath> -m -v:m -t:pack";
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -maxcpucount -verbosity:m -restore -target:pack";
|
||||
const string ExpectedNoBuildPrefix = "exec <msbuildpath> -maxcpucount -verbosity:m -target:pack";
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, "")]
|
||||
[InlineData(new string[] { "-o", "<packageoutputpath>" }, "-p:PackageOutputPath=<packageoutputpath>")]
|
||||
[InlineData(new string[] { "--output", "<packageoutputpath>" }, "-p:PackageOutputPath=<packageoutputpath>")]
|
||||
[InlineData(new string[] { "--no-build" }, "-p:NoBuild=true")]
|
||||
[InlineData(new string[] { "--include-symbols" }, "-p:IncludeSymbols=true")]
|
||||
[InlineData(new string[] { "--include-source" }, "-p:IncludeSource=true")]
|
||||
[InlineData(new string[] { "-c", "<config>" }, "-p:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--configuration", "<config>" }, "-p:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--version-suffix", "<versionsuffix>" }, "-p:VersionSuffix=<versionsuffix>")]
|
||||
[InlineData(new string[] { "-s" }, "-p:Serviceable=true")]
|
||||
[InlineData(new string[] { "--serviceable" }, "-p:Serviceable=true")]
|
||||
[InlineData(new string[] { "-o", "<packageoutputpath>" }, "-property:PackageOutputPath=<packageoutputpath>")]
|
||||
[InlineData(new string[] { "--output", "<packageoutputpath>" }, "-property:PackageOutputPath=<packageoutputpath>")]
|
||||
[InlineData(new string[] { "--no-build" }, "-property:NoBuild=true")]
|
||||
[InlineData(new string[] { "--include-symbols" }, "-property:IncludeSymbols=true")]
|
||||
[InlineData(new string[] { "--include-source" }, "-property:IncludeSource=true")]
|
||||
[InlineData(new string[] { "-c", "<config>" }, "-property:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--configuration", "<config>" }, "-property:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--version-suffix", "<versionsuffix>" }, "-property:VersionSuffix=<versionsuffix>")]
|
||||
[InlineData(new string[] { "-s" }, "-property:Serviceable=true")]
|
||||
[InlineData(new string[] { "--serviceable" }, "-property:Serviceable=true")]
|
||||
[InlineData(new string[] { "-v", "diag" }, "-verbosity:diag")]
|
||||
[InlineData(new string[] { "--verbosity", "diag" }, "-verbosity:diag")]
|
||||
[InlineData(new string[] { "<project>" }, "<project>")]
|
||||
|
|
|
@ -20,18 +20,18 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
this.output = output;
|
||||
}
|
||||
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -m -v:m";
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -maxcpucount -verbosity:m";
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, "")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, "-p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, "-p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "-o", "<publishdir>" }, "-p:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "--output", "<publishdir>" }, "-p:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "-c", "<config>" }, "-p:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--configuration", "<config>" }, "-p:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--version-suffix", "<versionsuffix>" }, "-p:VersionSuffix=<versionsuffix>")]
|
||||
[InlineData(new string[] { "--manifest", "<manifestfiles>" }, "-p:TargetManifestFiles=<manifestfiles>")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, "-property:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, "-property:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "-o", "<publishdir>" }, "-property:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "--output", "<publishdir>" }, "-property:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "-c", "<config>" }, "-property:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--configuration", "<config>" }, "-property:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--version-suffix", "<versionsuffix>" }, "-property:VersionSuffix=<versionsuffix>")]
|
||||
[InlineData(new string[] { "--manifest", "<manifestfiles>" }, "-property:TargetManifestFiles=<manifestfiles>")]
|
||||
[InlineData(new string[] { "-v", "minimal" }, "-verbosity:minimal")]
|
||||
[InlineData(new string[] { "--verbosity", "minimal" }, "-verbosity:minimal")]
|
||||
[InlineData(new string[] { "<project>" }, "<project>")]
|
||||
|
@ -49,12 +49,12 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
|
||||
command.GetProcessStartInfo()
|
||||
.Arguments.Should()
|
||||
.Be($"{ExpectedPrefix} -restore -t:Publish{expectedAdditionalArgs}");
|
||||
.Be($"{ExpectedPrefix} -restore -target:Publish{expectedAdditionalArgs}");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, "-p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, "-p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, "-property:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, "-property:TargetFramework=<tfm>")]
|
||||
public void MsbuildInvocationIsCorrectForSeparateRestore(string[] args, string expectedAdditionalArgs)
|
||||
{
|
||||
expectedAdditionalArgs = (string.IsNullOrEmpty(expectedAdditionalArgs) ? "" : $" {expectedAdditionalArgs}");
|
||||
|
@ -65,25 +65,25 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
command.SeparateRestoreCommand
|
||||
.GetProcessStartInfo()
|
||||
.Arguments.Should()
|
||||
.Be($"{ExpectedPrefix} -t:Restore");
|
||||
.Be($"{ExpectedPrefix} -target:Restore");
|
||||
|
||||
command.GetProcessStartInfo()
|
||||
.Arguments.Should()
|
||||
.Be($"{ExpectedPrefix} -nologo -t:Publish{expectedAdditionalArgs}");
|
||||
.Be($"{ExpectedPrefix} -nologo -target:Publish{expectedAdditionalArgs}");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, "")]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, "-p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, "-p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, "-p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, "-p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "-o", "<publishdir>" }, "-p:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "--output", "<publishdir>" }, "-p:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "-c", "<config>" }, "-p:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--configuration", "<config>" }, "-p:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--version-suffix", "<versionsuffix>" }, "-p:VersionSuffix=<versionsuffix>")]
|
||||
[InlineData(new string[] { "--manifest", "<manifestfiles>" }, "-p:TargetManifestFiles=<manifestfiles>")]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, "-property:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, "-property:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, "-property:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, "-property:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "-o", "<publishdir>" }, "-property:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "--output", "<publishdir>" }, "-property:PublishDir=<publishdir>")]
|
||||
[InlineData(new string[] { "-c", "<config>" }, "-property:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--configuration", "<config>" }, "-property:Configuration=<config>")]
|
||||
[InlineData(new string[] { "--version-suffix", "<versionsuffix>" }, "-property:VersionSuffix=<versionsuffix>")]
|
||||
[InlineData(new string[] { "--manifest", "<manifestfiles>" }, "-property:TargetManifestFiles=<manifestfiles>")]
|
||||
[InlineData(new string[] { "-v", "minimal" }, "-verbosity:minimal")]
|
||||
[InlineData(new string[] { "--verbosity", "minimal" }, "-verbosity:minimal")]
|
||||
public void OptionForwardingIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
|
|
|
@ -11,22 +11,22 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
public class GivenDotnetRestoreInvocation
|
||||
{
|
||||
private const string ExpectedPrefix =
|
||||
"exec <msbuildpath> -m -v:m -nologo -t:Restore";
|
||||
"exec <msbuildpath> -maxcpucount -verbosity:m -nologo -target:Restore";
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { }, "")]
|
||||
[InlineData(new string[] { "-s", "<source>" }, "-p:RestoreSources=<source>")]
|
||||
[InlineData(new string[] { "--source", "<source>" }, "-p:RestoreSources=<source>")]
|
||||
[InlineData(new string[] { "-s", "<source0>", "-s", "<source1>" }, "-p:RestoreSources=<source0>%3B<source1>")]
|
||||
[InlineData(new string[] { "-r", "<runtime>" }, "-p:RuntimeIdentifiers=<runtime>")]
|
||||
[InlineData(new string[] { "--runtime", "<runtime>" }, "-p:RuntimeIdentifiers=<runtime>")]
|
||||
[InlineData(new string[] { "-r", "<runtime0>", "-r", "<runtime1>" }, "-p:RuntimeIdentifiers=<runtime0>%3B<runtime1>")]
|
||||
[InlineData(new string[] { "--packages", "<packages>" }, "-p:RestorePackagesPath=<packages>")]
|
||||
[InlineData(new string[] { "--disable-parallel" }, "-p:RestoreDisableParallel=true")]
|
||||
[InlineData(new string[] { "--configfile", "<config>" }, "-p:RestoreConfigFile=<config>")]
|
||||
[InlineData(new string[] { "--no-cache" }, "-p:RestoreNoCache=true")]
|
||||
[InlineData(new string[] { "--ignore-failed-sources" }, "-p:RestoreIgnoreFailedSources=true")]
|
||||
[InlineData(new string[] { "--no-dependencies" }, "-p:RestoreRecursive=false")]
|
||||
[InlineData(new string[] { "-s", "<source>" }, "-property:RestoreSources=<source>")]
|
||||
[InlineData(new string[] { "--source", "<source>" }, "-property:RestoreSources=<source>")]
|
||||
[InlineData(new string[] { "-s", "<source0>", "-s", "<source1>" }, "-property:RestoreSources=<source0>%3B<source1>")]
|
||||
[InlineData(new string[] { "-r", "<runtime>" }, "-property:RuntimeIdentifiers=<runtime>")]
|
||||
[InlineData(new string[] { "--runtime", "<runtime>" }, "-property:RuntimeIdentifiers=<runtime>")]
|
||||
[InlineData(new string[] { "-r", "<runtime0>", "-r", "<runtime1>" }, "-property:RuntimeIdentifiers=<runtime0>%3B<runtime1>")]
|
||||
[InlineData(new string[] { "--packages", "<packages>" }, "-property:RestorePackagesPath=<packages>")]
|
||||
[InlineData(new string[] { "--disable-parallel" }, "-property:RestoreDisableParallel=true")]
|
||||
[InlineData(new string[] { "--configfile", "<config>" }, "-property:RestoreConfigFile=<config>")]
|
||||
[InlineData(new string[] { "--no-cache" }, "-property:RestoreNoCache=true")]
|
||||
[InlineData(new string[] { "--ignore-failed-sources" }, "-property:RestoreIgnoreFailedSources=true")]
|
||||
[InlineData(new string[] { "--no-dependencies" }, "-property:RestoreRecursive=false")]
|
||||
[InlineData(new string[] { "-v", "minimal" }, @"-verbosity:minimal")]
|
||||
[InlineData(new string[] { "--verbosity", "minimal" }, @"-verbosity:minimal")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
|
|
|
@ -11,8 +11,8 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
{
|
||||
public class GivenDotnetStoreInvocation
|
||||
{
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -m -v:m -t:ComposeStore <project>";
|
||||
static readonly string[] ArgsPrefix = { "-m", "<project>" };
|
||||
const string ExpectedPrefix = "exec <msbuildpath> -maxcpucount -verbosity:m -target:ComposeStore <project>";
|
||||
static readonly string[] ArgsPrefix = { "--manifest", "<project>" };
|
||||
|
||||
[Theory]
|
||||
[InlineData("-m")]
|
||||
|
@ -26,11 +26,11 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, @"-p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, @"-p:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, @"-p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, @"-p:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--manifest", "one.xml", "--manifest", "two.xml", "--manifest", "three.xml" }, @"-p:AdditionalProjects=one.xml%3Btwo.xml%3Bthree.xml")]
|
||||
[InlineData(new string[] { "-f", "<tfm>" }, @"-property:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "--framework", "<tfm>" }, @"-property:TargetFramework=<tfm>")]
|
||||
[InlineData(new string[] { "-r", "<rid>" }, @"-property:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--runtime", "<rid>" }, @"-property:RuntimeIdentifier=<rid>")]
|
||||
[InlineData(new string[] { "--manifest", "one.xml", "--manifest", "two.xml", "--manifest", "three.xml" }, @"-property:AdditionalProjects=one.xml%3Btwo.xml%3Bthree.xml")]
|
||||
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
|
||||
{
|
||||
args = ArgsPrefix.Concat(args).ToArray();
|
||||
|
@ -51,7 +51,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
|
|||
|
||||
var msbuildPath = "<msbuildpath>";
|
||||
StoreCommand.FromArgs(args, msbuildPath)
|
||||
.GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix} -p:ComposeDir={Path.GetFullPath(path)}");
|
||||
.GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix} -property:ComposeDir={Path.GetFullPath(path)}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue