Merge pull request #2717 from eerhardt/Spaces
dotnet build fails with xmlDoc = true and spaces in the path.
This commit is contained in:
commit
a9621eb469
6 changed files with 69 additions and 3 deletions
24
TestAssets/TestProjects/TestLibraryWithXmlDoc/Helper.cs
Normal file
24
TestAssets/TestProjects/TestLibraryWithXmlDoc/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/TestLibraryWithXmlDoc/project.json
Normal file
12
TestAssets/TestProjects/TestLibraryWithXmlDoc/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.5": {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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;
|
||||||
|
|
|
@ -22,7 +22,7 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
||||||
|
|
||||||
var buildCommand = new BuildCommand("");
|
var buildCommand = new BuildCommand("");
|
||||||
buildCommand.WorkingDirectory = testProjectDirectory;
|
buildCommand.WorkingDirectory = testProjectDirectory;
|
||||||
|
|
||||||
buildCommand.ExecuteWithCapturedOutput()
|
buildCommand.ExecuteWithCapturedOutput()
|
||||||
.Should()
|
.Should()
|
||||||
.Pass();
|
.Pass();
|
||||||
|
@ -42,5 +42,29 @@ namespace Microsoft.DotNet.Tools.Builder.Tests
|
||||||
.Should()
|
.Should()
|
||||||
.Pass();
|
.Pass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void It_builds_projects_with_xmlDoc_and_spaces_in_the_path()
|
||||||
|
{
|
||||||
|
var testInstance = TestAssetsManager
|
||||||
|
.CreateTestInstance("TestLibraryWithXmlDoc", identifier: "With Space")
|
||||||
|
.WithLockFiles();
|
||||||
|
|
||||||
|
testInstance.TestRoot.Should().Contain(" ");
|
||||||
|
|
||||||
|
var output = new DirectoryInfo(Path.Combine(testInstance.TestRoot, "output"));
|
||||||
|
|
||||||
|
new BuildCommand("", output: output.FullName, framework: DefaultLibraryFramework)
|
||||||
|
.WithWorkingDirectory(testInstance.TestRoot)
|
||||||
|
.ExecuteWithCapturedOutput()
|
||||||
|
.Should()
|
||||||
|
.Pass();
|
||||||
|
|
||||||
|
output.Should().HaveFiles(new[]
|
||||||
|
{
|
||||||
|
"TestLibraryWithXmlDoc.dll",
|
||||||
|
"TestLibraryWithXmlDoc.xml"
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue