dotnet build fails with xmlDoc = true and spaces in the path.

Need to quote the xmlDoc argument to the csc compiler.

Fix #2600
This commit is contained in:
Eric Erhardt 2016-04-27 15:43:12 -05:00
parent 1f0910ebcc
commit 2ed81240fa
6 changed files with 58 additions and 2 deletions

View file

@ -0,0 +1,24 @@
// 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.
using System;
namespace TestLibrary
{
public static class Helper
{
/// <summary>
/// Gets the message from the helper. This comment is here to help test XML documentation file generation, please do not remove it.
/// </summary>
/// <returns>A message</returns>
public static string GetMessage()
{
return "This string came from the test library!";
}
public static void SayHi()
{
Console.WriteLine("Hello there!");
}
}
}

View file

@ -0,0 +1,12 @@
{
"version": "1.0.0-*",
"compilationOptions": {
"xmlDoc": true
},
"dependencies": {
"NETStandard.Library": "1.5.0-rc2-24027"
},
"frameworks": {
"netstandard1.3": {}
}
}

View file

@ -189,7 +189,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Csc
if (options.GenerateXmlDocumentation == true)
{
commonArgs.Add($"-doc:{Path.ChangeExtension(outputName, "xml")}");
commonArgs.Add($"-doc:\"{Path.ChangeExtension(outputName, "xml")}\"");
}
if (options.EmitEntryPoint != true)

View file

@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public class TestCommand
{
protected string _command;
private string _baseDirectory;
public string WorkingDirectory { get; set; }
@ -33,6 +33,12 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
#endif
}
public TestCommand WithWorkingDirectory(string workingDirectory)
{
WorkingDirectory = workingDirectory;
return this;
}
public virtual CommandResult Execute(string args = "")
{
var commandPath = _command;

View file

@ -42,5 +42,19 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
.Should()
.Pass();
}
[Fact]
public void It_builds_projects_with_spaces_in_the_path()
{
var testInstance = TestAssetsManager
.CreateTestInstance("TestLibrary With Spaces")
.WithLockFiles();
new BuildCommand("")
.WithWorkingDirectory(testInstance.TestRoot)
.ExecuteWithCapturedOutput()
.Should()
.Pass();
}
}
}