Example #1
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);
            }
Example #2
0
		public static bool Clean (WrenchProject proj, BuildServices bs) {
			BuiltItem bi = bs.GetRawCachedValue ();

			if (!bi.IsValid)
				return false;

			bs.Logger.Log ("operation.clean", bs.FullName);
			if (bi.Result.Clean (bs.Context))
				// FIXME: rename to After
				DoBeforeClean (proj, bs);

			bs.UncacheValue ();
			return false;
		}
Example #3
0
        public static bool Clean(WrenchProject proj, BuildServices bs)
        {
            BuiltItem bi = bs.GetRawCachedValue();

            if (!bi.IsValid)
            {
                return(false);
            }

            bs.Logger.Log("operation.clean", bs.FullName);
            if (bi.Result.Clean(bs.Context))
            {
                // FIXME: rename to After
                DoBeforeClean(proj, bs);
            }

            bs.UncacheValue();
            return(false);
        }