示例#1
0
 public WrenchProject(SourceSettings ss, IGraphState graph,
                      ActionLog log)
 {
     this.ss      = ss;
     this.log     = log;
     this.graph   = graph;
     this.manager = WrenchOperations.MakeManager(this);
 }
示例#2
0
            public BuiltItem[] EvaluateTargets(int[] targets)
            {
                BuiltItem[] bis = new BuiltItem[targets.Length];

                for (int i = 0; i < targets.Length; i++)
                {
                    //proj.Log.PushLocation (targets[i]);
                    BuildServices bs = proj.GetTargetServices(targets[i]);
                    //proj.Log.PopLocation ();

                    if (bs == null)
                    {
                        return(null);
                    }

                    switch (proj.GetTargetState(targets[i]))
                    {
                    case WrenchProject.TargetState.BuiltOk:
                        //Console.WriteLine ("EVAL {0}: from cache", targets[i]);
                        bis[i] = bs.GetRawCachedValue();
                        break;

                    case WrenchProject.TargetState.BuiltError:
                        //Console.WriteLine ("EVAL {0}: errored", targets[i]);
                        return(null);

                    case WrenchProject.TargetState.Building:
                        //Console.WriteLine ("EVAL {0}: recursed", targets[i]);
                        bs.Logger.Error(2048, "Recursion in build; this target depends on " + targets[i] +
                                        " which is currently being built", null);
                        return(null);

                    default:
                        //Console.WriteLine ("EVAL {0}: build it", targets[i]);
                        // State unknown. Load from cache if possible, otherwise build.

                        proj.Log.PushLocation(bs.FullName);
                        bis[i] = WrenchOperations.BuildValue(proj, bs);
                        proj.Log.PopLocation();

                        if (!bis[i].IsValid)
                        {
                            return(null);
                        }
                        break;
                    }
                }

                return(bis);
            }