static IEnumerable <NuGetProject> GetNuGetProjects(MonoDevelopSolutionManager solutionManager) { var factory = new ConsoleHostNuGetProjectFactory(solutionManager.Settings); foreach (DotNetProject project in solutionManager.Solution.GetAllDotNetProjects()) { yield return(factory.CreateNuGetProject(project)); } }
public static FilePath GetPackagesFolderPath(this DotNetProject project) { var solutionManager = new MonoDevelopSolutionManager(project.ParentSolution); if (solutionManager == null) { return(FilePath.Null); } NuGetProject nugetProject = solutionManager.GetNuGetProject(new DotNetProjectProxy(project)); if (nugetProject == null) { return(FilePath.Null); } return(nugetProject.GetPackagesFolderPath(solutionManager)); }
public static async Task Extract( Solution solution, PackageIdentity packageIdentity, DownloadResourceResult downloadResult, INuGetProjectContext context, CancellationToken token) { string globalPackagesFolder = await GetPackagesDirectory(solution); var defaultPackagePathResolver = new VersionFolderPathResolver(globalPackagesFolder); string hashPath = defaultPackagePathResolver.GetHashPath(packageIdentity.Id, packageIdentity.Version); if (File.Exists(hashPath)) { return; } var logger = new LoggerAdapter(context); var solutionManager = new MonoDevelopSolutionManager(solution); var clientPolicyContext = ClientPolicyContext.GetClientPolicy(solutionManager.Settings, logger); var packageExtractionContext = new PackageExtractionContext( PackageSaveMode.Defaultv3, PackageExtractionBehavior.XmlDocFileSaveMode, clientPolicyContext, logger); downloadResult.PackageStream.Position = 0; await PackageExtractor.InstallFromSourceAsync( downloadResult.PackageSource, packageIdentity, stream => downloadResult.PackageStream.CopyToAsync(stream, BufferSize, token), defaultPackagePathResolver, packageExtractionContext, token); }
void AddSolution(Solution solution) { var solutionManager = new MonoDevelopSolutionManager(solution); solutionManagers.Add(solutionManager); }
void AddSolution (Solution solution) { var solutionManager = new MonoDevelopSolutionManager (solution); solutionManagers.Add (solutionManager); }
void ProjectsChangedInSolution(object sender, EventArgs e) { solutionManager = null; }
void SolutionUnloaded(object sender, SolutionEventArgs e) { solutionManager = null; }