fix dotnet-compile.deps.json space in the path issue.
add test for space in the path with Preserve Compilation Context fix project.json update tests update test
This commit is contained in:
parent
c65a1700eb
commit
dd103cf6a8
3 changed files with 20 additions and 1 deletions
|
@ -115,7 +115,7 @@ namespace Microsoft.DotNet.Tools.Compiler
|
||||||
writer.Write(dependencyContext, fileStream);
|
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))
|
if (!AddNonCultureResources(context.ProjectFile, compilerArgs, intermediateOutputPath))
|
||||||
|
|
|
@ -88,6 +88,24 @@ namespace Microsoft.DotNet.Tools.Compiler.Tests
|
||||||
Assert.Contains("CA1018", result.StdErr);
|
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)
|
private void CopyProjectToTempDir(string projectDir, TempDirectory tempDir)
|
||||||
{
|
{
|
||||||
// copy all the files to temp dir
|
// copy all the files to temp dir
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
"../../TestAssets/TestProjects/TestLibraryWithAnalyzer/*",
|
"../../TestAssets/TestProjects/TestLibraryWithAnalyzer/*",
|
||||||
"../../TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/*",
|
"../../TestAssets/TestProjects/TestAppWithLibrary/TestLibrary/*",
|
||||||
"../../TestAssets/TestProjects/TestProjectWithCultureSpecificResource/*",
|
"../../TestAssets/TestProjects/TestProjectWithCultureSpecificResource/*",
|
||||||
|
"../../TestAssets/TestProjects/TestAppCompilationContext/**/*",
|
||||||
"../../TestAssets/TestProjects/global.json"
|
"../../TestAssets/TestProjects/global.json"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue