title: Specifying output files for a copy task in Gradle
body: <p>I have a task which copies a bunch of files from one location into another. It looks like:</p>
  
  <pre><code>task copyStuff (type: Copy) {
      from tempDir
      into buildDir
  }
  </code></pre>
  
  <p>Where <code>tempDir</code> and <code>buildDir</code> are simply Strings. I'm attempting to specify the inputs and outputs of the task to avoid doing it when not necessary, but am having some trouble with the outputs specifically. The inputs are easy:</p>
  
  <pre><code>task copyStuff (type: Copy) {
      inputs.dir tempDir
      from tempDir
      into buildDir
  }
  </code></pre>
  
  <p>But how to specify the outputs in this case? The <code>buildDir</code> can have other things on it, not just the files being copied, so I think I need to specify the <code>outputs.files</code> specifically using the files being copied in. However, I'm unsure of the best way to do that.</p>
  
  <p>Outside of the task, should I loop over the files in the tempDir, and create a list of files similar, but in the buildDir instead? Is there an easier way?</p>