include git rev hash in update info -- for later use detecting when a

tagged build has changed
This commit is contained in:
Eric House 2014-10-13 07:20:17 -07:00
parent 518a6a903d
commit 858187b9d7
2 changed files with 4 additions and 0 deletions

View file

@ -64,6 +64,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
private static final String k_NAME = "name";
private static final String k_AVERS = "avers";
private static final String k_GVERS = "gvers";
private static final String k_GHASH = "ghash";
private static final String k_INSTALLER = "installer";
private static final String k_DEVOK = "devOK";
private static final String k_APP = "app";
@ -143,6 +144,7 @@ public class UpdateCheckReceiver extends BroadcastReceiver {
appParams.put( k_AVERS, versionCode );
appParams.put( k_GVERS, BuildConstants.GIT_REV );
appParams.put( k_GHASH, BuildConstants.GIT_HASH );
appParams.put( k_INSTALLER, installer );
if ( devOK( context ) ) {
appParams.put( k_DEVOK, true );

View file

@ -43,12 +43,14 @@ EOF
# Eventually this should pick up a tag if we're at one. That'll be
# the way to mark a release
SHORTVERS="$(git describe --always $GITVERSION 2>/dev/null || echo ${GITVERSION}+)"
GITHASH=$(git rev-parse --verify HEAD)
cat <<EOF > ${BUILD_DIR}/src/org/eehouse/android/${VARIANT}/BuildConstants.java
// auto-generated (by $(basename $0)); do not edit
package org.eehouse.android.${VARIANT};
class BuildConstants {
public static final String GIT_REV = "$SHORTVERS";
public static final String GIT_HASH = "$GITHASH";
public static final String STRINGS_HASH = "$STRINGS_HASH";
public static final short CLIENT_VERS_RELAY = $CLIENT_VERS_RELAY;
public static final boolean CHAT_SUPPORTED = $CHAT_SUPPORTED;