title: How to use ant.properties in a `vendor.gradle` vendor settings file?
body: <p>I have a multi-project gradle build with an ant build script that contains a task such as this (simplified):</p>
  
  <pre><code>&lt;target name="get-version"&gt;
    &lt;!-- Goes out and fetches the versioning for each project and sets prop --&gt;
    &lt;property name="version" value="${myDesiredVersion}" /&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>and inside my build.gradle script I have an ant script loader and then I depend on this target; my issue is that this isn't being evaluated in a way that allows me to use my <code>ant.properties['version']</code> in <code>vendor.gradle</code> like</p>
  
  <pre><code>// version = '1.0.2' -- works
  version = ant.properties['version'] // doesn't work
  </code></pre>
  
  <p>I'm a gradle noobie and to top it off I'm migrating an ant project to start using gradle so I could be way off course. It's important to note that I can't just outright include the version in the <code>vendor.gradle</code> file since it's being generated by the ant-script.</p>
  
  <p>I'm not familiar with how I could insert this ahead of the gradle lifecycle... I tried something like this</p>
  
  <pre><code>gradle.beforeProject { p -&gt;
    tasks['get-version'].execute() // appears to execute successfully?
    configure(p) {
      def vendorSettings = file("${myRoot}/vendor.gradle")
      if(vendorSettings.exists()){
        println "Loading vendor settings for project " + p
        println ant.properties['version'] // but outputs null here
        // ant.properties is still a valid observable map
        apply from: vendorSettings
      }
    }
  }
  </code></pre>
  
  <p>and the ant <code>version</code> property was still null - note that it works outside of this, I think the scoping is a little different then I think it is in this specific situation</p>