Source

jackpot30 / hudson / trunk

Full commit
#!/bin/bash -x
if [ "$TRUNK_URL" == "" ] ; then
    TRUNK_URL="http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc";
fi;

TRUNK_ID=`wget -q $TRUNK_URL/lastSuccessfulBuild/buildNumber -O -`

mkdir -p nbbuild

cd nbbuild
rm -rf netbeans
mkdir netbeans
mkdir -p download

rm `ls download/netbeans-hudson-trunk* | grep -v $TRUNK_ID`

cd netbeans

download_and_unpack_cluster() {
    if [ ! -e ../download/netbeans-hudson-trunk-$TRUNK_ID-$1.zip ] ; then
        wget -q -N $TRUNK_URL/$TRUNK_ID/artifact/nbbuild/dist/hudson-nbms-and-javadoc-$TRUNK_ID-$1.zip -O ../download/netbeans-hudson-trunk-$TRUNK_ID-$1.zip || exit
    fi;
    unzip -q ../download/*$TRUNK_ID-$1.zip || exit
}

for cluster in ide platform java harness nb apisupport extra enterprise; do
    download_and_unpack_cluster $cluster;
done

cd ../..

PLATFORM=$PWD/nbbuild/netbeans

call_ant() {
    ant -Dnbplatform.default.harness.dir=$PLATFORM/harness -Dnbplatform.default.netbeans.dest.dir=$PLATFORM -Dnbplatform.active.dir=$PLATFORM "$@"
}

(cd borrowedtests; call_ant clean && call_ant) || exit
call_ant clean || exit
call_ant build || exit
#call_ant coverage-report || exit
call_ant test || exit

(cd cmdline; call_ant clean && call_ant build && call_ant test && (cd compiler; call_ant create-standalone-compiler && build/test/scripted/run )  && (cd tool; call_ant create-standalone-tool && build/test/scripted/run )) || exit

mkdir -p build/updates
cp nbbuild/download/*.nbm build/updates

call_ant -Ddist.base=$DIST_BASE nbms || exit
gzip <build/updates/updates.xml >build/updates/updates.xml.gz

(cd cmdline/compiler; call_ant copy-to-hudson) || exit
(cd server/indexer; call_ant copy-to-hudson) || exit
(cd server/hudson; mvn -Dmaven.test.skip=true clean package) || exit
(cd cmdline/tool; call_ant create-standalone-tool) || exit

call_ant -Ddist.base=$DIST_BASE findbugs || exit

mkdir -p build/server
(cp server/do-indexing server/indexer/dist; cd server/indexer/dist/; zip -r ../../../build/server/indexer.zip *)
(cd server/web.api/dist/; zip -r ../../../build/server/web.api.zip *)
(cd server/backend; call_ant clean && call_ant build && call_ant test && call_ant build-zip) || exit