mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-15 15:41:24 +01:00
make git version available as a read-only advanced preference. I sure
hope I never need to ask a user to transcribe this!
This commit is contained in:
parent
cbbaeb57a0
commit
d98b2ad5d6
3 changed files with 23 additions and 16 deletions
|
@ -326,4 +326,6 @@
|
|||
<string name="playerf">Player %d</string>
|
||||
<string name="initial_game_minutes">Game time (minutes)</string>
|
||||
|
||||
<string name="git_rev_title">Source version id</string>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -147,5 +147,10 @@
|
|||
android:title="@string/dict_host"
|
||||
android:defaultValue="@string/dict_url"
|
||||
/>
|
||||
|
||||
<EditTextPreference android:title="@string/git_rev_title"
|
||||
android:summary="@string/git_rev_gen"
|
||||
android:enabled="false"
|
||||
/>
|
||||
</PreferenceScreen>
|
||||
</PreferenceScreen>
|
||||
|
|
|
@ -3,22 +3,22 @@
|
|||
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
|
||||
GITVERSION=$(scripts/gitversion.sh)
|
||||
|
||||
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";
|
||||
}
|
||||
# TODO: deal with case where there's no hash available -- exported
|
||||
# code maybe? Better: gitversion.sh does that.
|
||||
|
||||
cat <<EOF > android/XWords4/res/values/git_string.xml
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- auto-generated; do not edit -->
|
||||
|
||||
<resources>
|
||||
<string name="git_rev_gen">$GITVERSION</string>
|
||||
</resources>
|
||||
EOF
|
||||
|
||||
# touch the file that depends on VERS.java
|
||||
touch android/XWords4/src/org/eehouse/android/xw4/Utils.java
|
||||
# touch the files that depend on git_string.xml. (I'm not sure that
|
||||
# this list is complete or if ant and java always get dependencies
|
||||
# right. Clean builds are the safest.)
|
||||
touch android/XWords4/res/xml/xwprefs.xml
|
||||
touch android/XWords4/gen/org/eehouse/android/xw4/R.java
|
||||
|
|
Loading…
Reference in a new issue