chiark / gitweb /
try to hit the build over the head to get the version number right
[jarrg-ian.git] / build-sh
index eb3d1e2e2da1e38324cfa60e0ddfcc96b3670839..1496b6462b6e9c9806a7e366a562a351d1f9a463 100755 (executable)
--- a/build-sh
+++ b/build-sh
@@ -5,7 +5,7 @@
 set -e
 
 case "$#.$1" in
-0    ;;
+0.)    ;;
 *.-*)  echo >&2 'no options allowed'; exit 1;;
 *)     echo >&2 'no arguments allowed'; exit 1;;
 esac
@@ -13,13 +13,25 @@ esac
 : ${JAVA_HOME:=/usr/lib/jvm/java-6-sun}
 export JAVA_HOME
 
-(set -e; cd src; ant -f PCTB.xml)
+revision=`git describe --always || echo '(unknown revision)'`
+cat >src/com/tedpearson/ypp/market/Version.java <<END
+  package com.tedpearson.ypp.market;
+  public class Version {
+      public final static String version = "$revision";
+  }
+END
+rm -f src/build/com/tedpearson/ypp/market/Version.class
+rm -f *.jar
+
+cd src
+ant -f PCTB.xml
+cd ..
 
 echo "
 Building tarball
 "
 
-GZIP=-9v tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
+GZIP='-9v --rsyncable' tar --exclude=\*{~,.tar.gz,.exe} --exclude='#*#' \
   --transform='s/^./jpctb/' --exclude=jpctb/{src/build,tmp} \
   -zcf jpctb.tar.gz .
 
@@ -31,10 +43,9 @@ Generated OK:
 ls -al $files
 
 pubbase="${JPCTB_PUBLISH_BASE-login.chiark.greenend.org.uk}"
-pubdir="${JPCTB_PUBLISH_DIR-/home/yarrgweb/public-html/jpctb}"
-revision=`git describe --always`
+pubdir="${JPCTB_PUBLISH_DIR-/home/yarrgweb/public-html/download/jpctb}"
 
 echo "
 Install with:
- RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/$revision/
+ RSYNC_RSH=ssh rsync -vP $files $pubbase:$pubdir/test/
 "