Merge branch 'release/2.1.4xx' into merges/release/2.1.3xx-to-release/2.1.4xx
This commit is contained in:
commit
355b08befd
8 changed files with 55 additions and 52 deletions
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue