title: How to autoincrement versionCode in Android Gradle
body: <p>I'm experimenting with new Android build system based on Gradle and I'm thinking, what is the best way to autoincrease versionCode with it. I am thinking about two options</p>
  
  <ol>
  <li>create versionCode file, read number from it, increase it and write it back to the file</li>
  <li>parse AndroidManifest.xml, read versionCode from it, increase it and write it back to the AndroidManifest.xml</li>
  </ol>
  
  <p>Is there any more simple or suitable solution? </p>
  
  <p>Has anyone used one of mentiod options and could share it with me?</p>