<commit_before>//
// NAntContrib
// Copyright (C) 2002 <NAME> (<EMAIL>)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
//

using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Text;
using NAnt.Core.Attributes;
using NAnt.Core;
using NAnt.Core.Types;

namespace NAnt.Contrib.Tasks 
{ 

   /// <summary>
   /// A task that concatenates a set of files.
   /// Loosely based on Ant's Concat task.
   /// </summary>
   /// <remarks>
   /// This task takes a set of input files in a fileset
   /// and concatenates them into a single file. You can 
   /// either replace the output file, or append to it 
   /// by using the append attribute.
   /// 
   /// The order the files are concatenated in is not
   /// especified.
   /// </remarks>
   /// <example>
   ///   <code><![CDATA[
   ///   <concat destfile="${outputdir}\Full.txt" append="true">
   ///      <fileset>
   ///         <includes name="${outputdir}\Test-*.txt" />
   ///      </fileset>
   ///   </concat>
   ///   
   ///   ]]></code>
   /// </example>
   [TaskName("concat")]
   public class ConcatTask : Task
   {
      private string _destination;
      private bool _append = false;
      private FileSet _fileset = new FileSet();

      /// <summary>
      /// Name of Destination file.
      /// </summary>
      [TaskAttribute("destfile", Required=true)]
      public string Destination { 
         get { return _destination; } 
         set { _destination = value; } 
      }
        
      /// <summary>
      /// Whether to append to the destination file (true),
      /// or replace it (false). Default is false.
      /// </summary>
      [TaskAttribute("append"), BooleanValidator()]
      public bool Append { 
         get { return _append; } 
         set { _append = value; } 
      }

      /// <summary>
      /// Set of files to use as input
      /// </summary>
      [FileSet("fileset")]
      public FileSet FileSet {
        get { return _fileset; }
        set { _fileset = value; }
      }


      ///<summary>
      ///Initializes task and ensures the supplied attributes are valid.
      ///</summary>
      ///<param name="taskNode">Xml node used to define this task instance.</param>
      protected override void InitializeTask(System.Xml.XmlNode taskNode) <commit_msg>replaced FileSet attribute with BuildElement attribute, as FileSetAttribute is now deprecated<commit_after>//
// NAntContrib
// Copyright (C) 2002 <NAME> (<EMAIL>)
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
//

using System;
using System.Collections;
using System.IO;
using System.Reflection;
using System.Text;
using NAnt.Core.Attributes;
using NAnt.Core;
using NAnt.Core.Types;

namespace NAnt.Contrib.Tasks 
{ 

   /// <summary>
   /// A task that concatenates a set of files.
   /// Loosely based on Ant's Concat task.
   /// </summary>
   /// <remarks>
   /// This task takes a set of input files in a fileset
   /// and concatenates them into a single file. You can 
   /// either replace the output file, or append to it 
   /// by using the append attribute.
   /// 
   /// The order the files are concatenated in is not
   /// especified.
   /// </remarks>
   /// <example>
   ///   <code><![CDATA[
   ///   <concat destfile="${outputdir}\Full.txt" append="true">
   ///      <fileset>
   ///         <includes name="${outputdir}\Test-*.txt" />
   ///      </fileset>
   ///   </concat>
   ///   
   ///   ]]></code>
   /// </example>
   [TaskName("concat")]
   public class ConcatTask : Task
   {
      private string _destination;
      private bool _append = false;
      private FileSet _fileset = new FileSet();

      /// <summary>
      /// Name of Destination file.
      /// </summary>
      [TaskAttribute("destfile", Required=true)]
      public string Destination { 
         get { return _destination; } 
         set { _destination = value; } 
      }
        
      /// <summary>
      /// Whether to append to the destination file (true),
      /// or replace it (false). Default is false.
      /// </summary>
      [TaskAttribute("append"), BooleanValidator()]
      public bool Append { 
         get { return _append; } 
         set { _append = value; } 
      }

      /// <summary>
      /// Set of files to use as input
      /// </summary>
      [BuildElement("fileset")]
      public FileSet FileSet {
        get { return _fileset; }
        set { _fileset = value; }
      }


      ///<summary>
      ///Initializes task and ensures the supplied attributes are valid.
      ///</summary>
      ///<param name="taskNode">Xml node used to define this task instance.</param>
      protected override void InitializeTask(System.Xml.XmlNode taskNode) 
{'fraction_non_alphanumeric': 0.12333278445578791, 'fraction_numerical': 0.006586530545035402, 'mean_word_length': 2.2052770448548813, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4518347', 'n_tokens_mistral': 1704, 'n_tokens_neox': 1635, 'n_words': 652}