Example #1
0
        /// <summary>
        /// Constructs a file system view for the given pip graph
        /// </summary>
        public static FileSystemView Create(
            PathTable pathTable,
            PipGraph pipGraph,
            ILocalDiskFileSystemView localDiskContentStore,
            int maxInitializationDegreeOfParallelism,
            bool inferNonExistenceBasedOnParentPathInRealFileSystem = true)
        {
            var fileSystemView = new FileSystemView(pathTable, pipGraph, localDiskContentStore, inferNonExistenceBasedOnParentPathInRealFileSystem);

            Parallel.For(0, pipGraph.ArtifactContentCount,
                         new ParallelOptions {
                MaxDegreeOfParallelism = maxInitializationDegreeOfParallelism
            },
                         contentIndex =>
            {
                fileSystemView.AddArtifact(pipGraph.GetArtifactContent(contentIndex));
            });

            return(fileSystemView);
        }