コード例 #1
0
        protected override async Task UpdateInternalTargetFrameworkAsync()
        {
            await NuGetUIThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();

            // Override the JSON TFM value from the csproj for UAP framework
            if (InternalMetadata.TryGetValue(NuGetProjectMetadataKeys.TargetFramework, out var targetFramework))
            {
                var jsonTargetFramework = targetFramework as NuGetFramework;
                if (IsUAPFramework(jsonTargetFramework))
                {
                    var platformMinVersionString = await _vsProjectAdapter
                                                   .BuildProperties
                                                   .GetPropertyValueAsync(ProjectBuildProperties.TargetPlatformMinVersion);

                    var platformMinVersion = !string.IsNullOrEmpty(platformMinVersionString)
                        ? new Version(platformMinVersionString)
                        : null;

                    if (platformMinVersion != null && jsonTargetFramework.Version != platformMinVersion)
                    {
                        // Found the TPMinV in csproj and it is different from project json's framework version,
                        // store this as a new target framework to be replaced in project.json
                        var newTargetFramework = new NuGetFramework(jsonTargetFramework.Framework, platformMinVersion);
                        InternalMetadata[NuGetProjectMetadataKeys.TargetFramework] = newTargetFramework;
                    }
                }
            }
        }
コード例 #2
0
        public NetCorePackageReferenceProject(
            string projectName,
            string projectUniqueName,
            string projectFullPath,
            IProjectSystemCache projectSystemCache,
            IVsProjectAdapter vsProjectAdapter,
            UnconfiguredProject unconfiguredProject,
            INuGetProjectServices projectServices,
            string projectId)
        {
            Assumes.Present(projectFullPath);
            Assumes.Present(projectSystemCache);
            Assumes.Present(projectServices);

            _projectName       = projectName;
            _projectUniqueName = projectUniqueName;
            _projectFullPath   = projectFullPath;

            ProjectStyle = ProjectStyle.PackageReference;

            _projectSystemCache  = projectSystemCache;
            _vsProjectAdapter    = vsProjectAdapter;
            _unconfiguredProject = unconfiguredProject;
            ProjectServices      = projectServices;

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, _projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, _projectUniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, _projectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);
        }
コード例 #3
0
        public NetCorePackageReferenceProject(
            string projectName,
            string projectUniqueName,
            string projectFullPath,
            IProjectSystemCache projectSystemCache,
            IVsProjectAdapter vsProjectAdapter,
            UnconfiguredProject unconfiguredProject,
            string projectId)
        {
            if (projectFullPath == null)
            {
                throw new ArgumentNullException(nameof(projectFullPath));
            }

            if (projectSystemCache == null)
            {
                throw new ArgumentNullException(nameof(projectSystemCache));
            }

            _projectName       = projectName;
            _projectUniqueName = projectUniqueName;
            _projectFullPath   = projectFullPath;

            ProjectStyle = ProjectStyle.PackageReference;

            _projectSystemCache  = projectSystemCache;
            _vsProjectAdapter    = vsProjectAdapter;
            _unconfiguredProject = unconfiguredProject;

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, _projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, _projectUniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, _projectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);
        }
コード例 #4
0
        public MSBuildNuGetProject(
            IMSBuildProjectSystem msbuildNuGetProjectSystem,
            string folderNuGetProjectPath,
            string packagesConfigFolderPath)
        {
            if (folderNuGetProjectPath == null)
            {
                throw new ArgumentNullException(nameof(folderNuGetProjectPath));
            }

            if (packagesConfigFolderPath == null)
            {
                throw new ArgumentNullException(nameof(packagesConfigFolderPath));
            }

            ProjectStyle = ProjectStyle.PackagesConfig;

            ProjectSystem      = msbuildNuGetProjectSystem ?? throw new ArgumentNullException(nameof(msbuildNuGetProjectSystem));
            FolderNuGetProject = new FolderNuGetProject(folderNuGetProjectPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, ProjectSystem.ProjectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, ProjectSystem.TargetFramework);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, msbuildNuGetProjectSystem.ProjectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, msbuildNuGetProjectSystem.ProjectUniqueName);
            PackagesConfigNuGetProject = new PackagesConfigNuGetProject(packagesConfigFolderPath, InternalMetadata);
        }
