async Task RestoreAnyMissingPackages(CancellationToken cancellationToken)
        {
            var packages = await restoreManager.GetPackagesInSolutionAsync(
                solutionManager.SolutionDirectory,
                cancellationToken);

            var missingPackages = packages.Select(IsMissingForCurrentProject).ToList();

            if (missingPackages.Any())
            {
                using (var monitor = new PackageRestoreMonitor(restoreManager, packageManagementEvents)) {
                    using (var cacheContext = new SourceCacheContext()) {
                        var downloadContext = new PackageDownloadContext(cacheContext);
                        await restoreManager.RestoreMissingPackagesAsync(
                            solutionManager.SolutionDirectory,
                            project,
                            context,
                            downloadContext,
                            cancellationToken);
                    }
                }

                await RunInMainThread(() => dotNetProject.RefreshReferenceStatus());

                packageManagementEvents.OnPackagesRestored();
            }
        }
        async Task RestorePackagesAsync(CancellationToken cancellationToken)
        {
            if (restoreManager != null)
            {
                using (var monitor = new PackageRestoreMonitor(restoreManager)) {
                    await restoreManager.RestoreMissingPackagesAsync(
                        solutionManager.SolutionDirectory,
                        packagesToRestore,
                        new NuGetProjectContext(),
                        cancellationToken);
                }
            }

            if (buildIntegratedRestorer != null)
            {
                await buildIntegratedRestorer.RestorePackages(buildIntegratedProjectsToBeRestored, cancellationToken);
            }

            if (nugetAwareRestorer != null)
            {
                await nugetAwareRestorer.RestoreMissingPackagesAsync(
                    nugetAwareProjectsToBeRestored,
                    new NuGetProjectContext(),
                    cancellationToken);
            }

            await Runtime.RunInMainThread(() => RefreshProjectReferences());

            packageManagementEvents.OnPackagesRestored();
        }
Exemple #3
0
        async Task ExecuteAsync(CancellationToken cancellationToken)
        {
            await PrepareForExecute();

            if (restoreManager != null && RestorePackagesConfigProjects)
            {
                using (var monitor = new PackageRestoreMonitor(restoreManager)) {
                    await restoreManager.RestoreMissingPackagesInSolutionAsync(
                        solutionManager.SolutionDirectory,
                        new NuGetProjectContext (solutionManager.Settings),
                        cancellationToken);
                }
            }

            if (buildIntegratedRestorer != null)
            {
                await buildIntegratedRestorer.RestorePackages(
                    GetBuildIntegratedNuGetProjects(),
                    cancellationToken);
            }

            if (nugetAwareRestorer != null)
            {
                await nugetAwareRestorer.RestoreMissingPackagesAsync(
                    nugetAwareProjects,
                    new NuGetProjectContext (solutionManager.Settings),
                    cancellationToken);
            }

            await Runtime.RunInMainThread(() => RefreshProjectReferences());

            packageManagementEvents.OnPackagesRestored();
        }
        async Task RestoreAnyMissingPackagesAsync(SourceCacheContext sourceCacheContext, CancellationToken cancellationToken)
        {
            var packages = await restoreManager.GetPackagesInSolutionAsync(
                solutionManager.SolutionDirectory,
                cancellationToken);

            if (!packages.Any(package => IsMissingForProject(package)))
            {
                return;
            }

            using (var monitor = new PackageRestoreMonitor(restoreManager, packageManagementEvents)) {
                var downloadContext = new PackageDownloadContext(sourceCacheContext);
                await restoreManager.RestoreMissingPackagesAsync(
                    solutionManager.SolutionDirectory,
                    packages,
                    context,
                    downloadContext,
                    cancellationToken);
            }

            await Runtime.RunInMainThread(() => {
                foreach (IDotNetProject dotNetProject in dotNetProjects)
                {
                    dotNetProject.RefreshReferenceStatus();
                }
            });

            packageManagementEvents.OnPackagesRestored();
        }
        async Task ExecuteAsync(CancellationToken cancellationToken)
        {
            using (var monitor = new PackageRestoreMonitor(restoreManager)) {
                await restoreManager.RestoreMissingPackagesAsync(
                    solutionManager.SolutionDirectory,
                    nugetProject,
                    new NuGetProjectContext(),
                    cancellationToken);
            }

            await Runtime.RunInMainThread(() => RefreshProjectReferences());

            packageManagementEvents.OnPackagesRestored();
        }
		async Task ExecuteAsync (CancellationToken cancellationToken)
		{
			using (var monitor = new PackageRestoreMonitor (restoreManager)) {
				await restoreManager.RestoreMissingPackagesAsync (
					solutionManager.SolutionDirectory,
					nugetProject,
					new NuGetProjectContext (),
					cancellationToken);
			}

			await Runtime.RunInMainThread (() => RefreshProjectReferences ());

			packageManagementEvents.OnPackagesRestored ();
		}
        async Task ExecuteAsync(CancellationToken cancellationToken)
        {
            using (var monitor = new PackageRestoreMonitor(restoreManager)) {
                using (var cacheContext = new SourceCacheContext()) {
                    var downloadContext = new PackageDownloadContext(cacheContext);
                    await restoreManager.RestoreMissingPackagesAsync(
                        solutionManager.SolutionDirectory,
                        nugetProject,
                        new NuGetProjectContext (solutionManager.Settings),
                        downloadContext,
                        cancellationToken);
                }
            }

            await Runtime.RunInMainThread(() => RefreshProjectReferences());

            packageManagementEvents.OnPackagesRestored();
        }
		async Task RestorePackagesAsync (CancellationToken cancellationToken)
		{
			if (restoreManager != null) {
				using (var monitor = new PackageRestoreMonitor (restoreManager)) {
					await restoreManager.RestoreMissingPackagesAsync (
						solutionManager.SolutionDirectory,
						packagesToRestore,
						new NuGetProjectContext (),
						cancellationToken);
				}
			}

			if (buildIntegratedRestorer != null) {
				await buildIntegratedRestorer.RestorePackages (buildIntegratedProjectsToBeRestored, cancellationToken);
			}

			await Runtime.RunInMainThread (() => RefreshProjectReferences ());

			packageManagementEvents.OnPackagesRestored ();
		}
		async Task RestoreAnyMissingPackages (CancellationToken cancellationToken)
		{
			var packages = await restoreManager.GetPackagesInSolutionAsync (
				solutionManager.SolutionDirectory,
				cancellationToken);

			var missingPackages = packages.Select (IsMissingForCurrentProject).ToList ();
			if (missingPackages.Any ()) {
				using (var monitor = new PackageRestoreMonitor (restoreManager, packageManagementEvents)) {
					await restoreManager.RestoreMissingPackagesAsync (
						solutionManager.SolutionDirectory,
						project,
						context,
						cancellationToken);
				}

				await RunInMainThread (() => dotNetProject.RefreshReferenceStatus ());

				packageManagementEvents.OnPackagesRestored ();
			}
		}