Last active
August 29, 2015 14:06
-
-
Save kingargyle/c9e11a873f229832f299 to your computer and use it in GitHub Desktop.
Update Version Number in AndroidManifest with POM version number.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Include the following snippet in a profile or as part of your standard build. | |
It will parse out the POM version number and then use it to update the | |
version number in your AndroidManfiest.xml. It will also increment the | |
versionCode based on the version number. | |
No more manually having to update the vesion number as part of a release!! Yipee! | |
--> | |
<plugin> | |
<groupId>org.codehaus.mojo</groupId> | |
<artifactId>build-helper-maven-plugin</artifactId> | |
<executions> | |
<execution> | |
<id>parse-version</id> | |
<goals> | |
<goal>parse-version</goal> | |
</goals> | |
<phase>validate</phase> | |
</execution> | |
</executions> | |
</plugin> | |
<plugin> | |
<groupId>com.jayway.maven.plugins.android.generation2</groupId> | |
<artifactId>android-maven-plugin</artifactId> | |
<inherited>true</inherited> | |
<executions> | |
<execution> | |
<id>update-version-number</id> | |
<goals> | |
<goal>manifest-update</goal> | |
</goals> | |
<phase>process-resources</phase> | |
<configuration> | |
<manifest> | |
<versionName>${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}.${maven.build.timestamp}</versionName> | |
<versionCodeUpdateFromVersion>true</versionCodeUpdateFromVersion> | |
</manifest> | |
</configuration> | |
</execution> | |
</executions> | |
</plugin> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment