added -b option to buildAndUpdateProduct.sh supporting building only one GWT permutation by patching the .gwt.xml files

This commit is contained in:
Axel Uhl committed 2013-09-27 17:17:09 +02:00
1 parent 650198785e
commit b89bd5ce3d
1 file changed
+26 -2
+26 -2
View File
@@ -61,6 +61,7 @@ HAS_OVERWRITTEN_TARGET=0
TARGET_SERVER_NAME=$active_branch
gwtcompile=1
onegwtpermutationonly=0
testing=1
clean="clean"
offline=0
@@ -68,9 +69,10 @@ proxy=0
extra=''
if [ $# -eq 0 ]; then
echo "buildAndUpdateProduct [-g -t -o -c -m <config> -n <package> -l <port>] [build|install|all|hot-deploy|remote-deploy]"
echo "buildAndUpdateProduct [-b -g -t -o -c -m <config> -n <package> -l <port>] [build|install|all|hot-deploy|remote-deploy]"
echo ""
echo "-g Disable GWT compile, no gwt files will be generated, old ones will be preserved."
echo "-b Build GWT permutation only for one browser and English language."
echo "-t Disable tests"
echo "-o Enable offline mode (does not work for tycho surefire plugin)"
echo "-c Disable cleaning (use only if you are sure that no java file has changed)"
@@ -104,12 +106,13 @@ echo PROJECT_HOME is $PROJECT_HOME
echo SERVERS_HOME is $SERVERS_HOME
echo BRANCH is $active_branch
options=':gtocpm:n:l:s:w:'
options=':bgtocpm:n:l:s:w:'
while getopts $options option
do
case $option in
g) gwtcompile=0;;
t) testing=0;;
b) onegwtpermutationonly=1;;
o) offline=1;;
c) clean="";;
p) proxy=1;;
@@ -267,6 +270,21 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
# yield build so that we get updated product
cd $PROJECT_HOME/java
if [ $onegwtpermutationonly -eq 1 ]; then
echo "INFO: Patching .gwt.xml files such that only one GWT permutation needs to be compiled"
for i in com.sap.sailing.gwt.ui/src/main/resources/com/sap/sailing/gwt/ui/*.gwt.xml; do
cp $i $i.bak
cat $i | sed -e 's/^[ ]*<extend-property name="locale" values="de"\/>[ ]*$/<!-- <extend-property name="locale" values="de"\/> --> <set-property name="user.agent" value="safari" \/>/' >$i.sed
mv $i.sed $i
done
else
echo "INFO: Patching .gwt.xml files such that all GWT permutations are compiled"
for i in com.sap.sailing.gwt.ui/src/main/resources/com/sap/sailing/gwt/ui/*.gwt.xml; do
cp $i $i.bak
cat $i | sed -e 's/<!-- <extend-property name="locale" values="de"\/> --> <set-property name="user.agent" value="safari" \/>/<extend-property name="locale" values="de"\/>/' >$i.sed
mv $i.sed $i
done
fi
if [ $gwtcompile -eq 1 ]; then
echo "INFO: Compiling GWT (rm -rf com.sap.sailing.gwt.ui/com.sap.sailing.*)"
rm -rf com.sap.sailing.gwt.ui/com.sap.sailing.*
@@ -298,6 +316,12 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
echo "Using following command: mvn $extra -fae -s $MAVEN_SETTINGS $clean install"
mvn $extra -fae -s $MAVEN_SETTINGS $clean install 2>&1 | tee $START_DIR/build.log
# Now move back the backup .gwt.xml files before they were (maybe) patched
for i in com.sap.sailing.gwt.ui/src/main/resources/com/sap/sailing/gwt/ui/*.gwt.xml; do
echo "INFO: restoring backup copy of $i after it was patched before"
mv -v $i.bak $i
done
echo "Build complete. Do not forget to install product..."
fi