From d6c9efceda2ce7d9148bd813a43d9f70b2b7a120 Mon Sep 17 00:00:00 2001 From: Stefano Mazzocchi Date: Tue, 8 Jun 2010 22:27:59 +0000 Subject: [PATCH] more appengine infra git-svn-id: http://google-refine.googlecode.com/svn/trunk@955 7d457c2a-affb-35e4-300a-418c747d4874 --- appengine/webapp/WEB-INF/appengine-web.xml | 9 ++ .../WEB-INF}/lib/slf4j-jdk14-1.5.6.jar | Bin appengine/webapp/WEB-INF/logging.properties | 13 +++ build.xml | 82 ++++++++++++++++- gridworks | 86 ++++++++++++++---- 5 files changed, 169 insertions(+), 21 deletions(-) create mode 100644 appengine/webapp/WEB-INF/appengine-web.xml rename appengine/{ => webapp/WEB-INF}/lib/slf4j-jdk14-1.5.6.jar (100%) create mode 100644 appengine/webapp/WEB-INF/logging.properties diff --git a/appengine/webapp/WEB-INF/appengine-web.xml b/appengine/webapp/WEB-INF/appengine-web.xml new file mode 100644 index 000000000..818840528 --- /dev/null +++ b/appengine/webapp/WEB-INF/appengine-web.xml @@ -0,0 +1,9 @@ + + + $APPID + $VERSION + + + + + \ No newline at end of file diff --git a/appengine/lib/slf4j-jdk14-1.5.6.jar b/appengine/webapp/WEB-INF/lib/slf4j-jdk14-1.5.6.jar similarity index 100% rename from appengine/lib/slf4j-jdk14-1.5.6.jar rename to appengine/webapp/WEB-INF/lib/slf4j-jdk14-1.5.6.jar diff --git a/appengine/webapp/WEB-INF/logging.properties b/appengine/webapp/WEB-INF/logging.properties new file mode 100644 index 000000000..7714de9fe --- /dev/null +++ b/appengine/webapp/WEB-INF/logging.properties @@ -0,0 +1,13 @@ +# A default java.util.logging configuration. +# (All App Engine logging is through java.util.logging by default). +# +# To use this configuration, copy it into your application's WEB-INF +# folder and add the following to your appengine-web.xml: +# +# +# +# +# + +# Set the default logging level for all loggers +.level = WARN diff --git a/build.xml b/build.xml index 57530f4ea..dada97241 100644 --- a/build.xml +++ b/build.xml @@ -30,6 +30,18 @@ + + + + + + + + + + + + @@ -46,7 +58,8 @@ - + + @@ -63,12 +76,15 @@ + + + @@ -86,6 +102,13 @@ + + + + + + + @@ -93,6 +116,8 @@ + + @@ -110,6 +135,14 @@ + + + + + + + + @@ -120,6 +153,8 @@ + + @@ -128,8 +163,14 @@ + + + + + + @@ -291,6 +332,8 @@ + + @@ -367,11 +410,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/gridworks b/gridworks index 7dc9a8130..f73bfa134 100755 --- a/gridworks +++ b/gridworks @@ -55,27 +55,31 @@ where [options] include: and is one of - build ..................... Build Gridworks - run ....................... Run Gridworks [default] + build ............................ Build Gridworks + run .............................. Run Gridworks [default] - test ...................... Run all Gridworks tests - server_test ............... Run only the server tests - ui_test ................... Run only the UI tests + test ............................. Run all Gridworks tests + server_test ...................... Run only the server tests + ui_test .......................... Run only the UI tests + + appengine_build ... Build Gridworks for Google App Engine + appengine_run ..... Run Gridworks for Google App Engine in local server + appengine_upload ... Upload Gridworks to Google App Engine - findbugs .................. Run Findbugs against Gridworks - pmd ....................... Run PMD against Gridworks - cpd ....................... Run Copy/Paste Detection against Gridworks - jslint .................... Run JSlint against Gridworks + findbugs ......................... Run Findbugs against Gridworks + pmd .............................. Run PMD against Gridworks + cpd .............................. Run Copy/Paste Detection against Gridworks + jslint ........................... Run JSlint against Gridworks - whitespace .... Normalize whitespace in files with the given extension - - mac_dist ........ Make MacOSX binary distribution - windows_dist .... Make Windows binary distribution - linux_dist ...... Make Linux binary distribution - dist ............ Make all distributions + whitespace ........... Normalize whitespace in files with the given extension - clean ..................... Clean compiled classes - distclean ................. Remove all generated files + mac_dist ............... Make MacOSX binary distribution + windows_dist ........... Make Windows binary distribution + linux_dist ............. Make Linux binary distribution + dist ................... Make all distributions + + clean ............................ Clean compiled classes + distclean ........................ Remove all generated files EOF exit 1 @@ -243,7 +247,7 @@ tools_prepare() { mkdir $GRIDWORKS_TOOLS_DIR || error "Error while making directory $GRIDWORKS_TOOLS_DIR" fi } - + ant_prepare() { tools_prepare @@ -271,6 +275,18 @@ ant_prepare() { fi } +appengine_prepare() { + if [ -z "$APPENGINE_HOME" ]; then + error "You have to have the APPENGINE_HOME environment variable set and pointing to the local installation of the Google AppEngine SDK." + elif [ ! -f "$APPENGINE_HOME/bin/appcfg.sh" ]; then + error "Environment variable APPENGINE_HOME is set to '$APPENGINE_HOME' which doesn't point to a valid Google App Engine SDK." + fi + APPENGINE="$APPENGINE_HOME/bin/appcfg.sh" + APPENGINE_LOCAL="$APPENGINE_HOME/bin/dev_appserver.sh" + + ANT_PARAMS="$ANT_PARAMS -Dappengine.sdk.dir=$APPENGINE_HOME" +} + launch4j_prepare() { tools_prepare @@ -369,8 +385,7 @@ jslint_prepare() { tool_download $JSLINT_URL $JSLINT_FILE $JSLINT_DIR } - - + # ---------------------------------------------------------------------------------------------- ant() { @@ -551,6 +566,34 @@ server_test() { $RUN_CMD || error "Failed passing server tests" } +appengine_build() { + appengine_prepare + get_revision + + ANT_PARAMS="-Dappengine.sdk.dir=${APPENGINE_HOME}" + if [ -z "$1" ]; then + error "Must specify the application id" + else + ANT_PARAMS="$ANT_PARAMS -Dappengine.app_id=$1" + fi + + if [ "$2" ]; then + ANT_PARAMS="$ANT_PARAMS -Dappengine.version=$2" + fi + + ant prepare_webapp_appengine +} + +appengine_upload() { + appengine_build $1 $2 + "$APPENGINE" update "$GRIDWORKS_BUILD_DIR/appengine" +} + +appengine_run() { + appengine_build $1 $2 + "$APPENGINE_LOCAL" "$GRIDWORKS_BUILD_DIR/appengine" +} + run() { FORK=$1 @@ -812,6 +855,9 @@ case "$ACTION" in cpd) cpd;; jslint) jslint;; run) run;; + appengine_build) appengine_build $1 $2;; + appengine_run) appengine_run $1 $2;; + appengine_upload) appengine_upload $1 $2;; mac_dist) mac_dist $1;; windows_dist) windows_dist $1;; linux_dist) linux_dist $1;;