[Android] Calculate revision in gradle and store it in app
Geoffrey Métais
git at videolan.org
Tue Feb 10 14:47:53 CET 2015
vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Feb 10 14:46:39 2015 +0100| [cf1db7584f3d5c52ac1f971f7a985a4255deb950] | committer: Geoffrey Métais
Calculate revision in gradle and store it in app
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=cf1db7584f3d5c52ac1f971f7a985a4255deb950
---
vlc-android/build.gradle | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/vlc-android/build.gradle b/vlc-android/build.gradle
index eca896b..ceb4c3e 100644
--- a/vlc-android/build.gradle
+++ b/vlc-android/build.gradle
@@ -18,6 +18,7 @@ android {
resValue "string", "build_time", buildTime()
resValue "string", "build_host", hostName()
+ resValue "string", "build_revision", revision()
//Set the build ABI according to build types
tasks.whenTaskAdded { task ->
@@ -183,4 +184,13 @@ def buildTime() {
def hostName() {
return System.getProperty("user.name") + "@" + InetAddress.localHost.hostName
+}
+
+def revision() {
+ def code = new ByteArrayOutputStream()
+ exec {
+ commandLine 'git', 'rev-parse', '--short', 'HEAD'
+ standardOutput = code
+ }
+ return code.toString()
}
\ No newline at end of file
More information about the Android
mailing list