Ejemplo n.º 1
0
        //returns the lock file, if it changed
        async Task <string> RestorePackagesInternal(
            BuildIntegratedNuGetProject project,
            CancellationToken cancellationToken)
        {
            var now = DateTime.UtcNow;
            Action <SourceCacheContext> cacheContextModifier = c => c.MaxAge = now;

            var spec = await MonoDevelopDependencyGraphRestoreUtility.GetSolutionRestoreSpec(solutionManager, project, context, cancellationToken);

            context.AddToCache(spec);

            RestoreResult restoreResult = await DependencyGraphRestoreUtility.RestoreProjectAsync(
                solutionManager,
                project,
                context,
                new RestoreCommandProvidersCache(),
                cacheContextModifier,
                sourceRepositories,
                Guid.NewGuid(),
                context.Logger,
                cancellationToken);

            if (restoreResult.Success)
            {
                if (!object.Equals(restoreResult.LockFile, restoreResult.PreviousLockFile))
                {
                    return(restoreResult.LockFilePath);
                }
            }
            else
            {
                ReportRestoreError(restoreResult);
            }
            return(null);
        }