Ensure test apps use the same SDK as Razor
This commit is contained in:
parent
14fc427068
commit
bd03c16ee7
|
|
@ -50,6 +50,7 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
|
||||
CreateDirectoryProps(projectRoot, binariesRoot, destinationPath);
|
||||
CreateDirectoryTargets(destinationPath);
|
||||
CopyGlobalJson(solutionRoot, destinationPath);
|
||||
|
||||
return new ProjectDirectory(destinationPath);
|
||||
}
|
||||
|
|
@ -112,6 +113,18 @@ namespace Microsoft.AspNetCore.Razor.Design.IntegrationTests
|
|||
";
|
||||
File.WriteAllText(Path.Combine(projectRoot, "Directory.Build.targets"), text);
|
||||
}
|
||||
|
||||
void CopyGlobalJson(string solutionRoot, string projectRoot)
|
||||
{
|
||||
var srcGlobalJson = Path.Combine(solutionRoot, "global.json");
|
||||
if (!File.Exists(srcGlobalJson))
|
||||
{
|
||||
throw new InvalidOperationException("global.json at the root of the repository could not be found. Run './build /t:Noop' at the repository root and re-run these tests.");
|
||||
}
|
||||
|
||||
var destinationGlobalJson = Path.Combine(projectRoot, "global.json");
|
||||
File.Copy(srcGlobalJson, destinationGlobalJson);
|
||||
}
|
||||
}
|
||||
|
||||
private ProjectDirectory(string directoryPath)
|
||||
|
|
|
|||
Loading…
Reference in New Issue