Пример #1
0
 private static ObjectInfo PipGraphInfo(IPipGraph graph)
 {
     return(new ObjectInfo(
                "PipGraph",
                null,
                Lazy.Create <IReadOnlyList <Property> >(() => new[]
     {
         new Property("Process Pips", Lazy.Create <object>(() => graph.RetrieveScheduledPips().Where(pip => pip.PipType == PipType.Process))),
         new Property("Seal Directory Pips", Lazy.Create <object>(() => graph.RetrieveScheduledPips().Where(pip => pip.PipType == PipType.SealDirectory))),
         new Property("Copy Pips", Lazy.Create <object>(() => graph.RetrieveScheduledPips().Where(pip => pip.PipType == PipType.CopyFile))),
     })));
 }
Пример #2
0
 private static ObjectInfo PipGraphInfo(IPipGraph graph)
 {
     return(new ObjectInfo(
                "PipGraph",
                Enum.GetValues(typeof(PipType))
                .Cast <PipType>()
                .Select(pipType => new Property(pipType.ToString(), () => graph.RetrieveScheduledPips().Where(pip => pip.PipType == pipType).ToArray()))
                .ToArray()));
 }
Пример #3
0
        public ISourceFile Generate(IPipGraph pipGraph)
        {
            var statements = new List <IStatement>();

            foreach (var pip in pipGraph.RetrieveScheduledPips())
            {
                statements.Add(Generate(pip));
            }

            return(new TypeScript.Net.Types.SourceFile(statements.ToArray()));
        }
Пример #4
0
        /// <summary>
        /// Serializes pip graph fragment.
        /// </summary>
        public void Serialize(AbsolutePath filePath, IPipGraph pipGraph, string fragmentDescription = null, bool useTopSortSerialization = false)
        {
            if (useTopSortSerialization)
            {
                var topSorter  = new PipGraphFragmentTopSort(pipGraph);
                var sortedPips = topSorter.Sort();
                int pipCount   = sortedPips.Aggregate(0, (n, layer) => n + layer.Count);

                SerializeTopSort(filePath, sortedPips, pipCount, fragmentDescription);
            }
            else
            {
                SerializeSerially(filePath, pipGraph.RetrieveScheduledPips().ToList(), fragmentDescription);
            }
        }
Пример #5
0
 /// <summary>
 /// Topologically sort pips in the pip graph.
 /// </summary>
 public List <List <Pip> > Sort() => TopSort(m_pipGraph.RetrieveScheduledPips().ToList());
Пример #6
0
 /// <summary>
 /// Serializes this instance of pip graph fragment to a stream.
 /// </summary>
 public void Serialize(Stream stream) =>
 new PipGraphFragmentSerializer(
     Context,
     new PipGraphFragmentContext())
 .SerializeSerially(stream, m_pipGraph.RetrieveScheduledPips().ToList(), m_moduleId.Value.ToString(Context.StringTable));