try to modernize customTargets by refreshing from PDE/Build's current templates
- specifically try to get rid of the many useless variants of assemble.X.Y targets
diff --git a/releng/build-scripts/build/OTDT-Build/allElements.xml b/releng/build-scripts/build/OTDT-Build/allElements.xml
new file mode 100644
index 0000000..1c5cbbd
--- /dev/null
+++ b/releng/build-scripts/build/OTDT-Build/allElements.xml
@@ -0,0 +1,108 @@
+<project name="allElements Delegator">
+	<property name="defaultAssemblyEnabled" value="true" />
+	
+ 	<!-- ===================================================================== 	-->
+ 	<!-- Run a given ${target} on all elements being built						-->
+ 	<!-- By default ${topLevelElementType} and ${topLevelElementId} should be	--> 
+ 	<!-- defined in the builder's build.properties file.  You can customize by	--> 
+ 	<!-- setting the type/id values directly here.								-->
+	<!-- You can add additional calls to ${genericTargets} to build more top 	-->
+	<!-- level elements.									   					-->
+	<!--																		-->
+	<!-- The top level must exist in the ${buildDirectory}, ${baseLocation} or	-->
+	<!-- ${pluginPath} locations.												-->
+ 	<!-- ===================================================================== 	-->
+ 	<target name="allElementsDelegator">
+ 		<!-- orig:
+ 		<ant antfile="${genericTargets}" target="${target}">
+	 		<property name="type" value="${topLevelElementType}" />
+	 		<property name="id" value="${topLevelElementId}" />
+ 		</ant>
+ 		-->
+ 		<!-- custom: -->
+		<!-- org.eclipse.objectteams.otdt.core.patch is included from otdt -->
+
+		<ant antfile="${genericTargets}" target="${target}" >
+			<property name="type" value="feature" />
+			<property name="id" value="org.eclipse.objectteams.otequinox" />
+		</ant>
+
+		<ant antfile="${genericTargets}" target="${target}" >
+			<property name="type" value="feature" />
+			<property name="id" value="org.eclipse.objectteams.otdt" />
+		</ant>
+		
+	  	<condition property="really.run.tests">
+			<istrue value="${do.run.tests}"/> 
+		</condition>
+        
+		<antcall target="testElements" />
+ 		<!-- :motsuc -->
+ 	</target>
+ 
+    <target name="testElements" if="really.run.tests">
+        <ant antfile="${genericTargets}" target="${target}" >
+            <property name="type" value="feature" />
+            <property name="id" value="org.eclipse.objectteams.otdt-tests" />
+        </ant>
+    </target>
+ 
+	<!-- ====================================================================== -->
+	<!--  The default assemble target, this will be called to assemble each		-->	 
+	<!--  config if a custom assemble target is not defined.					-->
+	<!-- The following properties will be defined:								-->
+	<!-- 		config : The configuration being assembled eg "win32.win32.x86"	-->
+	<!-- 		element: The element being assembled eg "org.eclipse.sdk"		-->
+	<!-- 		assembleScriptName: The assemble script to be called			-->
+	<!-- ====================================================================== -->
+	<target name="defaultAssemble">
+		<ant antfile="${assembleScriptName}" dir="${buildDirectory}" />
+	</target>	
+	
+ 	<!-- =====================================================================	-->
+ 	<!-- Custom targets to assemble the built elements for particular 			-->
+ 	<!-- configurations.  These generally call the generated assemble scripts 	-->
+ 	<!-- (named in  ${assembleScriptName}) but may also add pre and post		--> 
+ 	<!-- processing      														-->
+ 	<!-- Add one target for each root element and each configuration for which	--> 
+ 	<!-- custom processing is desired. Replace element.id with the id of the 	-->
+ 	<!-- top level element being built.  A property with a matching name must 	-->
+ 	<!-- be defined for this custom target to be called instead of the 			-->
+ 	<!-- defaultAssemble target above.											-->
+	<!--	Example:  name="assemble.org.eclipse.sdk"							-->
+	<!--	Example:  name="assemble.org.eclipse.sdk.win32.win32.x86"			-->
+ 	<!-- ====================================================================== -->
+
+	<!-- org.eclipse.objectteams.otdt.core.patch is included from otdt -->
+
+	<!-- different features are gathered into two different locations:
+		OTDT	-> ${otdtUpdatesDir}
+		tests	-> ${testsUpdatesDirBase}/otdt 
+	-->
+	<!-- set output repository for otequinox.feature: -->
+	<property name="assemble.org.eclipse.objectteams.otequinox.p2" value="true" />
+ 	<target   name="assemble.org.eclipse.objectteams.otequinox.p2">
+        <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+			<property name="p2.build.repo" value="file://${otdtUpdatesDir}"/>
+		</ant>
+ 	</target>
+	
+	<!-- set output repository for otdt.feature: -->
+	<property name="assemble.org.eclipse.objectteams.otdt.p2" value="true" />
+    <target   name="assemble.org.eclipse.objectteams.otdt.p2">
+        <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+			<property name="p2.build.repo" value="file://${otdtUpdatesDir}"/>
+		</ant>
+	</target>
+
+	<!-- set output repository for otdt-tests.feature: -->
+	<property name="assemble.org.eclipse.objectteams.otdt-tests.p2" value="true" />
+	<target   name="assemble.org.eclipse.objectteams.otdt-tests.p2">
+        <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
+			<property name="p2.build.repo" value="file://${testsUpdatesDirBase}/otdt"/>
+		</ant>
+	</target>
+	
+	<!-- Regarding the config "linux.gtk.*" see comment in build.properties -->
+	<!-- are more targets called and create unnecessary work? -->
+</project>
diff --git a/releng/build-scripts/build/OTDT-Build/build.properties b/releng/build-scripts/build/OTDT-Build/build.properties
index 6a3efb7..f63ad00 100644
--- a/releng/build-scripts/build/OTDT-Build/build.properties
+++ b/releng/build-scripts/build/OTDT-Build/build.properties
@@ -24,6 +24,9 @@
 
 J2SE-1.4=/shared/common/j2sdk1.4.2_19/jre/lib/rt.jar
 
