work around svnversion not working inside git-managed tree

This commit is contained in:
eehouse 2010-02-28 18:17:35 +00:00
parent 5fc86dbe3a
commit f896e86693

View file

@ -3,11 +3,20 @@
cd $(dirname $0)
cd ../../
SVNVERSION=$(svnversion)
if [ -z "$SVNVERSION" -o "$SVNVERSION" = "exported" ]; then
SVNVERSION=$(git svn find-rev $(git log -1 --pretty=format:%H 2>/dev/null) \
2>/dev/null)
if git status | grep -q modified; then
SVNVERSION=${SVNVERSION}M
fi
fi
cat <<EOF > android/XWords4/src/org/eehouse/android/xw4/SvnVersion.java
// auto-generated; do not edit
package org.eehouse.android.xw4;
class SvnVersion {
public static final String VERS = "$(svnversion .)";
public static final String VERS = "$SVNVERSION";
}
EOF