private LockFile BuildLockFile(
            LockFile existingLockFile,
            PackageSpec project,
            IEnumerable <RestoreTargetGraph> graphs,
            NuGetv3LocalRepository localRepository,
            RemoteWalkContext contextForProject,
            IEnumerable <ToolRestoreResult> toolRestoreResults,
            bool relockFile)
        {
            // Build the lock file
            LockFile lockFile;

            if (existingLockFile != null && existingLockFile.IsLocked)
            {
                // No lock file to write!
                lockFile = existingLockFile;
            }
            else
            {
                lockFile = new LockFileBuilder(_request.LockFileVersion, _logger, _includeFlagGraphs)
                           .CreateLockFile(
                    existingLockFile,
                    project,
                    graphs,
                    localRepository,
                    contextForProject,
                    toolRestoreResults);

                // If the lock file was locked originally but we are re-locking it, well... re-lock it :)
                lockFile.IsLocked = relockFile;
            }

            return(lockFile);
        }
Beispiel #2
0
        private LockFile BuildAssetsFile(
            LockFile existingLockFile,
            PackageSpec project,
            IEnumerable <RestoreTargetGraph> graphs,
            IReadOnlyList <NuGetv3LocalRepository> localRepositories,
            RemoteWalkContext contextForProject)
        {
            // Build the lock file
            var lockFile = new LockFileBuilder(_request.LockFileVersion, _logger, _includeFlagGraphs)
                           .CreateLockFile(
                existingLockFile,
                project,
                graphs,
                localRepositories,
                contextForProject);

            return(lockFile);
        }