Ejemplo n.º 1
0
        public override bool Equals(Solution other)
        {
            VsSolution vsSln = other as VsSolution;

            return(vsSln != null &&
                   String.Equals(vsSln.DteSolution.FileName, DteSolution.FileName, StringComparison.OrdinalIgnoreCase));
        }
Ejemplo n.º 2
0
        public static VsProject Create(VsSolution solution, DteProject dteProject)
        {
            VsNuGetTraceSources.VsProjectInstallationTarget.Verbose("create", "Created install target for project: {0}", dteProject.Name);
            var projectManager = ServiceLocator.GetInstance <IVsPackageManagerFactory>()
                                 .CreatePackageManagerToManageInstalledPackages()
                                 .GetProjectManager(dteProject);

            return(new VsProject(solution, dteProject, projectManager));
        }
Ejemplo n.º 3
0
        public VsProject(VsSolution solution, DteProject dteProject, IProjectManager projectManager)
            : base()
        {
            _solution  = solution;
            _installed = new CoreInteropInstalledPackagesList((IPackageReferenceRepository2)projectManager.LocalRepository);
            DteProject = dteProject;

            // Add V2-related interop features
            AddFeature(() => projectManager);
            AddFeature(() => projectManager.PackageManager);
            AddFeature(() => projectManager.Project);
            AddFeature(() => projectManager.PackageManager.LocalRepository);
            AddFeature <IPackageCacheRepository>(() => MachineCache.Default);

            // the source repository of the local repo of the project
            AddFeature <SourceRepository>(() =>
            {
                var repo = new NuGet.Client.Interop.V2SourceRepository(
                    null,
                    projectManager.LocalRepository,
                    "");
                return(repo);
            });

            // Add PowerShell feature
            AddFeature <PowerShellScriptExecutor>(() =>
                                                  new VsPowerShellScriptExecutor(ServiceLocator.GetInstance <IScriptExecutor>()));

#if VS14
            // Add NuGetAwareProject if the project system is nuget-aware.
            _nugetAwareProject = projectManager.Project as INuGetPackageManager;
            if (_nugetAwareProject != null)
            {
                AddFeature <NuGetAwareProject>(() => new VsNuGetAwareProject(_nugetAwareProject));
            }
#endif
        }
Ejemplo n.º 4
0
        public VsProject(VsSolution solution, DteProject dteProject, IProjectManager projectManager)
            : base()
        {
            _solution = solution;
            _installed = new CoreInteropInstalledPackagesList((IPackageReferenceRepository2)projectManager.LocalRepository);
            DteProject = dteProject;

            // Add V2-related interop features
            AddFeature(() => projectManager);
            AddFeature(() => projectManager.PackageManager);
            AddFeature(() => projectManager.Project);
            AddFeature(() => projectManager.PackageManager.LocalRepository);
            AddFeature<IPackageCacheRepository>(() => MachineCache.Default);

            // the source repository of the local repo of the project
            AddFeature<SourceRepository>(() =>
            {
                var repo = new NuGet.Client.Interop.V2SourceRepository(
                    null,
                    projectManager.LocalRepository,
                    "");
                return repo;
            });

            // Add PowerShell feature
            AddFeature<PowerShellScriptExecutor>(() =>
                new VsPowerShellScriptExecutor(ServiceLocator.GetInstance<IScriptExecutor>()));

#if VS14
            // Add NuGetAwareProject if the project system is nuget-aware.
            _nugetAwareProject = projectManager.Project as INuGetPackageManager;
            if (_nugetAwareProject != null)
            {
                AddFeature<NuGetAwareProject>(() => new VsNuGetAwareProject(_nugetAwareProject));
            }
#endif
        }
Ejemplo n.º 5
0
 public static VsProject Create(VsSolution solution, DteProject dteProject)
 {
     VsNuGetTraceSources.VsProjectInstallationTarget.Verbose("create", "Created install target for project: {0}", dteProject.Name);
     var projectManager = ServiceLocator.GetInstance<IVsPackageManagerFactory>()
         .CreatePackageManagerToManageInstalledPackages()
         .GetProjectManager(dteProject);
     return new VsProject(solution, dteProject, projectManager);
 }