예제 #1
0
        static IEnumerable <NuGetProject> GetNuGetProjects(MonoDevelopSolutionManager solutionManager)
        {
            var factory = new ConsoleHostNuGetProjectFactory(solutionManager.Settings);

            foreach (DotNetProject project in solutionManager.Solution.GetAllDotNetProjects())
            {
                yield return(factory.CreateNuGetProject(project));
            }
        }
예제 #2
0
        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);
		}
예제 #6
0
 void ProjectsChangedInSolution(object sender, EventArgs e)
 {
     solutionManager = null;
 }
예제 #7
0
 void SolutionUnloaded(object sender, SolutionEventArgs e)
 {
     solutionManager = null;
 }