示例#1
0
        public bool Build(BuildTask buildTask, out bool executeOnErrors)
        {
            executeOnErrors = false;
            try {
                Init();

                // populate list of referenced items and metadata
                ParseTaskAttributes(buildTask);
                if (consumedMetadataReferences.Count == 0)
                {
                    // No batching required
                    if (ConditionParser.ParseAndEvaluate(buildTask.Condition, project))
                    {
                        return(buildTask.Execute());
                    }
                    else                     // skipped, it should be logged
                    {
                        return(true);
                    }
                }

                BatchAndPrepareBuckets();
                return(Run(buildTask, out executeOnErrors));
            } finally {
                consumedItemsByName          = null;
                consumedMetadataReferences   = null;
                consumedQMetadataReferences  = null;
                consumedUQMetadataReferences = null;
                batchedItemsByName           = null;
                commonItemsByName            = null;
            }
        }
		public bool Build (BuildTask buildTask, out bool executeOnErrors)
		{
			executeOnErrors = false;
			try {
				Init ();

				// populate list of referenced items and metadata
				ParseTaskAttributes (buildTask);
				if (consumedMetadataReferences.Count == 0) {
					// No batching required
					if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project))
						return buildTask.Execute ();
					else // skipped, it should be logged
						return true;
				}

				BatchAndPrepareBuckets ();
				return Run (buildTask, out executeOnErrors);
			} finally {
				consumedItemsByName = null;
				consumedMetadataReferences = null;
				consumedQMetadataReferences = null;
				consumedUQMetadataReferences = null;
				batchedItemsByName = null;
				commonItemsByName = null;
			}
		}
		bool Run (BuildTask buildTask, out bool executeOnErrors)
		{
			executeOnErrors = false;

			// Run the task in batches
			bool retval = true;
			if (buckets.Count == 0) {
				// batched mode, but no values in the corresponding items!
				if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
					retval = buildTask.Execute ();
					if (!retval && !buildTask.ContinueOnError)
						executeOnErrors = true;
				}

				return retval;
			}

			// batched
			foreach (Dictionary<string, BuildItemGroup> bucket in buckets) {
				project.PushBatch (bucket, commonItemsByName);
				try {
					if (ConditionParser.ParseAndEvaluate (buildTask.Condition, project)) {
						 retval = buildTask.Execute ();
						 if (!retval && !buildTask.ContinueOnError) {
							executeOnErrors = true;
							break;
						 }
					}
				} finally {
					project.PopBatch ();
				}
			}

			return retval;
		}
        bool Run(BuildTask buildTask, out bool executeOnErrors)
        {
            executeOnErrors = false;

            // Run the task in batches
            bool retval = true;

            if (buckets.Count == 0)
            {
                // batched mode, but no values in the corresponding items!
                if (ConditionParser.ParseAndEvaluate(buildTask.Condition, project))
                {
                    retval = buildTask.Execute();
                    if (!retval && !buildTask.ContinueOnError)
                    {
                        executeOnErrors = true;
                    }
                }

                return(retval);
            }

            // batched
            foreach (Dictionary <string, BuildItemGroup> bucket in buckets)
            {
                project.PushBatch(bucket, commonItemsByName);
                try
                {
                    if (ConditionParser.ParseAndEvaluate(buildTask.Condition, project))
                    {
                        retval = buildTask.Execute();
                        if (!retval && !buildTask.ContinueOnError)
                        {
                            executeOnErrors = true;
                            break;
                        }
                    }
                }
                finally
                {
                    project.PopBatch();
                }
            }

            return(retval);
        }