Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Write "path" for package libaries in the project.lock.json #523

Merged
merged 1 commit into from Apr 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -129,9 +129,13 @@ public LockFileBuilder(int lockFileVersion, ILogger logger, Dictionary<RestoreTa
// If we have the same library in the lock file already, use that.
if (previousLibrary == null || previousLibrary.Sha512 != sha512)
{
var path = resolver.GetPackageDirectory(packageInfo.Id, packageInfo.Version);
path = PathUtility.GetPathWithForwardSlashes(path);

lockFileLib = CreateLockFileLibrary(
packageInfo,
sha512,
path,
correctedPackageName: library.Name);
}
else if (Path.DirectorySeparatorChar != LockFile.DirectorySeparatorChar)
Expand Down Expand Up @@ -347,7 +351,7 @@ private static void PopulateProjectFileToolGroups(PackageSpec project, LockFile
}
}

private static LockFileLibrary CreateLockFileLibrary(LocalPackageInfo package, string sha512, string correctedPackageName)
private static LockFileLibrary CreateLockFileLibrary(LocalPackageInfo package, string sha512, string path, string correctedPackageName)
{
var lockFileLib = new LockFileLibrary();

Expand All @@ -359,6 +363,12 @@ private static LockFileLibrary CreateLockFileLibrary(LocalPackageInfo package, s
lockFileLib.Type = LibraryType.Package;
lockFileLib.Sha512 = sha512;

// This is the relative path, appended to the global packages folder path. All
// of the paths in the in the Files property should be appended to this path along
// with the global packages folder path to get the absolute path to each file in the
// package.
lockFileLib.Path = path;

using (var packageReader = new PackageFolderReader(package.ExpandedPath))
{
// Get package files, excluding directory entries and OPC files
Expand Down