+
+# base and baseLocation are set from run.xml
+
 p2.gathering=true
 #p2.build.repo is set individually in customTargets.xml
 skipMirroring=true
diff --git a/releng/build-scripts/build/OTDT-Build/customTargets.xml b/releng/build-scripts/build/OTDT-Build/customTargets.xml
index 26c9fc1..41fbf9e 100644
--- a/releng/build-scripts/build/OTDT-Build/customTargets.xml
+++ b/releng/build-scripts/build/OTDT-Build/customTargets.xml
@@ -10,118 +10,73 @@
 -->
 <project name="Build specific targets and properties" default="noDefault" >
 
-
-	<condition property="isNightlyBuild">
-		<equals arg1="${buildType}" arg2="N"/>
-	</condition>
-	<property file="${buildDirectory}/version.properties"/>
-	<property name="buildLabel" value="${buildType}-${featureVersion}"/>
-	<property name="buildId" value="${featureVersion}"/>	
-	
 	<!-- ===================================================================== -->
 	<!-- Run a given ${target} on all elements being built -->
 	<!-- Add on <ant> task for each top level element being built. -->
 	<!-- ===================================================================== -->
+	<available property="allElementsFile" file="${builder}/allElements.xml" value="${builder}/allElements.xml"/>
+	<property name="allElementsFile" location="${eclipse.pdebuild.templates}/headless-build/allElements.xml"/>
+
+	<import file="${allElementsFile}" />
 	<target name="allElements">
-
-		<!-- org.eclipse.objectteams.otdt.core.patch is included from otdt -->
-
-		<ant antfile="${genericTargets}" target="${target}" >
-			<property name="type" value="feature" />
-			<property name="id" value="org.eclipse.objectteams.otequinox" />
-		</ant>
-
-		<ant antfile="${genericTargets}" target="${target}" >
-			<property name="type" value="feature" />
-			<property name="id" value="org.eclipse.objectteams.otdt" />
-		</ant>
-		
-	  	<condition property="really.run.tests">
-			<istrue value="${do.run.tests}"/> 
-		</condition>
-        
-		<antcall target="testElements" />
-
+		<antcall target="allElementsDelegator" />
 	</target>
-
-    <target name="testElements" if="really.run.tests">
-        <ant antfile="${genericTargets}" target="${target}" >
-            <property name="type" value="feature" />
-            <property name="id" value="org.eclipse.objectteams.otdt-tests" />
-        </ant>
-    </target>
-
-	<!-- ===================================================================== -->
-	<!-- Targets to assemble the built elements for particular configurations  -->
-	<!-- These generally call the generated assemble scripts (named in -->
-	<!-- ${assembleScriptName}) but may also add pre and post processing -->
-	<!-- Add one target for each root element and each configuration -->
-	<!-- ===================================================================== -->
 	
