Exemplo n.º 1
0
        public void ProcessAssembliesAndContent()
        {
            List <DirectoryPath> contentPaths = _installedPackages
                                                .GetInstalledPackagesAndDependencies()
                                                .Distinct()
                                                .AsParallel()
                                                .SelectMany(packageIdentity =>
            {
                DirectoryPath installedPath        = new DirectoryPath(GetInstalledPath(packageIdentity));
                string packageFilePath             = GetInstalledPackageFilePath(packageIdentity);
                PackageArchiveReader archiveReader = new PackageArchiveReader(packageFilePath, null, null);
                Trace.Verbose($"Processing package contents for {packageIdentity} targeting framework {_currentFramework.DotNetFrameworkName}");
                AddReferencedAssemblies(packageIdentity, installedPath, archiveReader);
                return(GetContentDirectories(packageIdentity, installedPath, archiveReader));
            })
                                                .ToList();

            foreach (DirectoryPath contentPath in contentPaths)
            {
                _fileSystem.InputPaths.Insert(0, contentPath);
            }
        }
        public void ProcessAssembliesAndContent()
        {
            List <DirectoryPath> contentPaths = _installedPackages
                                                .GetInstalledPackagesAndDependencies()
                                                .Distinct()
                                                .AsParallel()
                                                .SelectMany(packageIdentity =>
            {
                DirectoryPath installedPath        = new DirectoryPath(GetInstalledPath(packageIdentity));
                string packageFilePath             = GetInstalledPackageFilePath(packageIdentity);
                PackageArchiveReader archiveReader = new PackageArchiveReader(packageFilePath, null, null);
                AddReferencedAssemblies(installedPath, archiveReader);
                return(GetContentDirectories(installedPath, archiveReader));
            })
                                                .ToList();

            foreach (DirectoryPath contentPath in contentPaths)
            {
                _fileSystem.InputPaths.Insert(0, contentPath);
                Trace.Verbose($"Added content path {contentPath} to included paths");
            }
        }