mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-28 07:58:08 +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="playerf">Player %d</string>
|
||||||
<string name="initial_game_minutes">Game time (minutes)</string>
|
<string name="initial_game_minutes">Game time (minutes)</string>
|
||||||
|
|
||||||
|
<string name="git_rev_title">Source version id</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
@ -147,5 +147,10 @@
|
||||||
android:title="@string/dict_host"
|
android:title="@string/dict_host"
|
||||||
android:defaultValue="@string/dict_url"
|
android:defaultValue="@string/dict_url"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<EditTextPreference android:title="@string/git_rev_title"
|
||||||
|
android:summary="@string/git_rev_gen"
|
||||||
|
android:enabled="false"
|
||||||
|
/>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
</PreferenceScreen>
|
</PreferenceScreen>
|
||||||
|
|
|
@ -3,22 +3,22 @@
|
||||||
cd $(dirname $0)
|
cd $(dirname $0)
|
||||||
cd ../../
|
cd ../../
|
||||||
|
|
||||||
SVNVERSION=$(svnversion)
|
GITVERSION=$(scripts/gitversion.sh)
|
||||||
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
|
# TODO: deal with case where there's no hash available -- exported
|
||||||
// auto-generated; do not edit
|
# code maybe? Better: gitversion.sh does that.
|
||||||
package org.eehouse.android.xw4;
|
|
||||||
class SvnVersion {
|
cat <<EOF > android/XWords4/res/values/git_string.xml
|
||||||
public static final String VERS = "$SVNVERSION";
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
}
|
<!-- auto-generated; do not edit -->
|
||||||
|
|
||||||
|
<resources>
|
||||||
|
<string name="git_rev_gen">$GITVERSION</string>
|
||||||
|
</resources>
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# touch the file that depends on VERS.java
|
# touch the files that depend on git_string.xml. (I'm not sure that
|
||||||
touch android/XWords4/src/org/eehouse/android/xw4/Utils.java
|
# 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…
Add table
Reference in a new issue