-	<!-- org.eclipse.objectteams.otdt.core.patch is included from otdt -->
-	<!-- different features are gathered into two different locations:
-		OTDT	-> ${otdtUpdatesDir}
-		tests	-> ${testsUpdatesDirBase}/otdt 
-	-->
-    <target name="assemble.org.eclipse.objectteams.otequinox.p2">
-        <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
-			<property name="p2.build.repo" value="file://${otdtUpdatesDir}"/>
-		</ant>
-    </target>
-    <target name="assemble.org.eclipse.objectteams.otequinox.group.group.group">
-        <ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
-    </target>
-	<target name="assemble.org.eclipse.objectteams.otequinox">
-		<echo message="Not assembling org.eclipse.objectteams.otequinox, will create update.jars instead (later during the build)" />
-	</target>
-	<!-- Regarding the config "linux.gtk.*" see comment in build.properties -->
-	<target name="assemble.org.eclipse.objectteams.otequinox.linux.gtk.*">
-		<echo message="Not assembling org.eclipse.objectteams.otequinox.linux.gtk.*, will create update.jars instead (later during the build)" />
-	</target>
-    <target name="assemble.org.eclipse.objectteams.otdt.p2">
-            <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
-		<property name="p2.build.repo" value="file://${otdtUpdatesDir}"/>
-	</ant>
-    </target>
-    <target name="assemble.org.eclipse.objectteams.otdt.group.group.group">
-            <ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
-    </target>
-	<target name="assemble.org.eclipse.objectteams.otdt">
-		<echo message="Not assembling org.eclipse.objectteams.otdt, will create update.jars instead (later during the build)" />
-	</target>
-	<target name="assemble.org.eclipse.objectteams.otdt.linux.gtk.*">
-		<echo message="Not assembling org.eclipse.objectteams.otdt.linux.gtk.*, will create update.jars instead (later during the build)" />
+	<!-- ===================================================================== -->
+	<!-- ===================================================================== -->
+	<target name="getBaseComponents" depends="checkLocalBase" unless="skipBase">
+		<get src="${eclipseBaseURL}" dest="${buildDirectory}/../temp-base.zip" />
+		<unzip dest="${base}" overwrite="true" src="${buildDirectory}/../temp-base.zip" />
 	</target>
 
-	<target name="assemble.org.eclipse.objectteams.otdt-tests.p2">
-        <ant antfile="${assembleScriptName}" dir="${buildDirectory}">
-			<property name="p2.build.repo" value="file://${testsUpdatesDirBase}/otdt"/>
-		</ant>
-	</target>
-	<target name="assemble.org.eclipse.objectteams.otdt-tests.group.group.group">
-		<echo message="empty target" />
-	</target>
-	<target name="assemble.org.eclipse.objectteams.otdt-tests">
-		<ant antfile="${assembleScriptName}" dir="${buildDirectory}">
-			<property name="zipargs" value="" />
-		</ant>
-	</target>
-	<target name="assemble.org.eclipse.objectteams.otdt-tests.linux.gtk.*">
-		<antcall target="assemble.org.eclipse.objectteams.otdt-tests"/>
+	<target name="checkLocalBase">
+		<available file="${base}" property="skipBase" />
 	</target>
 
 	<!-- ===================================================================== -->
 	<!-- Check out map files from correct repository -->
-	<!-- Replace values for cvsRoot, package and mapVersionTag as desired. -->
+	<!-- Replace values for mapsCheckoutTag as desired. -->
 	<!-- ===================================================================== -->
-	<target name="getMapFiles">
-		<delete dir="${buildDirectory}/maps"/>
-		<mkdir dir="${buildDirectory}/maps"/>
+	<target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps">
+		<property name="mapsCheckoutTag" value="HEAD" />
+		<!-- orig:
+		<cvs cvsRoot="${mapsRepo}" package="${mapsRoot}" dest="${buildDirectory}/maps" tag="${mapsCheckoutTag}" />
+		-->
 		<property name="svn.map.url" value="${svn.repository.url}/${mapVersionTag}/${pathToMapFile}/${mapFileName}" />
 
 		<svn command="export" url="${svn.map.url}" dest="${buildDirectory}/maps/${mapFileName}" />
 	</target>
