Ejemplo n.º 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)));
        }
Ejemplo n.º 2
0
        private ObjectInfo FileArtifactInfo(FileArtifact f)
        {
            if (!f.IsValid)
            {
                return(new ObjectInfo("Invalid"));
            }

            return(new ObjectInfoBuilder()
                   .Preview(FileArtifactPreview(f))
                   .Prop("Path", f.Path.ToString(PathTable))
                   .Prop("Kind", f.IsSourceFile ? "source" : "output")
                   .Prop("RewriteCount", f.RewriteCount)
                   .Prop("FileContentInfo", () => Analyzer.TryGetFileContentInfo(f))
                   .Prop("Producer", () => f.IsOutputFile ? Analyzer.GetPip(PipGraph.GetProducer(f)) : null)
                   .Prop("Consumers", () => PipGraph.GetConsumingPips(f.Path))
                   .Build());
        }
Ejemplo n.º 3
0
        private ObjectInfo FileArtifactInfo(FileArtifact f)
        {
            if (!f.IsValid)
            {
                return(new ObjectInfo("Invalid"));
            }

            return(new ObjectInfo(
                       preview: FileArtifactPreview(f),
                       properties: new[]
            {
                new Property("Path", f.Path.ToString(PathTable)),
                new Property("Kind", f.IsSourceFile ? "source" : "output"),
                new Property("RewriteCount", f.RewriteCount),
                new Property("FileContentInfo", () => Analyzer.TryGetFileContentInfo(f)),
                f.IsOutputFile ? new Property("Producer", () => Analyzer.GetPip(PipGraph.GetProducer(f))) : null,
                new Property("Consumers", () => PipGraph.GetConsumingPips(f.Path))
            }
                       .Where(p => p != null)));
        }
Ejemplo n.º 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 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)));
        }
Ejemplo n.º 5
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());
        }