/// <summary>
		/// Parses the NAnt console output and extracts a set of 
		/// Tasks.
		/// </summary>
		/// <param name="output">The NAnt console output to parse.</param>
		/// <returns>A <see cref="TaskCollection"/>.</returns>
		public static TaskCollection Parse(string output)
		{
			TaskCollection tasks = new TaskCollection();
			
			output = output.Replace("\r\n", "\n");
			
			// Look for errors on a per line basis.
			Task task = null;
			StringReader reader = new StringReader(output);
			while (reader.Peek() != -1) {
				
				string currentLine = reader.ReadLine();
				if (currentLine.StartsWith("BUILD FAILED")) {
				    break;
				}
				
				task = ParseLine(currentLine);
				if (task != null) {
					tasks.Add(task);
				}
			}
			reader.Close();
						
			// Look for multiline build errors.
			task = ParseMultilineBuildError(output);
			if (task != null) {
				tasks.Add(task);
			}
			
			// Look for NAnt build failed.
			task = ParseNAntBuildFailedError(output);
			if (task != null) {
				tasks.Add(task);
			}
				
			return tasks;
		}
Beispiel #2
0
 /// <summary>
 ///     <para>
 ///       Initializes a new instance of <see cref='TaskCollection'/> based on another <see cref='TaskCollection'/>.
 ///    </para>
 /// </summary>
 /// <param name='val'>
 ///       A <see cref='TaskCollection'/> from which the contents are copied
 /// </param>
 public TaskCollection(TaskCollection val)
 {
     this.AddRange(val);
 }
Beispiel #3
0
 public TaskEnumerator(TaskCollection mappings)
 {
     this.temp           = ((IEnumerable)(mappings));
     this.baseEnumerator = temp.GetEnumerator();
 }
		/// <summary>
		///     <para>
		///       Initializes a new instance of <see cref='TaskCollection'/> based on another <see cref='TaskCollection'/>.
		///    </para>
		/// </summary>
		/// <param name='val'>
		///       A <see cref='TaskCollection'/> from which the contents are copied
		/// </param>
		public TaskCollection(TaskCollection val)
		{
			this.AddRange(val);
		}
			public TaskEnumerator(TaskCollection mappings)
			{
				this.temp = ((IEnumerable)(mappings));
				this.baseEnumerator = temp.GetEnumerator();
			}
		/// <summary>
		///     <para>
		///       Adds the contents of another <see cref='TaskCollection'/> to the end of the collection.
		///    </para>
		/// </summary>
		/// <param name='val'>
		///    A <see cref='TaskCollection'/> containing the objects to add to the collection.
		/// </param>
		/// <returns>
		///   <para>None.</para>
		/// </returns>
		/// <seealso cref='TaskCollection.Add'/>
		public void AddRange(TaskCollection val)
		{
			for (int i = 0; i < val.Count; i++)
			{
				this.Add(val[i]);
			}
		}