Merge branch 'release/2.1.4xx' into merges/release/2.1.3xx-to-release/2.1.4xx

This commit is contained in:
Livar 2018-04-24 14:20:28 -07:00 committed by GitHub
commit 355b08befd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 55 additions and 52 deletions

View file

@ -57,19 +57,19 @@ namespace Microsoft.DotNet.Tools.Tests.ComponentMocks
}
public void Restore(FilePath project,
DirectoryPath assetJsonOutput,
FilePath? nugetConfig = null,
string verbosity = null)
{
string packageId;
VersionRange versionRange;
string targetFramework;
DirectoryPath assetJsonOutput;
try
{
// The mock installer wrote a mock project file containing id:version:framework
// The mock installer wrote a mock project file containing id;version;framework;stageDirectory
var contents = _fileSystem.File.ReadAllText(project.Value);
var tokens = contents.Split(':');
if (tokens.Length != 3)
var tokens = contents.Split(';');
if (tokens.Length != 4)
{
throw new ToolPackageException(LocalizableStrings.ToolInstallationRestoreFailed);
}
@ -77,6 +77,7 @@ namespace Microsoft.DotNet.Tools.Tests.ComponentMocks
packageId = tokens[0];
versionRange = VersionRange.Parse(tokens[1]);
targetFramework = tokens[2];
assetJsonOutput = new DirectoryPath(tokens[3]);
}
catch (IOException)
{

View file

@ -63,12 +63,11 @@ namespace Microsoft.DotNet.Tools.Tests.ComponentMocks
// Write a fake project with the requested package id, version, and framework
_fileSystem.File.WriteAllText(
tempProject.Value,
$"{packageId}:{versionRange?.ToString("S", new VersionRangeFormatter()) ?? "*"}:{targetFramework}");
$"{packageId};{versionRange?.ToString("S", new VersionRangeFormatter()) ?? "*"};{targetFramework};{stageDirectory.Value}");
// Perform a restore on the fake project
_projectRestorer.Restore(
tempProject,
stageDirectory,
nugetConfig,
verbosity);