Пример #1
0
        private PluginPackageManager(DirectoryPath pluginDirPath,
                                     DirectoryPath pluginHomeDirPath,
                                     DirectoryPath packageDirPath,
                                     NuGetInstalledPluginRepository <TMeta> packageCache,
                                     Func <ISettings, NuGet.SourceRepositoryProvider> providerCreator =
                                     null)
        {
            var settings = Settings.LoadDefaultSettings(packageDirPath.FullPath, null, new NuGetMachineWideSettings());

            _currentFramework  = GetCurrentFramework();
            SourceRepositories = providerCreator?.Invoke(settings) ?? new NuGet.SourceRepositoryProvider(settings);
            PluginRepo         = packageCache;

            var localRepo = SourceRepositories.CreateRepository(
                new PackageSource(packageDirPath.FullPath, "Local", true),
                FeedType.FileSystemPackagesConfig);

            Solution = new NuGetPluginSolution <TMeta>(
                pluginDirPath, pluginHomeDirPath, packageDirPath,
                PluginRepo,
                SourceRepositories,
                settings,
                _currentFramework
                );
        }
Пример #2
0
 /// <summary>
 ///   Adds the specified package source. Sources added this way will be searched before any
 ///   global sources.
 /// </summary>
 /// <param name="repository">The package source to add.</param>
 public SourceRepository AddRepository(string repository) => SourceRepositories.CreateRepository(repository);