private static Task <BuildGraph> ReadGraph(string fullPath) { return(Task.Factory.StartNew(() => { GraphReader reader = new GraphReader(fullPath, null); return reader.ReadGraph(); })); }
public static void Main(string[] arguments) { string debug = Environment.GetEnvironmentVariable("MimicGeneratorDebugOnStart"); if (debug != null && debug != "0") { Debugger.Launch(); } Stopwatch sw = Stopwatch.StartNew(); Args args = new Args(arguments); if (args.HelpDisplayed) { return; } try { GraphReader reader = new GraphReader(args.JsonGraph, args.ObservedInputs); BuildGraph graph = reader.ReadGraph(); if (args.DuplicateGraph > 1) { GraphMultiplier.DuplicateAsParallelGraphs(graph, args.DuplicateGraph, args.MaxPipsPerSpec); } BuildWriter writer = new BuildWriter(args.Dest, args.WriteInputs, args.InputScaleFactor, graph, args.IgnoreResponseFiles, args.Language); if (!writer.WriteBuildFiles()) { ExitError(sw); } Console.WriteLine("MimicGenerator completed successfully in {0} seconds.", sw.Elapsed.TotalSeconds); Environment.Exit(0); } catch (Exception ex) { ExitError(sw, ex); } }