title: Delete directory with all files in it using gradle task
body: <p>In my project's root I have a directory as follows:</p>
  
  <pre><code>build/exploded-project/WEB-INF/classes
  </code></pre>
  
  <p>I want to delete all the files in the classes directory using a gradle task. I tried the of the following combinations but none of them worked:</p>
  
  <pre><code>task deleteBuild(type: Delete) {
      project.delete 'build/exploded-project/WEB-INF/classes/'
  }
  
  task deleteBuild(type: Delete) {
      delete 'build/exploded-project/WEB-INF/classes/'
  }
  
  task deleteBuild(type: Delete) {
      delete '$rootProject.projectDir/build/exploded-project/WEB-INF/classes/'
  }
  
  task deleteBuild(type: Delete) {
      delete fileTree('build/exploded-project/WEB-INF/classes').matching {
          include '**/*.class'
      }
  }
  </code></pre>