title: gradle: how to invoke ant.javac with multiple includes defined at runtime?
body: <p><a href="https://stackoverflow.com/questions/53451406">for some reasons</a> I don't use the java plugin for gradle, but I invoke <code>ant.javac</code>dynamically. How can I build a dynamic javac <code>include()</code> based on a list ?</p>
  
  <p>for example:</p>
  
  <pre><code>def srcToCompile=["**/File1.java","**/File2.java","**/FileN.java"];
  (...)
  ant.javac(
      destdir: tmpDir,
      srcdir: srcDir
      includeantruntime:false,
      failonerror: true,
      fork: true,
      classpath : classpath1,
      debug: true
      )  {
          include(name: srcToCompile) //&lt;&lt; DOESN'T WORK, I also tested srcToCompile.join(":")
      }
  </code></pre>
  
  <p>thanks.</p>
  
  <p><strong>EDIT</strong>: by 'doesn't work', I mean <code>ant.javac</code> doesn't interpret a <code>List</code> or a colon-separated-string: no source is found and nothing is compiled. <code>ant.javac</code> expects something like</p>
  
  <pre><code>include(name:"**/File1.java")
  include(name:"**/File2.java")
  include(name:"**/FileN.java")
  </code></pre>
  
  <p>but I want to generate this list of <code>include</code> when gradle is invoked.</p>