Merge pull request #1477 from dotnet/brthor/deps-space-fix
fix dotnet-compile.deps.json space in the path issue.
This commit is contained in:
commit
8d939fc7e1
3 changed files with 20 additions and 1 deletions
|
@ -115,7 +115,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
|||
writer.Write(dependencyContext, fileStream);
|
||||
}
|
||||
|
||||
compilerArgs.Add($"--resource:{depsJsonFile},{context.ProjectFile.Name}.deps.json");
|
||||
compilerArgs.Add($"--resource:\"{depsJsonFile}\",{context.ProjectFile.Name}.deps.json");
|
||||
}
|
||||
|
||||
if (!AddNonCultureResources(context.ProjectFile, compilerArgs, intermediateOutputPath))
|
||||
|
|
|
@ -88,6 +88,24 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
|
|||
Assert.Contains("CA1018", result.StdErr);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CompilingAppWithPreserveCompilationContextWithSpaceInThePathShouldSucceed()
|
||||
{
|
||||
var root = Temp.CreateDirectory();
|
||||
|
||||
var spaceBufferDirectory = root.CreateDirectory("space directory");
|
||||
var testAppDir = spaceBufferDirectory.CreateDirectory("TestAppCompilationContext");
|
||||
|
||||
CopyProjectToTempDir(Path.Combine(_testProjectsRoot, "TestAppCompilationContext"), testAppDir);
|
||||
|
||||
var testProjectDir = Path.Combine(_testProjectsRoot, "TestAppCompilationContext", "TestApp");
|
||||
var testProject = Path.Combine(testProjectDir, "project.json");
|
||||
|
||||
var buildCommand = new BuildCommand(testProject);
|
||||
|
||||
buildCommand.Execute().Should().Pass();
|
||||
}
|
||||
|
||||
private void CopyProjectToTempDir(string projectDir, TempDirectory tempDir)
|
||||
{
|
||||
// copy all the files to temp dir
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
"../../TestAssets/TestProjects/TestLibraryWithAnalyzer/*",
|
||||
"../../TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/*",
|
||||
"../../TestAssets/TestProjects/TestProjectWithCultureSpecificResource/*",
|
||||
"../../TestAssets/TestProjects/TestAppCompilationContext/**/*",
|
||||
"../../TestAssets/TestProjects/global.json"
|
||||
],
|
||||
|
||||
|
|
Loading…
Reference in a new issue