Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Commit

Permalink
Use directory separator char to find shared files
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfowl committed Mar 17, 2015
1 parent 2860f7c commit 30ad729
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,20 @@ public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkNam
{
return null;
}

var package = FindCandidate(libraryRange.Name, libraryRange.VersionRange);

if (package != null)
{
LockFileFrameworkGroup group = null;
IEnumerable<LibraryDependency> dependencies;
bool resolved = true;
if(package.LockFileLibrary != null)
if (package.LockFileLibrary != null)
{
// If we have a lock file, it MUST have an exact match for this target
// framework
group = package.LockFileLibrary.FrameworkGroups.FirstOrDefault(f => f.TargetFramework == targetFramework);
if(group == null)
if (group == null)
{
resolved = false;
dependencies = Enumerable.Empty<LibraryDependency>();
Expand All @@ -94,7 +94,7 @@ public LibraryDescription GetDescription(LibraryRange libraryRange, FrameworkNam
},
Type = "Package",
Dependencies = dependencies,
Resolved = resolved
Resolved = resolved
};
}

Expand Down Expand Up @@ -231,7 +231,7 @@ public void Initialize(IEnumerable<LibraryDescription> packages, FrameworkName t
}

var group = packageInfo.LockFileLibrary.FrameworkGroups.FirstOrDefault(g => g.TargetFramework == targetFramework);
if(group == null)
if (group == null)
{
continue;
}
Expand Down Expand Up @@ -318,7 +318,7 @@ public ILibraryExport GetLibraryExport(ILibraryKey target)

var references = new Dictionary<string, IMetadataReference>(StringComparer.OrdinalIgnoreCase);

if(!TryPopulateMetadataReferences(description, target.TargetFramework, references))
if (!TryPopulateMetadataReferences(description, target.TargetFramework, references))
{
return null;
}
Expand All @@ -337,7 +337,7 @@ public ILibraryExport GetLibraryExport(ILibraryKey target)
private bool TryPopulateMetadataReferences(PackageDescription description, FrameworkName targetFramework, IDictionary<string, IMetadataReference> paths)
{
var group = description.Package.LockFileLibrary.FrameworkGroups.FirstOrDefault(f => f.TargetFramework == targetFramework);
if(group == null)
if (group == null)
{
return false;
}
Expand All @@ -356,7 +356,7 @@ private IEnumerable<string> GetSharedSources(PackageDescription description, Fra
{
var directory = Path.Combine(description.Library.Path, "shared");

return description.Package.LockFileLibrary.Files.Where(path => path.StartsWith("shared\\"))
return description.Package.LockFileLibrary.Files.Where(path => path.StartsWith("shared" + Path.DirectorySeparatorChar))
.Select(path => Path.Combine(description.Library.Path, path));
}

Expand Down

0 comments on commit 30ad729

Please sign in to comment.