Revert "Fix MSBuild invocation to quote property option values."

This reverts commit f9b939fe89.

That fix caused a regression that prevented a single `/property` option to
define multiple properties using the `/property:First=foo;Second=bar` syntax.

Users that want literal semicolons in the property values should use escaped
quotes around the property value, e.g. `/property:Prop='"foo;bar;baz"'`.

Fixes #9369.
This commit is contained in:
Peter Huene 2018-05-31 21:20:25 -07:00
parent c9d457a6b9
commit 98dd811aa8
No known key found for this signature in database
GPG key ID: E1D265D820213D6A
11 changed files with 99 additions and 128 deletions

View file

@ -26,11 +26,11 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
}
[Theory]
[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\""")]
[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} -property:ComposeDir=\\\"{Path.GetFullPath(path)}\\\"");
.GetProcessStartInfo().Arguments.Should().Be($"{ExpectedPrefix} -property:ComposeDir={Path.GetFullPath(path)}");
}
}
}