Exemple #1
0
        private ObjectInfo DirectoryArtifactInfo(DirectoryArtifact d)
        {
            if (!d.IsValid)
            {
                return(new ObjectInfo("Invalid"));
            }

            var name    = d.Path.GetName(PathTable).ToString(StringTable);
            var kind    = d.IsSharedOpaque ? "shared opaque" : d.IsOutputDirectory() ? "exclusive opaque" : "source";
            var members = d.IsOutputDirectory()
                ? Analyzer.GetDirMembers(d, PipGraph.GetProducer(d))
                : d.PartialSealId > 0
                    ? PipGraph.ListSealedDirectoryContents(d).Select(f => f.Path)
                    : CollectionUtilities.EmptyArray <AbsolutePath>();

            return(new ObjectInfo(
                       preview: $"{name} [{kind}]",
                       properties: new[]
            {
                new Property("Path", d.Path.ToString(PathTable)),
                new Property("PartialSealId", d.PartialSealId),
                new Property("Kind", kind),
                d.IsOutputDirectory() ? new Property("Producer", () => Analyzer.GetPip(PipGraph.GetProducer(d))) : null,
                new Property("Consumers", PipGraph.GetConsumingPips(d)),
                new Property("Members", members)
            }
                       .Where(p => p != null)));
        }
Exemple #2
0
        /// <summary>
        /// Creates a static directory for a directory artifact that is known to be an either shared or exclusive opaque directory
        /// </summary>
        public static StaticDirectory CreateForOutputDirectory(DirectoryArtifact outputDirectory)
        {
            Contract.Requires(outputDirectory.IsValid);
            Contract.Requires(outputDirectory.IsOutputDirectory());

            return(new StaticDirectory(outputDirectory, outputDirectory.IsSharedOpaque ? SealDirectoryKind.SharedOpaque : SealDirectoryKind.Opaque, PipConstructionHelper.EmptyStaticDirContents));
        }
Exemple #3
0
        private ObjectInfo DirectoryArtifactInfo(DirectoryArtifact d)
        {
            if (!d.IsValid)
            {
                return(new ObjectInfo("Invalid"));
            }

            var name = d.Path.GetName(PathTable).ToString(StringTable);
            var kind = d.IsSharedOpaque ? "shared opaque" : d.IsOutputDirectory() ? "exclusive opaque" : "source";

            return(new ObjectInfo(
                       preview: $"{name} [{kind}]",
                       properties: new[]
            {
                new Property("Path", d.Path.ToString(PathTable)),
                new Property("PartialSealId", d.PartialSealId),
                new Property("Kind", kind),
                d.IsOutputDirectory() ? new Property("Producer", () => PipGraph.GetProducer(d)) : null,
                new Property("Consumers", PipGraph.GetConsumingPips(d.Path).ToArray()),
                d.PartialSealId > 0 ? new Property("Members", () => PipGraph.ListSealedDirectoryContents(d)) : null
            }
                       .Where(p => p != null)));
        }
Exemple #4
0
        private ObjectInfo DirectoryArtifactInfo(DirectoryArtifact d)
        {
            if (!d.IsValid)
            {
                return(new ObjectInfo("Invalid"));
            }

            var name = d.Path.GetName(PathTable).ToString(StringTable);
            var kind = d.IsSharedOpaque ? "shared opaque" : d.IsOutputDirectory() ? "exclusive opaque" : "source";

            return(new ObjectInfoBuilder()
                   .Preview($"{name} [{kind}]")
                   .Prop("Path", d.Path.ToString(PathTable))
                   .Prop("PartialSealId", d.PartialSealId)
                   .Prop("Kind", kind)
                   .Prop("Producer", () => d.IsOutputDirectory() ? Analyzer.GetPip(PipGraph.TryGetProducer(d)) : null)
                   .Prop("Consumers", PipGraph.GetConsumingPips(d))
                   .Prop("Members", () => d.IsOutputDirectory()
                    ? (object)Analyzer.GetDirMembers(d)
                    : d.PartialSealId > 0
                        ? PipGraph.ListSealedDirectoryContents(d).Select(f => f.Path)
                        : CollectionUtilities.EmptyArray <AbsolutePath>())
                   .Build());
        }