NEW - bug 215060: Create automated build for UDC
https://bugs.eclipse.org/bugs/show_bug.cgi?id=215060
diff --git a/releng/org.eclipse.epp.usagedata.releng/start.sh b/releng/org.eclipse.epp.usagedata.releng/start.sh
index ce18eba..e650221 100644
--- a/releng/org.eclipse.epp.usagedata.releng/start.sh
+++ b/releng/org.eclipse.epp.usagedata.releng/start.sh
@@ -1,16 +1,52 @@
 #!/bin/sh
+#====================================================================================
+#  Copyright (c) 2008 The Eclipse Foundation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#====================================================================================
 
-JAVA=/opt/ibm/java2-ppc-50/bin/java
-BUILD_ROOT=/shared/technology/epp/udc_build
-ECLIPSE_ROOT=${BUILD_ROOT}/bases/eclipse-SDK-3.5M6-linux-gtk/eclipse
-UPDATE_SITE=/home/data/httpd/download.eclipse.org/technology/epp/updates/testing/
+#====================================================================================#
+#This script builds the EPP Usage Data Collector feature and accompanying
+# plug-ins. The output of the build is an update site. This script is
+# designed to work on the Eclipse Foundation's build server, or on Wayne's
+# laptop (Ubuntu Linux 8.10); it sorts out it's environment itself.
+#
+# The output will be compressed using pack200. If the script is running
+# on the foundation build server, the output will also be signed using the
+# Foundation's certificate.
+#====================================================================================
+
+if [ -f /opt/ibm/java2-ppc-50/bin/java ]; then
+	JAVA=/opt/ibm/java2-ppc-50/bin/java
+	BUILD_ROOT=/shared/technology/epp/udc_build
+	ECLIPSE_BASES=${BUILD_ROOT}/bases
+	UPDATE_ROOT=/home/data/httpd/download.eclipse.org/technology/epp/updates/testing
+else
+	# Assume that we're running on Wayne's Laptop.
+	JAVA=java
+	BUILD_ROOT=${HOME}/epp/build
+	ECLIPSE_BASES=${HOME}/Eclipse
+	UPDATE_ROOT=${HOME}/epp/updates
+fi
+
+# Take build type from the command-line; assume 'N' if not specified.
+BUILD_TYPE=${1:-N} 
+
+ECLIPSE_ROOT=${ECLIPSE_BASES}/eclipse-SDK-3.5M6-linux-gtk/eclipse
+UPDATE_SITE=${UPDATE_ROOT}/${BUILD_TYPE}
 
 BUILD_DATE=`date +%Y%m%d`
 BUILD_TIME=`date +%H%M`
 TIMESTAMP=${BUILD_DATE}${BUILD_TIME}
 
+echo "Starting build..."
+echo "Build Type: ${BUILD_TYPE}, timestamp: ${TIMESTAMP}"
+
 rm -rf ${BUILD_ROOT}/workspace
 
+mkdir ${BUILD_ROOT}
 cd ${BUILD_ROOT}
 cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/technology co org.eclipse.epp/releng/org.eclipse.epp.usagedata.releng/
 
@@ -22,11 +58,27 @@
         -application org.eclipse.ant.core.antRunner \
         -buildfile ${PDE_BUILD_PLUGIN}/scripts/build.xml \
         -Dbuilder=${BUILD_ROOT}/org.eclipse.epp/releng/org.eclipse.epp.usagedata.releng/ \
+        -DbaseLocation=${ECLIPSE_ROOT} \
         -DbuildDirectory=${BUILD_ROOT}/workspace/ \
         -Dbase=${BUILD_ROOT} \
         -DbuildId=${TIMESTAMP} \
         -Dtimestamp=${TIMESTAMP} \
         -DupdateSite=${UPDATE_SITE} \
-        -DbuildType=R \
+        -DbuildType=${BUILD_TYPE} \
         -Dudc.pack200=true \
-        -Dudc.signJars=true
+        -DlauncherJar=${LAUNCHER_JAR} 
+        
+${JAVA} -jar ${LAUNCHER_JAR} \
+   -application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator \
+   -updateSite ${UPDATE_SITE} \
+   -site file:${UPDATE_SITE}/site.xml \
+   -metadataRepository file:{UPDATE_SITE} \
+   -metadataRepositoryName "UDC Update Site" \
+   -artifactRepository file:{UPDATE_SITE} \
+   -artifactRepositoryName "UDC Artifacts" \
+   -compress \
+   -append \
+   -reusePack200Files \
+   -noDefaultIUs \
+   -vmargs -Xmx256m 
+