コード例 #5
0
        public CpsPackageReferenceProject(
            string projectName,
            string projectUniqueName,
            string projectFullPath,
            IProjectSystemCache projectSystemCache,
            EnvDTEProject envDTEProject,
            UnconfiguredProject unconfiguredProject,
            string projectId)
        {
            if (projectFullPath == null)
            {
                throw new ArgumentNullException(nameof(projectFullPath));
            }

            if (projectSystemCache == null)
            {
                throw new ArgumentNullException(nameof(projectSystemCache));
            }

            _projectName       = projectName;
            _projectUniqueName = projectUniqueName;
            _projectFullPath   = projectFullPath;

            _projectSystemCache  = projectSystemCache;
            _envDTEProject       = envDTEProject;
            _unconfiguredProject = unconfiguredProject;

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, _projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, _projectUniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, _projectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);
        }
コード例 #6
0
        public CpsPackageReferenceProject(
            string projectName,
            string projectUniqueName,
            string projectFullPath,
            IProjectSystemCache projectSystemCache,
            UnconfiguredProject unconfiguredProject,
            INuGetProjectServices projectServices,
            string projectId)
            : base(projectName,
                   projectUniqueName,
                   projectFullPath)
        {
            Assumes.Present(projectFullPath);
            Assumes.Present(projectSystemCache);
            Assumes.Present(projectServices);

            ProjectStyle = ProjectStyle.PackageReference;

            _projectSystemCache  = projectSystemCache;
            _unconfiguredProject = unconfiguredProject;
            ProjectServices      = projectServices;

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, ProjectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, ProjectUniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, ProjectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);
        }
コード例 #7
0
        public LegacyPackageReferenceProject(
            IVsProjectAdapter vsProjectAdapter,
            string projectId,
            INuGetProjectServices projectServices,
            IVsProjectThreadingService threadingService)
        {
            Assumes.Present(vsProjectAdapter);
            Assumes.NotNullOrEmpty(projectId);
            Assumes.Present(projectServices);
            Assumes.Present(threadingService);

            _vsProjectAdapter = vsProjectAdapter;
            _threadingService = threadingService;

            _projectName       = _vsProjectAdapter.ProjectName;
            _projectUniqueName = _vsProjectAdapter.UniqueName;
            _projectFullPath   = _vsProjectAdapter.FullProjectPath;

            ProjectStyle = ProjectStyle.PackageReference;

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, _projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, _projectUniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, _projectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);

            ProjectServices = projectServices;
        }
コード例 #8
0
            public TestPackageReferenceProject(string projectUniqueName)
            {
                _projectName = projectUniqueName;

                InternalMetadata.Add(NuGetProjectMetadataKeys.Name, _projectName);
                InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, _projectName);
            }
        public ProjectJsonBuildIntegratedProjectSystem(
            string jsonConfigPath,
            string msbuildProjectFilePath,
            EnvDTEProject envDTEProject,
            string uniqueName)
            : base(jsonConfigPath, msbuildProjectFilePath)
        {
            _envDTEProject = envDTEProject;

            // set project id
            var projectId = VsHierarchyUtility.GetProjectId(envDTEProject);

            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);

            // Override the JSON TFM value from the csproj for UAP framework
            if (InternalMetadata.TryGetValue(NuGetProjectMetadataKeys.TargetFramework, out object targetFramework))
            {
                var jsonTargetFramework = targetFramework as NuGetFramework;
                if (IsUAPFramework(jsonTargetFramework))
                {
                    var platfromMinVersion = VsHierarchyUtility.GetMSBuildProperty(VsHierarchyUtility.ToVsHierarchy(envDTEProject), EnvDTEProjectInfoUtility.TargetPlatformMinVersion);

                    if (!string.IsNullOrEmpty(platfromMinVersion))
                    {
                        // Found the TPMinV in csproj, store this as a new target framework to be replaced in project.json
                        var newTargetFramework = new NuGetFramework(jsonTargetFramework.Framework, new Version(platfromMinVersion));
                        InternalMetadata[NuGetProjectMetadataKeys.TargetFramework] = newTargetFramework;
                    }
                }
            }

            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, uniqueName);
        }
