#! /bin/sh # Build script to build the carbon platform 2.0 f_build() { if [ "$1" = "axis2" ]; then echo "Building the Axis2 AAR Maven plugin prior to building Axis2" cd $PRGDIR/$1/modules/tool/axis2-aar-maven-plugin $BUILD_COMMAND echo "Building the Axis2 MAR Maven plugin prior to building Axis2" cd $PRGDIR/$1/modules/tool/axis2-mar-maven-plugin $BUILD_COMMAND fi cd "$PRGDIR/$1" echo "Building $2, build log is available at :\n\t$PRGDIR/logs/$1-build.log" if [ "$1" = "sandesha" ]; then $BUILD_COMMAND -Dmaven.test.skip=true > $PRGDIR/logs/$1-build.log else $BUILD_COMMAND > $PRGDIR/logs/$1-build.log fi BUILD_STATUS=`tail -10 $PRGDIR/logs/$1-build.log | grep "BUILD SUCCESSFUL"` if [ "$BUILD_STATUS" = "" ]; then echo "** $2 BUILD FAILED **" echo "`tail -20 $PRGDIR/logs/$1-build.log`" echo "For more information refer to build log whihc is available at :\n\t$PRGDIR/logs/$1-build.log" exit 1 fi echo "\t$2 BUILD SUCCESSFUL!!\n" } f_build_rampart() { cd "$PRGDIR/$1" echo "Building $2, build log is available at :\n\t$PRGDIR/logs/$1-build.log" if [ "$1" = "rampart" ]; then $BUILD_COMMAND -Dmaven.test.skip=true > $PRGDIR/logs/$1-build.log else $BUILD_COMMAND > $PRGDIR/logs/$1-build.log fi BUILD_STATUS=`tail -10 $PRGDIR/logs/$1-build.log | grep "BUILD SUCCESSFUL"` if [ "$BUILD_STATUS" = "" ]; then echo "** $2 BUILD FAILED **" echo "`tail -20 $PRGDIR/logs/$1-build.log`" echo "For more information refer to build log whihc is available at :\n\t$PRGDIR/logs/$1-build.log" exit 1 fi echo "\t$2 BUILD SUCCESSFUL!!\n" } f_printhelp() { echo "\n ** Build Script for WSO2 Carbon 2.0 platform - Help **" echo " ================================================\n" echo "Available optional parameters :" echo "\t-p \tBuilding platform for ['esb', 'wsas', 'greg', 'is', 'bps', 'all']" echo "\t-o\t\tBuild Offline" echo "\t-ts\t\tSkip Tests\n" echo "Note: Any other maven build parameters will also be accepted\n" exit 0 } # resolve links - $0 may be a softlink PRG="$0" while [ -h "$PRG" ]; do ls=`ls -ld "$PRG"` link=`expr "$ls" : '.*-> \(.*\)$'` if expr "$link" : '.*/.*' > /dev/null; then PRG="$link" else PRG=`dirname "$PRG"`/"$link" fi done # Get standard environment variables PRGDIR=`dirname "$PRG"` PRGDIR="`pwd`/$PRGDIR" echo "\n ** Build Script for WSO2 Carbon 2.0 platform **" echo " =========================================\n" PRODUCT="" for c in $* do if [ "$c" = "-help" ]; then f_printhelp elif [ "$c" = "-p" ]; then PRODUCT="next_read" elif [ "$PRODUCT" = "next_read" ]; then PRODUCT="$c" echo "Building the carbon platform for the product $PRODUCT ..." elif [ "$c" = "-ts" ]; then CMD="$CMD -Dmaven.test.skip=true" echo "Warning: Skipping tests from the build" else if [ "$c" = "-o" ]; then echo "Warning: Building offline" fi CMD="$CMD $c" fi done if [ "$PRODUCT" = "" ]; then echo "Please key in the product to be build. ['esb', 'wsas', 'greg', 'is', 'bps', 'all'] ??" read PRODUCT if [ ! "$PRODUCT" = "all" ] && [ ! "$PRODUCT" = "" ]; then echo "\nBuilding the carbon platform for the product $PRODUCT ..." else echo "\nBuilding the complete carbon platform ..." fi fi echo "Warning: Please note that this doesn't build the product, but just the platform for the particular product\n" BUILD_COMMAND="mvn clean install$CMD -Ddefault" rm -rf $PRGDIR/logs mkdir $PRGDIR/logs mkdir $PRGDIR/logs/commons cd $PRGDIR echo "Updating the Carbon Platform 2.0, svn update log is available at :\n\t$PRGDIR/logs/svn-up.log" svn up > $PRGDIR/logs/svn-up.log echo "Updated the Carbon Platofrm: `tail -1 $PRGDIR/logs/svn-up.log`\n" if [ -e carbon-p2-plugin ]; then cd carbon-p2-plugin svn up >$PRGDIR/logs/svn-up-carbon-p2-plugin.log cd ../ else svn co https://wso2.org/repos/wso2/trunk/tools/maven/carbon-p2-plugin fi f_build "axis2" "Axis2" f_build "transports" "Axis2 Transports" f_build "wss4j" "WSS4J" f_build_rampart "rampart" "Rampart" f_build "sandesha" "Sandesha" f_build "savan" "Savan" f_build "commons/caching" "Caching" f_build "commons/throttle" "Throttle" f_build "commons/eventing" "Eventing" f_build "commons/xkms" "XKMS" f_build "synapse" "Synapse" f_build "commons/rule" "Rule" f_build "rhino" f_build "p2" "Equinox P2" f_build "org.eclipse.equinox.http.servlet" "Equinox org.eclipse.equinox.http.servlet" f_build "carbon-p2-plugin" "Carbon P2 Plugin" #if [ "$PRODUCT" = "all" ] || [ "$PRODUCT" = "" ] || [ "$PRODUCT" = "bps" ]; then #f_build "ode" "ODE" #fi f_build "carbon-orbit" "Carbon Orbit" f_build "carbon" "Carbon" f_build "carbon-components" "Carbon Components" f_build "carbon-features" "Carbon Features" exit 0