Add commit hash to a version name of snapshot builds.

This commit is contained in:
Ryszard Wiśniewski 2011-05-17 10:01:06 +02:00
parent 75bba88e28
commit b539c3c1a1
3 changed files with 26 additions and 1 deletions

View File

@ -49,6 +49,18 @@
</excludes>
</configuration>
</plugin>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<goals>
<goal>revision</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
@ -104,4 +116,12 @@
<version>1.3</version>
</dependency>
</dependencies>
<pluginRepositories>
<pluginRepository>
<id>sonatype-releases</id>
<name>Sonatype Releases</name>
<url>https://oss.sonatype.org/content/repositories/releases/</url>
</pluginRepository>
</pluginRepositories>
</project>

View File

@ -375,7 +375,11 @@ public class Androlib {
}
public static String getVersion() {
return ApktoolProperties.get("aversion");
String version = ApktoolProperties.get("aversion");
return version.endsWith("-SNAPSHOT") ?
version.substring(0, version.length() - 9) + '.' +
ApktoolProperties.get("git.commit.id.abbrev")
: version;
}
private File[] parseUsesFramework(Map<String, Object> usesFramework)

View File

@ -1 +1,2 @@
aversion = ${aversion}
git.commit.id.abbrev = ${git.commit.id.abbrev}