コード例 #10
0
        public MSBuildNuGetProject(IMSBuildNuGetProjectSystem msbuildNuGetProjectSystem, string folderNuGetProjectPath, string packagesConfigFullPath)
        {
            if (msbuildNuGetProjectSystem == null)
            {
                throw new ArgumentNullException("nugetDotNetProjectSystem");
            }

            if (folderNuGetProjectPath == null)
            {
                throw new ArgumentNullException("folderNuGetProjectPath");
            }

            if (packagesConfigFullPath == null)
            {
                throw new ArgumentNullException("packagesConfigFullPath");
            }

            MSBuildNuGetProjectSystem = msbuildNuGetProjectSystem;
            FolderNuGetProject        = new FolderNuGetProject(folderNuGetProjectPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, MSBuildNuGetProjectSystem.ProjectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, MSBuildNuGetProjectSystem.TargetFramework);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, msbuildNuGetProjectSystem.ProjectFullPath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, msbuildNuGetProjectSystem.ProjectUniqueName);
            PackagesConfigNuGetProject = new PackagesConfigNuGetProject(packagesConfigFullPath, InternalMetadata);
        }
コード例 #11
0
        public DotNetCoreNuGetProject(
            DotNetProject project,
            IEnumerable <string> targetFrameworks,
            ConfigurationSelector configuration,
            IPackageManagementEvents packageManagementEvents)
        {
            this.project                 = project;
            this.configuration           = configuration;
            this.packageManagementEvents = packageManagementEvents;
            ProjectStyle                 = ProjectStyle.PackageReference;

            var targetFramework = NuGetFramework.UnsupportedFramework;

            if (targetFrameworks.Count() == 1)
            {
                targetFramework = NuGetFramework.Parse(targetFrameworks.First());
            }

            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, targetFramework);
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, project.Name);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, project.BaseDirectory);

            msbuildProjectPath = project.FileName;
            projectName        = project.Name;
        }
コード例 #12
0
 private void Initialize(string root, PackagePathResolver resolver)
 {
     Root = root;
     PackagePathResolver = resolver;
     InternalMetadata.Add(NuGetProjectMetadataKeys.Name, root);
     InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, NuGetFramework.AnyFramework);
 }
コード例 #13
0
        /// <summary>
        /// Project.json based project system.
        /// </summary>
        /// <param name="jsonConfig">Path to project.json.</param>
        /// <param name="msBuildProjectPath">Path to the msbuild project file.</param>
        public ProjectJsonBuildIntegratedNuGetProject(
            string jsonConfig,
            string msBuildProjectPath)
        {
            if (jsonConfig == null)
            {
                throw new ArgumentNullException(nameof(jsonConfig));
            }

            if (msBuildProjectPath == null)
            {
                throw new ArgumentNullException(nameof(msBuildProjectPath));
            }

            _jsonConfig = new FileInfo(jsonConfig);

            MSBuildProjectPath = msBuildProjectPath;

            _projectName = Path.GetFileNameWithoutExtension(msBuildProjectPath);

            if (string.IsNullOrEmpty(_projectName))
            {
                throw new ArgumentException(
                          string.Format(CultureInfo.CurrentCulture, Strings.InvalidProjectName, MSBuildProjectPath));
            }

            JObject projectJson;
            IEnumerable <NuGetFramework> targetFrameworks = Enumerable.Empty <NuGetFramework>();

            try
            {
                projectJson      = GetJson();
                targetFrameworks = JsonConfigUtility.GetFrameworks(projectJson);
            }
            catch (InvalidOperationException)
            {
                // Ignore a bad project.json when constructing the project, and treat it as unsupported.
            }

            // Default to unsupported if anything unexpected is returned
            var targetFramework = NuGetFramework.UnsupportedFramework;

            // Having more than one framework is not supported, but we pick the first as fallback
            // We will eventually support more than one framework ala projectK.
            if (targetFrameworks.Count() == 1)
            {
                targetFramework = targetFrameworks.First();
            }

            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, targetFramework);
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, _projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, msBuildProjectPath);

            var supported = new List <FrameworkName>
            {
                new FrameworkName(targetFramework.DotNetFrameworkName)
            };

            InternalMetadata.Add(NuGetProjectMetadataKeys.SupportedFrameworks, supported);
        }
コード例 #14
0
        public PackagingNuGetProject(PackagingProject project)
        {
            this.project = project;

            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, NuGetFramework.Parse("any"));
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, project.Name);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, project.Name);
        }
コード例 #15
0
 public FakeNuGetProject(IDotNetProject project)
 {
     Project = project;
     if (project.Name != null)
     {
         InternalMetadata.Add(NuGetProjectMetadataKeys.Name, project.Name);
     }
 }
