title: How to pass parameters from gradle to ant?
body: <p>I have the following two files:</p>
  
  <p><em>build.gradle</em>:</p>
  
  <pre><code>ant.importBuild 'build.xml'
  </code></pre>
  
  <p><em>build.xml</em>:</p>
  
  <pre><code>&lt;project&gt;
      &lt;target name="hello"&gt;
          &lt;echo&gt;Hello, I'm ${testVar}&lt;/echo&gt;
      &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>How can I pass <code>testVar</code> variable from gradle to ant to trigger the ant build?</p>
  
  <p><code>gradle -PtestVar=John hello</code> outputs</p>
  
  <pre><code>&gt; Task :hello
  [ant:echo] Hello, I'm ${testVar}
  </code></pre>
  
  <p>This means that <code>testVar</code> isn't assigned a value.</p>
  
  <p>I can pass <code>testVar</code> variable to ant directly by using <code>ant -DtestVar=John -buildfile build.xml hello</code> command. </p>
  
  <p>How can I do the same thing using gradle?</p>