Slight modification to *Mapper comments.
[online-glom:gwt-glom.git] / utils / build-onlineglom-war.sh
1 #!/bin/bash
2 #
3 # Script to build the OnlineGlom.war file.
4 #
5
6 # confirm that we're in the right dir
7 lastdir=$(pwd | sed -e "s|/| |g" | awk '{print $NF}')
8 if [ $lastdir != "gwt-glom" ]; then
9   scriptname=$(echo $0 | sed -e "s|^\./||")
10   echo $scriptname":"
11   echo "   Please run this script from the gwt-glom directory with this command:"
12   echo "   ./utils/"$scriptname
13   exit 1
14 fi
15
16
17 echo "Removing generated files ... "
18
19 rm --interactive=never -rfv src/main/webapp/WEB-INF/classes/* \
20                             src/main/webapp/WEB-INF/lib/* \
21                             src/main/webapp/WEB-INF/deploy/* \
22                             src/main/webapp/OnlineGlom/* \
23                             src/main/webapp/logs/* \
24                             src/main/gwt-unitCache \
25                             target/* target/.generated
26
27 echo "done"
28
29 echo "Building and creating OnlineGlom.war. This can take a couple of minutes ... "
30
31 mvn clean package
32
33 if [ $? -ne 0 -o ! -f target/gwt-glom-1.0-SNAPSHOT.war ]; then
34   echo "Error building OnlineGlom."
35   exit 1
36 fi
37
38 mv target/{gwt-glom-1.0-SNAPSHOT,OnlineGlom}.war
39
40 echo "done"
41
42 echo "The deployable war can be found here:"
43 echo ""
44 echo "   ./target/OnlineGlom.war"
45 echo ""
46 echo "You can scp or sftp it to your server for deployment."