コード例 #16
0
 public FolderNuGetProject(string root, PackagePathResolver packagePathResolver)
 {
     if (root == null)
     {
         throw new ArgumentNullException(nameof(root));
     }
     Root = root;
     PackagePathResolver = packagePathResolver;
     InternalMetadata.Add(NuGetProjectMetadataKeys.Name, root);
     InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, NuGetFramework.AnyFramework);
 }
コード例 #17
0
 public TestBuildIntegratedNuGetProject(
     string jsonConfig,
     IMSBuildProjectSystem msbuildProjectSystem) : base(
         jsonConfig,
         Path.Combine(
             msbuildProjectSystem.ProjectFullPath,
             $"{msbuildProjectSystem.ProjectName}.csproj"))
 {
     InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, msbuildProjectSystem.ProjectName);
     ProjectClosure = new List <ExternalProjectReference>();
 }
コード例 #18
0
        public ProjectKNuGetProject(INuGetPackageManager project, string projectName, string uniqueName)
        {
            _project = project;
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, uniqueName);

            var supportedFrameworks = _project.GetSupportedFrameworksAsync(CancellationToken.None)
                                      .Result
                                      .Select(f => NuGetFramework.Parse(f.FullName));

            InternalMetadata.Add(NuGetProjectMetadataKeys.SupportedFrameworks, supportedFrameworks);
        }
コード例 #19
0
        public BuildIntegratedProjectSystem(
            string jsonConfigPath,
            string msbuildProjectFilePath,
            EnvDTEProject envDTEProject,
            IMSBuildNuGetProjectSystem msbuildProjectSystem,
            string uniqueName)
            : base(jsonConfigPath, msbuildProjectFilePath, msbuildProjectSystem)
        {
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, uniqueName);

            EnvDTEProject = envDTEProject;
        }
コード例 #20
0
 public FolderNuGetProject(string root)
 {
     if (root == null)
     {
         throw new ArgumentNullException("root");
     }
     Root = root;
     PackagePathResolver = new PackagePathResolver(root);
     PackageSaveMode     = PackageSaveModes.Nupkg;
     InternalMetadata.Add(NuGetProjectMetadataKeys.Name, root);
     InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, NuGetFramework.AnyFramework);
 }
        public NetCorePackageReferenceNuGetProject(IProjectAdapter projectAdapter, INuGetProjectServices projectServices, IProjectRestoreService projectRestoreService)
        {
            ProjectStyle = ProjectStyle.PackageReference;

            ProjectAdapter         = projectAdapter;
            _projectRestoreService = projectRestoreService;
            //ProjectServices = projectServices;

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, projectAdapter.ProjectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, projectAdapter.ProjectUniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, projectAdapter.ProjectFilePath);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectAdapter.ProjectId);
        }
        private void UpdateFramework(JObject json)
        {
            var frameworks = JsonConfigUtility.GetFrameworks(json);

            if (InternalMetadata.TryGetValue(NuGetProjectMetadataKeys.TargetFramework, out object newTargetFramework))
            {
                if (IsUAPFramework(newTargetFramework as NuGetFramework) && frameworks.Count() == 1)
                {
                    // project.json can have only one target framework
                    JsonConfigUtility.ClearFrameworks(json);
                    JsonConfigUtility.AddFramework(json, newTargetFramework as NuGetFramework);
                }
            }
        }
コード例 #23
0
        /// <summary>
        /// Initializes a new <see cref="FolderNuGetProject" /> class.
        /// </summary>
        /// <param name="root">The folder project root path.</param>
        /// <param name="packagePathResolver">A package path resolver.</param>
        /// <param name="targetFramework">Project target framework.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="root" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="packagePathResolver" /> is <c>null</c>.</exception>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="targetFramework" /> is <c>null</c>.</exception>
        public FolderNuGetProject(string root, PackagePathResolver packagePathResolver, NuGetFramework targetFramework)
        {
            if (targetFramework == null)
            {
                throw new ArgumentNullException(nameof(targetFramework));
            }

            Root = root ?? throw new ArgumentNullException(nameof(root));
            PackagePathResolver = packagePathResolver ?? throw new ArgumentNullException(nameof(packagePathResolver));

            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, root);
            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, targetFramework);
            _framework = targetFramework;
        }