-	
+
+	<target name="checkLocalMaps">
+		<available property="skipMaps" file="${buildDirectory}/maps" />
+	</target>
+
+	<target name="tagMapFiles" if="tagMaps">
+		<!-- orig:
+		<cvs dest="${buildDirectory}/maps/${mapsRoot}" command="tag ${mapsTagTag}" />
+		-->
+	</target>
+
+	<!-- ===================================================================== -->
+
+	<target name="clean" unless="noclean">
+		<antcall target="allElements">
+			<param name="target" value="cleanElement" />
+		</antcall>
+	</target>
+
+	<target name="gatherLogs">
+		<mkdir dir="${buildDirectory}/${buildLabel}/compilelogs" />
+		<antcall target="allElements">
+			<param name="target" value="gatherLogs" />
+		</antcall>
+		<unzip dest="${buildDirectory}/${buildLabel}/compilelogs" overwrite="true">
+			<fileset dir="${buildDirectory}/features">
+				<include name="**/*.log.zip" />
+			</fileset>
+		</unzip>
+	</target>
+
 	<!-- ===================================================================== -->
 	<!-- Steps to do before setup -->
 	<!-- ===================================================================== -->
@@ -132,6 +87,7 @@
 	<!-- Steps to do after setup but before starting the build proper -->
 	<!-- ===================================================================== -->
 	<target name="postSetup">
+		<antcall target="getBaseComponents" />
 	</target>
 
 	<!-- ===================================================================== -->
@@ -151,6 +107,18 @@
 	</target>
 
 	<!-- ===================================================================== -->
+	<!-- Steps to do before the repositories are being processed -->
+	<!-- ===================================================================== -->
+	<target name="preProcessRepos">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after the repositories have been processed -->
+	<!-- ===================================================================== -->
+	<target name="postProcessRepos">
+	</target>
+	
+	<!-- ===================================================================== -->
 	<!-- Steps to do before generating the build scripts. -->
 	<!-- ===================================================================== -->
 	<target name="preGenerate">
@@ -160,9 +128,11 @@
 	<!-- Steps to do after generating the build scripts. -->
 	<!-- ===================================================================== -->
 	<target name="postGenerate">
+		<!-- orig:
+		<antcall target="clean" />
+		-->
 	</target>
 
-
 	<!-- ===================================================================== -->
 	<!-- Steps to do before running the build.xmls for the elements being built. -->
 	<!-- ===================================================================== -->
@@ -175,7 +145,6 @@
 	<target name="postProcess">
 	</target>
 
-
 	<!-- ===================================================================== -->
 	<!-- Steps to do before running assemble. -->
 	<!-- ===================================================================== -->
@@ -189,9 +158,28 @@
 	</target>
 
 	<!-- ===================================================================== -->
+	<!-- Steps to do before running package. -->
+	<!-- ===================================================================== -->
+	<target name="prePackage">
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do after  running package. -->
+	<!-- ===================================================================== -->
+	<target name="postPackage">
+	</target>
+
+	<!-- ===================================================================== -->
 	<!-- Steps to do after the build is done. -->
 	<!-- ===================================================================== -->
 	<target name="postBuild">
+		<antcall target="gatherLogs" />
+	</target>
+
+	<!-- ===================================================================== -->
+	<!-- Steps to do to test the build results -->
+	<!-- ===================================================================== -->
+	<target name="test">
 	</target>
 
 	<!-- ===================================================================== -->
@@ -200,7 +188,6 @@
 	<target name="publish">
 	</target>
 
-
 	<!-- ===================================================================== -->
 	<!-- Default target                                                        -->
 	<!-- ===================================================================== -->
diff --git a/releng/build-scripts/build/run.xml b/releng/build-scripts/build/run.xml
index 94459ef..ae0ee7b 100644
--- a/releng/build-scripts/build/run.xml
+++ b/releng/build-scripts/build/run.xml
@@ -50,9 +50,10 @@
 			
 		<!--	directories for the build: -->
 		<property name="build.root.dir" value="${user.dir}/build-root" />
-			<!-- Both these names are hard coded in pde-build: -->
-			<property name="buildDirectory"    value="${build.root.dir}/src" />
-			<property name="baseLocation"   value="${build.root.dir}/eclipse" />
+			<!-- These names are hard coded in pde-build: -->
+			<property name="buildDirectory"		value="${build.root.dir}/src" />
+			<property name="base" 				value="${build.root.dir}" />
+			<property name="baseLocation"   	value="${build.root.dir}/eclipse" />
 	
 		<!--	directories for testing: -->
 		<property name="test.root.dir" value="${user.dir}/test-root" />