title: Specification of Includes and Excludes for Gradle Copy Tasks
body: <p>I have a copy task with a set of inclusions</p>
  
  <pre><code>    task test_init(dependsOn: generate_scripts){
  
      doFirst{
          mkdir (project.test_dir)
          mkdir (project.test_data_dir)
          mkdir (project.test_reports_dir)
          mkdir (project.test_logs_dir)
          mkdir (project.test_jasper_dir)
          mkdir (project.test_chart_dir)
      }
  
      doLast{
          copy
          {
              from"${test_script_hsqldb_nd}"
              into"${test_dir}"
          }
          copy
          {
              from"${test_script_create_constraints}"
              into"${test_dir}"
          }
          copy
          {
              from"${test_script_drop_constraints}"
              into"${test_dir}"
          }
  
          copy
          {
              from fileTree(dir: "${test_src_dir}",
              include:
              [
                  '**/*.xml',
                  '**/*.dtd',
                  '**/*.csv',
                  '**/*.mpp',
                  '**/*.dic',
                  '**/*.png',
                  '**/*.properties'
              ])
              into"${build_classes_dir}"
  
  
          }
      }
  
  //////THIS IS MY UGLY WORKAROUND////////////////////
      doLast{
          delete "${build_classes_dir}/com/XXXX/ppm/gantt"
          delete "${build_classes_dir}/com/XXXX/ppm/util"
          delete "${build_classes_dir}/com/XXXX/ppm/action/pageinformation"
      }
  }
  </code></pre>
  
  <p>It works fine and dandy however there are 3 folders that are included in the 'from' tree of the last copy task that don't contain any files pertinent to the inclusions, as such following the task they are empty. 
  I would like to have them excluded from the task altogether but I'm having troubles achieving that. Currently I am simply deleting them in the final final 'doLast' block and that seems a little stupid.
  I have tried</p>
  
  <pre><code>exclude: "${test_src_dir}/com/XXXX/ppm/gantt",..**similar statements for other files**
  </code></pre>
  
  <p>and </p>
  
  <pre><code>exclude: "${test_src_dir}/**/gantt"
  </code></pre>
  
  <p>Though I have a feeling the '**' usage isn't right in this context.
  I would appreciate any input people may have.</p>