Add a --fast option to to_jetty.sh to reduce build times

This is "unsafe" as it may miss changes in gwtorm, gwtjsonrpc, jgit
or mina_sshd, but it runs in 38 seconds vs. 2 minutes to do a full
clean build and test.  It also packages too much into the WAR, old
compiled copies of the JavaScript are left laying around.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-01-07 09:50:55 -08:00
parent 0c35dc3543
commit 9de743f733

View File

@@ -3,9 +3,10 @@
# Builds and deploys into Jetty; primarily for debugging
jetty=$1
fast=$2
if [ -z "$jetty" ]
then
echo >&2 "usage: $0 jettydir"
echo >&2 "usage: $0 jettydir [--fast]"
exit 1
fi
if ! [ -f "$jetty/etc/jetty.xml" ]
@@ -14,13 +15,21 @@ then
exit 1
fi
(cd appdist && mvn clean install) &&
out=$(cd appdist/target/gerrit-*-bin.dir/gerrit-* && pwd) &&
ctx="$jetty/contexts/gerrit.xml" &&
cp $out/www/gerrit-*.war "$jetty/webapps/gerrit.war" &&
if [ -f "$ctx" -a -n "$fast" ]
then
echo >&2 "warning: Using fast mode to build only GWT..."
echo >&2
(cd appjar && mvn install) &&
(cd appwar && mvn package) &&
cp appwar/target/gerrit-*.war "$jetty/webapps/gerrit.war" &&
touch "$ctx"
else
(cd appdist && mvn clean install) &&
out=$(cd appdist/target/gerrit-*-bin.dir/gerrit-* && pwd) &&
cp $out/www/gerrit-*.war "$jetty/webapps/gerrit.war" &&
if [ -f "$ctx" ]
then
touch "$ctx"
@@ -30,5 +39,8 @@ else
rm -f "$jetty/contexts/test.xml" &&
cp $out/www/jetty_gerrit.xml "$ctx" &&
echo "You need to edit and configure $ctx"
echo >&2 &&
echo >&2 "You need to edit and configure $ctx"
fi
fi