Example #1
0
 internal DependencyScanner(InMemoryIndex index, Config config, IFileAccess fileSystem, PackagePolicies packagePolicies)
 {
     this.versionResolver = new PackageVersionResolver(index);
     this.registry        = new NuGetDependencies(index, config);
     this.fileSystem      = fileSystem;
     this.packagePolicies = packagePolicies;
     this.followLocations = config.FollowLocations;
 }
Example #2
0
        public static async Task <(IDependencyScanner, ILicenseScanner)> Create(IFileAccess fileSystem, Config config)
        {
            var packagePolicies = PackagePolicies.LoadFrom(config.PackagePolicies);
            var scanner         = await DependencyScanner.Create(config, fileSystem, packagePolicies);

            var catalog = new NuGetCatalog(config.DiskCache);
            var index   = await catalog.GetIndex();

            var registry = new NuGetDependencies(index, config);

            Func <IPackage, Task <PackageDetailsResult> > getDetails =
                p => registry.GetPackageDetails(p).ContinueWith(ConvertPackageDetails);

            ILicenseScanner licenseScanner = new LicenseScanner(getDetails, packagePolicies, config);

            return(scanner, licenseScanner);
        }