title: Setting build properties in Android Gradle via Jenkins
body: <p>How do you tell Jenkins to set a property inside <code>gradle.properties</code> in an Android project? I've figured out how to get the properties from Gradle into Jenkins (by using the <em>EnvInject plugin</em> and simply entering <code>gradle.properties</code> into the property file field) but I also want the build number that is managed by Jenkins to be injected into the build artifact.</p>
  
  <p>I also want to set the filename of the resulting artifact which, I think, needs to be injected by using <code>archivesBaseName</code>. But that property isn't part of <code>gradle.properties</code> so I wonder how do I access it?</p>
  
  <p>So far I've only found solutions that change the <code>build.gradle</code> file (or other gradle scripts) in the Android project itself. But that's not what I want to do because that would make the Android code base rely on Jenkins.</p>
  
  <p>Instead I want Jenkins to provide the build number and artifact file name to the Android project before it compiles the code.</p>
  
  <p>The server runs on a Mac. Does anyone have a solution for this? Any shell/Groovy script that does the job would be welcome.</p>