コード例 #24
0
        public ProjectKNuGetProject(INuGetPackageManager project, string projectName, string uniqueName, string projectId)
        {
            _project = project;
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, projectName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, uniqueName);
            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);

            NuGetUIThreadHelper.JoinableTaskFactory.Run(async() =>
            {
                var frameworks          = await _project.GetSupportedFrameworksAsync(CancellationToken.None);
                var supportedFrameworks = frameworks.Select(f => NuGetFramework.Parse(f.FullName));

                InternalMetadata.Add(NuGetProjectMetadataKeys.SupportedFrameworks, supportedFrameworks);
            });
        }
コード例 #25
0
        public VSMSBuildNuGetProject(
            EnvDTEProject project,
            IMSBuildNuGetProjectSystem msbuildNuGetProjectSystem,
            string folderNuGetProjectPath,
            string packagesConfigFolderPath) : base(
                msbuildNuGetProjectSystem,
                folderNuGetProjectPath,
                packagesConfigFolderPath)
        {
            _project = project;

            // set project id
            var projectId = VsHierarchyUtility.GetProjectId(project);

            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);
        }
        public ProjectJsonBuildIntegratedProjectSystem(
            string jsonConfigPath,
            string msbuildProjectFilePath,
            EnvDTEProject envDTEProject,
            string uniqueName)
            : base(jsonConfigPath, msbuildProjectFilePath)
        {
            _envDTEProject = envDTEProject;

            // set project id
            var projectId = VsHierarchyUtility.GetProjectId(envDTEProject);

            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectId);

            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, uniqueName);
        }
コード例 #27
0
        public PackageReferenceNuGetProject(
            DotNetProject project,
            IPackageManagementEvents packageManagementEvents)
        {
            this.project = project;
            this.packageManagementEvents = packageManagementEvents;

            var targetFramework = NuGetFramework.Parse(project.TargetFramework.Id.ToString());

            InternalMetadata.Add(NuGetProjectMetadataKeys.TargetFramework, targetFramework);
            InternalMetadata.Add(NuGetProjectMetadataKeys.Name, project.Name);
            InternalMetadata.Add(NuGetProjectMetadataKeys.FullPath, project.BaseDirectory);

            msbuildProjectPath = project.FileName;
            projectName        = project.Name;
        }
コード例 #28
0
        public VsProjectJsonNuGetProject(
            string jsonConfigPath,
            string msbuildProjectFilePath,
            IVsProjectAdapter vsProjectAdapter,
            INuGetProjectServices projectServices)
            : base(jsonConfigPath, msbuildProjectFilePath)
        {
            Assumes.Present(vsProjectAdapter);
            Assumes.Present(projectServices);

            _vsProjectAdapter = vsProjectAdapter;

            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, _vsProjectAdapter.ProjectId);
            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, _vsProjectAdapter.CustomUniqueName);

            ProjectServices = projectServices;
        }
コード例 #29
0
        public NuGetPluginProject(Func <NuGetPluginProject <TMeta>, NuGetPackageManager> packageManagerCreator,
                                  Func <PackageIdentity, bool> canUninstallPackageFunc,
                                  NuGetFramework currentFramework,
                                  DirectoryPath packageDirPath,
                                  DirectoryPath pluginHomeDirPath,
                                  LocalPluginPackage <TMeta> plugin,
                                  bool isInstalled)
            : base(packageDirPath.FullPath)
        {
            Plugin = plugin;
            _packageManagerCreator   = packageManagerCreator;
            _canUninstallPackageFunc = canUninstallPackageFunc;
            _currentFramework        = currentFramework;
            _isInstalled             = isInstalled;
            _pluginHomeDirPath       = pluginHomeDirPath.Combine(Plugin.Id);

            InternalMetadata.Add(NuGetProjectMetadataKeys.UniqueName, plugin.Id);
        }
コード例 #30
0
        public VsMSBuildNuGetProject(
            IVsProjectAdapter projectAdapter,
            IMSBuildProjectSystem msbuildNuGetProjectSystem,
            string folderNuGetProjectPath,
            string packagesConfigFolderPath,
            INuGetProjectServices projectServices)
            : base(
                msbuildNuGetProjectSystem,
                folderNuGetProjectPath,
                packagesConfigFolderPath)
        {
            Assumes.Present(projectAdapter);
            Assumes.Present(msbuildNuGetProjectSystem);
            Assumes.Present(projectServices);

            InternalMetadata.Add(NuGetProjectMetadataKeys.ProjectId, projectAdapter.ProjectId);

            ProjectServices = projectServices;
        }