Пример #1
0
        public async Task Initialize()
        {
            var nuGetDownloader = new NuGetDownloader(_options.LoggerFactory());

            var packages = await nuGetDownloader.SearchPackagesAsync(_packageFeed, _searchTerm, maxResults : _maxPackages);

            foreach (var packageAndRepo in packages)
            {
                var options = new NugetPluginCatalogOptions()
                {
                    TypeFinderOptions = _options.TypeFinderOptions
                };

                var packageCatalog = new NugetPackagePluginCatalog(packageAndRepo.Package.Identity.Id, packageAndRepo.Package.Identity.Version.ToString(),
                                                                   _includePrereleases, _packageFeed, PackagesFolder, options: options);

                await packageCatalog.Initialize();

                _pluginCatalogs.Add(packageCatalog);
            }

            IsInitialized = true;
        }
Пример #2
0
        public async Task Initialize()
        {
            var nuGetDownloader         = new NuGetDownloader(_options.LoggerFactory());
            var pluginAssemblyFileNames = await nuGetDownloader.DownloadAsync(PackagesFolder, _packageName, _packageVersion, _includePrerelease, _packageFeed);

            foreach (var f in pluginAssemblyFileNames)
            {
                _pluginAssemblyFilePaths.Add(Path.Combine(PackagesFolder, f));
            }

            foreach (var pluginAssemblyFilePath in _pluginAssemblyFilePaths)
            {
                var options = new AssemblyPluginCatalogOptions {
                    TypeFinderOptions = _options.TypeFinderOptions
                };

                var assemblyCatalog = new AssemblyPluginCatalog(pluginAssemblyFilePath, options);
                await assemblyCatalog.Initialize();

                _pluginCatalogs.Add(assemblyCatalog);
            }

            IsInitialized = true;
        }