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:
parent
1f0910ebcc
commit
2ed81240fa
6 changed files with 58 additions and 2 deletions
24
TestAssets/TestProjects/TestLibrary With Spaces/Helper.cs
Normal file
24
TestAssets/TestProjects/TestLibrary With Spaces/Helper.cs
Normal 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!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
12
TestAssets/TestProjects/TestLibrary With Spaces/project.json
Normal file
12
TestAssets/TestProjects/TestLibrary With Spaces/project.json
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"version": "1.0.0-*",
|
||||||
|
"compilationOptions": {
|
||||||
|
"xmlDoc": true
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"NETStandard.Library": "1.5.0-rc2-24027"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.3": {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -189,7 +189,7 @@ namespace Microsoft.DotNet.Tools.Compiler.Csc
|
||||||
|
|
||||||
if (options.GenerateXmlDocumentation == true)
|
if (options.GenerateXmlDocumentation == true)
|
||||||
{
|
{
|
||||||
commonArgs.Add($"-doc:{Path.ChangeExtension(outputName, "xml")}");
|
commonArgs.Add($"-doc:\"{Path.ChangeExtension(outputName, "xml")}\"");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options.EmitEntryPoint != true)
|
if (options.EmitEntryPoint != true)
|
||||||
|
|
|
@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||||
public class TestCommand
|
public class TestCommand
|
||||||
{
|
{
|
||||||
protected string _command;
|
protected string _command;
|
||||||
|
|
||||||
private string _baseDirectory;
|
private string _baseDirectory;
|
||||||
|
|
||||||
public string WorkingDirectory { get; set; }
|
public string WorkingDirectory { get; set; }
|
||||||
|
@ -33,6 +33,12 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public TestCommand WithWorkingDirectory(string workingDirectory)
|
||||||
|
{
|
||||||
|
WorkingDirectory = workingDirectory;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual CommandResult Execute(string args = "")
|
public virtual CommandResult Execute(string args = "")
|
||||||
{
|
{
|
||||||
var commandPath = _command;
|
var commandPath = _command;
|
||||||
|
|
|
@ -42,5 +42,19 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
||||||
.Should()
|
.Should()
|
||||||
.Pass();
|
.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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue