Bug 508772 - [simrel] Even further simplification of build.xml

It is very simple, now. Works from 'tools', as well as if "copied up" to
'build' as well as from IDE. This was done
by assume BUILD_HOME is "one level up" from directory of build.xml.

Also added lots more documentation in build.xml about targets and
properties. 

Change-Id: Ie2e868c7108d55e12d715ecca6def4f97f922300
Signed-off-by: David Williams <david_williams@acm.org>
diff --git a/aggr.properties b/aggr.properties
index 09b468a..f253d57 100644
--- a/aggr.properties
+++ b/aggr.properties
@@ -2,8 +2,35 @@
 
 # common variables used in scripts
 
-# BUILD_HOME is normally set to $WORKSPACE when running on Hudson,
-# but if running locally, you can set it to what ever you'd like.
-# For example,
-BUILD_HOME=${PWD}
-
+# Typically, for local use, nothing needs to be set here and
+# technically does not need to exist. But have left for
+# a starting point if users doing "local builds" need to
+# override anything.
+#
+# See the top of the build.xml file for some properties that
+# may be desired to override.
+#
+# See the production.properties file for what
+# we override in production builds.
+#
+# NOTE: see where this file is called in the "init" target,
+# and notice by the time it is called, several variables have
+# already been set. That means those "already set" variables
+# are not candidates for this file, unless build.xml is changed
+# so these properties are loaded earlier. They could be
+# overridden by passing as "environment variables" or directly
+# on command line, such as -DBUILD_HOME=${PWD}/buildarea
+# At the time of this writing, these properties include the list below.
+# Of these listed only the 'release' typically needs to be set
+# in production builds (is is not required for simple local aggregation).
+# JAVA_HOME
+# BUILD_HOME
+# release (aka train name)
+#
+# as well as ones that should probably never be overridden,
+# such as
+# buildTimestamp
+# jobName
+# jobNumber
+# buildToolsDir (assumed to be ${BUILD_HOME}/org.eclipse.simrel.tools)
+# buildModelDir (assumed to be ${BUILD_HOME}/org.eclipse.simrel.build)
diff --git a/build.xml b/build.xml
index c1edeec..e68b27e 100644
--- a/build.xml
+++ b/build.xml
@@ -3,46 +3,46 @@
   basedir="."
   default="default">
 
-<!-- 
+<!--
 
 Purpose and primary targets
 
    This build.xml is to download and install the CBI aggregator (and other tools)
    and run one of three types of aggregations. Note: it assumes all has been checked out of Git
-   and "ready to aggregate". It does recored the "commit" of some repositories, just as a way to 
-   improve documenting what was built. 
+   and "ready to aggregate". It does recored the "commit" of some repositories, just as a way to
+   improve documenting what was built.
 
    This script has 3 main "entry targets", each corresponding to one of the 3 types of aggregations:
 
       1. runAggregatorValidateOnly (default)
           This simply confirms the "constraints" as specified by the the *.aggr* contributions
-          all make sense and "fit together" as well as that the repositories are available at the 
+          all make sense and "fit together" as well as that the repositories are available at the
           specified URLs. It is the "quickest" job, typically taking from 1 to 4 minutes.
 
       2. runAggregatorBuildOnly
-          This aggregation does a complete aggregation. That is, in addition to "validating" 
-          the constraints, it downloads the artifacts, unpacks or verifies any pack.gz files, 
-          and creates a final repository. The distinguishing feature of this target is that 
+          This aggregation does a complete aggregation. That is, in addition to "validating"
+          the constraints, it downloads the artifacts, unpacks or verifies any pack.gz files,
+          and creates a final repository. The distinguishing feature of this target is that
           if it is ran a second time it does not "clean" anything and downloads only anything new
-          that is needed. Hence, the first time it is ran can take several hours, 
-          but subsequent runs can be much quicker (from just a few minutes to a few dozen minutes, 
+          that is needed. Hence, the first time it is ran can take several hours,
+          but subsequent runs can be much quicker (from just a few minutes to a few dozen minutes,
           depending on how much is new).
 
       3. runAggregatorCleanBuild
-          This is the aggregation is similar to above, but always does a "clean build". 
-          It remove all artifacts and metadata that previously had been downloaded and starts "fresh". 
-          Hence, it always takes several hours to complete. But this is is important since there are few things 
+          This is the aggregation is similar to above, but always does a "clean build".
+          It remove all artifacts and metadata that previously had been downloaded and starts "fresh".
+          Hence, it always takes several hours to complete. But this is is important since there are few things
           that can go wrong that would only show up in a clean build.
 
 Important properties
 
-      Listed below are some of the most important properties that can be "passed in" (either as -D parameters on command line, 
+      Listed below are some of the most important properties that can be "passed in" (either as -D parameters on command line,
       or in a property file that is then specified on command line with -Daggr.properties=<yourPropertyFile>).
 
       - BUILD_HOME
            Technically should be an environment variable rather than an ant property. Such as invoking ant on command line
-           with "BUILD_HOME=${PWD} ant ... ". The default is the environment variable "WORKSPACE" so if running on Hudson, 
-           nothing needs to be specified. Technically is not required, but if not running on Hudson, it is best to 
+           with "BUILD_HOME=${PWD} ant ... ". The default is the environment variable "WORKSPACE" so if running on Hudson,
+           nothing needs to be specified. Technically is not required, but if not running on Hudson, it is best to
            specify some directory outside of the working tree.
 
       - release
@@ -51,13 +51,13 @@
 
 Useful properties
 
-      Listed below are some useful properties that can be "passed in" (either as -D parameters on command line, 
+      Listed below are some useful properties that can be "passed in" (either as -D parameters on command line,
       or in a property file that is then specified on command line with -Daggr.properties=<yourPropertyFile>).
       But, most users or use-cases will not need to be concerned with these.
 
       - git_protocol
           'git_protocol' specifies an alternative way to "get" the git repositories of the 'simrel.build' and 'simrel.tools'.
-          If running with local versions of the repository, it can be slightly more efficient and reliable 
+          If running with local versions of the repository, it can be slightly more efficient and reliable
           to use direct file access ("git_protocol=file://") instead of the default of "git://git.eclipse.org".
 
       - rewriteRepositoryURLValue
@@ -69,7 +69,7 @@
 
       - installEclipseAndTools
           The script always installs Eclipse and required tools *unless* is sees that eclipse is already installed.
-          To force it to reinstall Eclipse and required tools use this installEclipseAndTools property. In practice, 
+          To force it to reinstall Eclipse and required tools use this installEclipseAndTools property. In practice,
           this value is seldom needed since often just as easy to delete the entire "BUILD_HOME" and start completely fresh.
 
       - platformFilename
@@ -79,14 +79,14 @@
 
       - platformLocation
           'platformLocation' is the location from where to the binary platform.
-          By default, it is 
+          By default, it is
           http://download.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200
           If you have access to the binary platform archive on your file system, you can specify
-          its location instead, for some savings in "download time". For example: 
+          its location instead, for some savings in "download time". For example:
           file:///files/eclipsefiles/
 
        - JAVA_HOME
-          Should rarely be needed "these days". But is provided here in case it is desired 
+          Should rarely be needed "these days". But is provided here in case it is desired
           to run the aggregator with a different VM than the VM that is running Ant.
 
 -->
@@ -539,7 +539,6 @@
       value="${AGGREGATOR_APP_BASE_ARGS} --action VALIDATE" />
     <echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
 
-
     <exec
       executable="${eclipseExecutable}"
       dir="${basedir}"
@@ -591,11 +590,18 @@
 
   <target
     name="runTests"
+    depends="initRunTestsXML,checkrunTests"
     if="runTestsXML">
     <ant
       antfile="${runTestsXML}"
       target="${tests}"
-      dir="${BUILD_HOME}" />
+      dir="${buildToolsDir}" />
+  </target>
+  <target
+    name="checkrunTests"
+    depends="initRunTestsXML"
+    unless="runTestsXML">
+    <echo message="runTestsXML was not defined as expected. Hence, no tests ran." />
   </target>
   <target
     name="initRunTestsXML"
@@ -628,34 +634,28 @@
 
     <!-- We assign a reasonable value for local builds, but for production
       builds should be .../production.properties This property file name
-      is itself
-      a property, so it can be overridden on one machine versus another.
-      We do
-      it this way, instead of just specifying -propertyFile on command line,
-      so
-      that the property values can be "nested" in other property values and
-      evaluated
-      lazily. -->
+      is itself a property, so it can be overridden on one machine versus another.
+      We do it this way, instead of just specifying -propertyFile on command line,
+      so that the property values can be "nested" in other property values and
+      evaluated lazily. -->
     <property
       name="aggrPropertyFile"
       value="${buildToolsDir}/aggr.properties" />
-
     <property file="${aggrPropertyFile}" />
 
-      <!-- 
+      <!--
       The "binary platform" is enough, for now, and since smaller than the SDK,
       it is recommended as the "base" to install tools into. But a typical "SDK" has been
       left in this comment in case users are doing more than a normal "aggregation build".
-      value="/home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200/eclipse-SDK-4.6.1-linux-gtk-x86_64.tar.gz" 
+      value="/home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200/eclipse-SDK-4.6.1-linux-gtk-x86_64.tar.gz"
       -->
       <!--
-      Note: if there is local file system version of the prereq platform, 
+      Note: if there is local file system version of the prereq platform,
       if it faster to specify file://<location of platform>.
       <property name="platformLocation" value="file:///home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200" />
       We use "http://" by default to make it easy to "run from anywhere", but
       on the production machine, in production.properties, we specify the "file://" form.
       -->
-
     <property
       name="platformLocation"
       value="http://download.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200" />
@@ -667,7 +667,7 @@
       value="${BUILD_HOME}/localPrereqs" />
     <property
       name="platformResource"
-      value="${platformLocation}/${platformFilename}" /> 
+      value="${platformLocation}/${platformFilename}" />
       <!-- directory must exist before "get" uses it or else the file is given name of "localPrereqs" -->
     <mkdir dir="${localPrereqCache}" />
 
@@ -941,16 +941,16 @@
   <target
     name="setDefaultBUILD_HOME"
     unless="BUILD_HOME">
-    <property
-      name="BUILD_HOME"
-      value="${basedir}" />
-    <property
-      name="buildModelDir"
-      value="${basedir}" />
-
+    <!--
+         We assume BUILD_HOME is "one up" from directory where build.xml file is.
+         We always assume the 'simrel.build' and 'simrel.tools' projects are directly under "BUILD_HOME".
+    -->
+    <dirname
+      property="BUILD_HOME"
+      file="${basedir}" />
     <echo
-      message="WARNING: BUILD_HOME set to a default value, ${BUILD_HOME}. Typically this is not desired and may mean there is a configuration issue." />
-    <echo message="WARNING: This implies we also set buildModelDir to ${basedir}" />
+      message="WARNING: BUILD_HOME set to a default value, ${BUILD_HOME}. If this is not correct, you must configure is explicitly as an environment variable." />
+    <echo message="         Note: we always assume the 'simrel.build' and 'simrel.tools' projects are directly under 'BUILD_HOME'" />
 
   </target>
   <target
@@ -1012,9 +1012,9 @@
     <property
       name="BUILD_INFO_DIR"
       value="${AGGREGATOR_RESULTS}/final/buildInfo" />
-  	<!-- 
-  	  Note: The propertyfile task literally edits the properties, 
-  	  if the file already exists, does not create a new one. Therefore 
+  	<!--
+  	  Note: The propertyfile task literally edits the properties,
+  	  if the file already exists, does not create a new one. Therefore
   	  we delete it first.
   	-->
     <delete dir="${BUILD_INFO_DIR}" />
@@ -1103,7 +1103,7 @@
       value="true" />
   </target>
     <!-- It is not required for user to specify "vm", only
-         needed if they want to override the system (or Hudson) 
+         needed if they want to override the system (or Hudson)
          default. We do the "work" in getJVMLocationInternal
          so we can set a "null default" in this task.
     -->
@@ -1134,9 +1134,9 @@
          it is not known how ant "knows about" JAVA_HOME.
          That is, ant could be running in a Java different from
          the one that is desired to be used to run aggregator.
-         Put another way, users can define JAVA_HOME as an environment 
-         variable, or pass in a -DJAVA_HOME value. The later takes 
-         priority, if both exists. 
+         Put another way, users can define JAVA_HOME as an environment
+         variable, or pass in a -DJAVA_HOME value. The later takes
+         priority, if both exists.
          Example: -DJAVA_HOME=/shared/common/jdk1.8.0_x64-latest
     -->
   <target
@@ -1156,4 +1156,30 @@
     <echo message="Found JAVA_HOME already defined to be ${JAVA_HOME}" />
   </target>
 
+  <!-- Note: this target may be useful to anyone that has ran "build.xml" from
+       their IDE workspace, since the build will leave some directories in
+       their IDE workspace that do not show up in their IDE.
+  -->
+  <target
+    name="cleanAllArtifacts"
+    depends="getBUILD_HOME, setDefaultBUILD_HOME"
+    description="This target is primarily for documentation. We do NOT want to call this automatically, since that would interfere with desired caching, etc. But may be desired to create custom versions in future, in some cases, so documented here.">
+      <!-- Note the strong assumption that "BUILD_HOME" is the same
+           value when running this 'clean' target, as when
+           the directories were created.
+      -->
+    <delete
+      dir="${BUILD_HOME}/localPrereqs"
+      includeemptydirs="true" />
+    <delete
+      dir="${BUILD_HOME}/eclipseInstall"
+      includeemptydirs="true" />
+    <delete
+      dir="${BUILD_HOME}/tmp"
+      includeemptydirs="true" />
+    <delete
+      dir="${BUILD_HOME}/aggregation"
+      includeemptydirs="true" />
+  </target>
+
 </project>
\ No newline at end of file
diff --git a/fetchAndbuild.xml b/fetchAndbuild.xml
index 5d9a28b..6100717 100644
--- a/fetchAndbuild.xml
+++ b/fetchAndbuild.xml
@@ -1,1168 +1,35 @@
 <project
-  name="AggregationTasks"
-  basedir="."
-  default="default">
-
-<!-- 
-
-Purpose and primary targets
-
-   This build.xml is to download and install the CBI aggregator (and other tools)
-   and run one of three types of aggregations. Note: it assumes all has been checked out of Git
-   and "ready to aggregate". It does recored the "commit" of some repositories, just as a way to 
-   improve documenting what was built. 
-
-   This script has 3 main "entry targets", each corresponding to one of the 3 types of aggregations:
-
-      1. runAggregatorValidateOnly (default)
-          This simply confirms the "constraints" as specified by the the *.aggr* contributions
-          all make sense and "fit together" as well as that the repositories are available at the 
-          specified URLs. It is the "quickest" job, typically taking from 1 to 4 minutes.
-
-      2. runAggregatorBuildOnly
-          This aggregation does a complete aggregation. That is, in addition to "validating" 
-          the constraints, it downloads the artifacts, unpacks or verifies any pack.gz files, 
-          and creates a final repository. The distinguishing feature of this target is that 
-          if it is ran a second time it does not "clean" anything and downloads only anything new
-          that is needed. Hence, the first time it is ran can take several hours, 
-          but subsequent runs can be much quicker (from just a few minutes to a few dozen minutes, 
-          depending on how much is new).
-
-      3. runAggregatorCleanBuild
-          This is the aggregation is similar to above, but always does a "clean build". 
-          It remove all artifacts and metadata that previously had been downloaded and starts "fresh". 
-          Hence, it always takes several hours to complete. But this is is important since there are few things 
-          that can go wrong that would only show up in a clean build.
-
-Important properties
-
-      Listed below are some of the most important properties that can be "passed in" (either as -D parameters on command line, 
-      or in a property file that is then specified on command line with -Daggr.properties=<yourPropertyFile>).
-
-      - BUILD_HOME
-           Technically should be an environment variable rather than an ant property. Such as invoking ant on command line
-           with "BUILD_HOME=${PWD} ant ... ". The default is the environment variable "WORKSPACE" so if running on Hudson, 
-           nothing needs to be specified. Technically is not required, but if not running on Hudson, it is best to 
-           specify some directory outside of the working tree.
-
-      - release
-          'release' This is the release train name (e.g. 'neon', all lower case. It is used to form some email messages (from the CBI aggregator)
-          as well as, in the final stages, some URL segments, such as when promoted to ".../staging/<release>". For production
-
-Useful properties
-
-      Listed below are some useful properties that can be "passed in" (either as -D parameters on command line, 
-      or in a property file that is then specified on command line with -Daggr.properties=<yourPropertyFile>).
-      But, most users or use-cases will not need to be concerned with these.
-
-      - git_protocol
-          'git_protocol' specifies an alternative way to "get" the git repositories of the 'simrel.build' and 'simrel.tools'.
-          If running with local versions of the repository, it can be slightly more efficient and reliable 
-          to use direct file access ("git_protocol=file://") instead of the default of "git://git.eclipse.org".
-
-      - rewriteRepositoryURLValue
-          'rewriteRepositoryURLValue' is simlar to the git_protocol property but applies to URLs in the *aggr* files.
-          If running on Eclipse.org (or, if you otherwise have direct access to the file system, say with a mirrored repository)
-          it is more efficient to use direct file access ("rewriteRepositoryURLValue=file:///home/data/httpd/download.eclipse.org")
-          rather than the default specified in the *aggr* files ("http://download.eclipse.org"). If this property exists (i.e. has
-          a value) then the script does a simple search-and-replace to rewrite matching URLs.
-
-      - installEclipseAndTools
-          The script always installs Eclipse and required tools *unless* is sees that eclipse is already installed.
-          To force it to reinstall Eclipse and required tools use this installEclipseAndTools property. In practice, 
-          this value is seldom needed since often just as easy to delete the entire "BUILD_HOME" and start completely fresh.
-
-      - platformFilename
-          'platformFilename' is the name of the binary platform to install
-          as the "base" into which the aggregator and other tools are installed into.
-          The default is eclipse-SDK-4.6.1-linux-gtk-x86_64.tar.gz.
-
-      - platformLocation
-          'platformLocation' is the location from where to the binary platform.
-          By default, it is 
-          http://download.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200
-          If you have access to the binary platform archive on your file system, you can specify
-          its location instead, for some savings in "download time". For example: 
-          file:///files/eclipsefiles/
-
-       - JAVA_HOME
-          
-
--->
-
-  <!-- globally make "environment variables" available -->
-  <property environment="env" />
-
-  <target
-    name="installAggregatorAndTools"
-    depends="init, savePrevious,installAggregator,installRelengTools,installTestsFromP2Repo"
-    if="installEclipseAndTools"
-    unless="eclipseAndToolsInstalled">
-
-    <echo message="Installed fresh Eclipse, Aggregator, and Tools" />
-    <property
-      name="eclipseAndToolsInstalled"
-      value="true" />
-
-  </target>
-
-  <target
-    name="installAggregator"
-    depends="init, savePrevious"
-    if="installEclipseAndTools"
-    unless="aggregatorInstalled">
-    <property
-      name="APP_NAME_P2DIRECTOR_AGG"
-      value="org.eclipse.equinox.p2.director" />
-    <property
-      name="otherArgsAggr"
-      value="-metadataRepository http://download.eclipse.org/cbi/updates/aggregator/ide/4.6/ -artifactRepository http://download.eclipse.org/cbi/updates/aggregator/ide/4.6/ -installIU org.eclipse.cbi.p2repo.aggregator.engine.feature.feature.group" />
-
-      <!--
-        Remote builds should use eclipse.p2.mirrors=true
-        (the default). But, in some cases may want to add
-        -Declipse.p2.mirrors=false
-      -->
-    <property
-      name="vm_args_aggr"
-      value="-Djava.io.tmpdir=${BUILD_HOME}/tmp" />
-    <condition
-      property="vm_args_aggr_settings"
-      value="-vmargs ${vm_args_aggr}">
-      <isset property="vm_args_aggr" />
-    </condition>
-
-    <mkdir dir="${ECLIPSE_HOME}" />
-
-    <get
-      src="${platformResource}"
-      dest="${localPrereqCache}"
-      usetimestamp="true" />
-
-    <untar
-      compression="gzip"
-      overwrite="true"
-      src="${localPrereqCache}/${platformFilename}"
-      dest="${ECLIPSE_HOME}" />
+  name="getModel"
+  basedir=".">
 
     <!--
-      This .options file mentioned elsewhere is most useful on non-eclipse.org
-      sites, since
-      on eclipse.org, by design, should not go through mirrors, but that's
-      the purpose of the .options ... to list which mirrors that artifacts
-      come
-      from.
+         This file and its additional targets is not
+         required when running on Hudson.
+         It is primarily "left over" from doing builds as cronjobs.
+         It is left here in source tree in case anyone finds it useful
+         when running from command line, or similar.
+
+         To make use of it, one needs to specify two targets on ant command line,
+         first 'getModelFromGit', and then one of the three main targets of build.xml.
+         The 'getModelFromGit' will either clone the 'simrel.build' project or pull the
+         latest revision. Note: if using from with the Eclpse IDE and you have changed
+         your "*.aggrcon" file, you should "commit" (but not push) it so that is survives
+         the "pull".
+
+         Example usage:
+           ant -f fetchAndBuild.xml getModelFromGit runAggregatorValidateOnly
     -->
 
-    <!-- Weird this chmod is required? Maybe an ant bug? Maybe no longer
-      needed? (That is, maybe an early bug in packages?) -->
-    <chmod
-      file="${ECLIPSE_HOME}/eclipse/eclipse"
-      perm="ugo+x"
-      verbose="true" />
-
-    <!-- and now get latest version of aggregator -->
-    <exec
-      executable="${eclipseExecutable}"
-      dir="${basedir}"
-      failonerror="true">
-      <arg
-        line="-data ${eclipseWorkspaceBase}/install_aggr -debug -consolelog -nosplash --launcher.suppressErrors -application ${APP_NAME_P2DIRECTOR_AGG} ${otherArgsAggr} ${vm_args_aggr_settings}" />
-    </exec>
-    <property
-      name="aggregatorInstalled"
-      value="true" />
-
-  </target>
-
-  <target
-    name="installTestsFromP2Repo"
-    depends="init"
-    if="installEclipseAndTools"
-    unless="testsInstalled">
-    <property
-      name="APP_NAME_P2DIRECTOR_TESTS"
-      value="org.eclipse.equinox.p2.director" />
-    <property
-      name="repoReportURL"
-      value="http://download.eclipse.org/cbi/updates/analyzers/4.6/" />
-
-    <property
-      name="OTHER_ARGS_TESTS"
-      value="-metadataRepository ${repoReportURL} -artifactRepository ${repoReportURL} -installIU org.eclipse.cbi.p2repo.analyzers.feature.feature.group" />
-
-    <property
-      name="vm_args_tests"
-      value="-Djava.io.tmpdir=${BUILD_HOME}/tmp" />
-    <condition
-      property="vm_args_tests_settings"
-      value="-vmargs ${vm_args_tests}">
-      <isset property="vm_args_tests" />
-    </condition>
-
-    <!-- install latest feature from repo -->
-    <exec
-      executable="${eclipseExecutable}"
-      dir="${basedir}"
-      failonerror="true">
-      <arg
-        line="-data ${eclipseWorkspaceBase}/installTests -debug -consolelog -nosplash --launcher.suppressErrors -application ${APP_NAME_P2DIRECTOR_TESTS} ${OTHER_ARGS_TESTS} ${vm_args_tests_settings}" />
-    </exec>
-    <property
-      name="testsInstalled"
-      value="true" />
-
-  </target>
-
-
-  <target
-    name="installRelengTools"
-    depends="init"
-    if="installEclipseAndTools"
-    unless="relengToolsInstalled">
-    <property
-      name="APP_NAME_P2DIRECTOR_RELENG"
-      value="org.eclipse.equinox.p2.director" />
-    <property
-      name="OTHER_ARGS_RELENG"
-      value="-metadataRepository http://download.eclipse.org/webtools/releng/repository/ -artifactRepository http://download.eclipse.org/webtools/releng/repository/ -installIU org.eclipse.wtp.releng.tools.feature.feature.group" />
-
-    <property
-      name="vm_args_releng"
-      value="-Djava.io.tmpdir=${BUILD_HOME}/tmp" />
-
-    <condition
-      property="vm_args_releng_settings"
-      value="-vmargs ${vm_args_releng}">
-      <isset property="vm_args_releng" />
-    </condition>
-
-    <!-- install latest feature from repo -->
-    <exec
-      executable="${eclipseExecutable}"
-      dir="${basedir}"
-      failonerror="true">
-      <arg
-        line="-data ${eclipseWorkspaceBase}/installRelengTools -debug -consolelog -nosplash --launcher.suppressErrors -application ${APP_NAME_P2DIRECTOR_RELENG} ${OTHER_ARGS_RELENG} ${vm_args_releng_settings}" />
-    </exec>
-    <property
-      name="relengToolsInstalled"
-      value="true" />
-  </target>
-
-  <macrodef name="git-config">
-    <attribute name="repodir" />
-    <attribute name="configKey" />
-    <attribute name="configValue" />
-    <sequential>
-      <echo message="execute git in @{repodir}" />
-      <echo message="git config @{configKey} @{configValue}" />
-      <!-- We list "before and after" just to learn more about the system.
-        We
-        will not always need to do that. -->
-      <exec
-        executable="git"
-        failonerror="true"
-        dir="@{repodir}">
-        <arg value="config" />
-        <arg value="--list" />
-      </exec>
-      <exec
-        executable="git"
-        failonerror="true"
-        dir="@{repodir}">
-        <arg value="config" />
-        <arg value="@{configKey}" />
-        <arg value="@{configValue}" />
-      </exec>
-      <exec
-        executable="git"
-        failonerror="true"
-        dir="@{repodir}">
-        <arg value="config" />
-        <arg value="--list" />
-      </exec>
-    </sequential>
-  </macrodef>
-
-  <macrodef name="git-rev-parse">
-    <attribute name="repodir" />
-    <attribute
-      name="reference"
-      default="HEAD" />
-    <attribute name="returnProperty" />
-    <sequential>
-      <echo message="execute git in @{repodir}" />
-      <echo message="git rev-parse @{reference} returned in @{returnProperty}" />
-      <local name="rc" />
-      <local name="result" />
-      <exec
-        executable="git"
-        failonerror="true"
-        outputproperty="result"
-        resultproperty="rc"
-        dir="@{repodir}">
-        <arg line="rev-parse @{reference}" />
-      </exec>
-      <property
-        name="@{returnProperty}"
-        value="${result}" />
-      <echo message="In macro rc is ${rc}" />
-      <echo message="In macro result is ${result}" />
-      <echo message="In macro @{returnProperty} is ${@{returnProperty}}" />
-    </sequential>
-  </macrodef>
-
-
-  <!-- We set repo config repeatedly (every build) since we do not know "who"
-    cloned the repository first, "us", or "Hudson". And if Hudson (or Gerrit)
-    does it then we do not know how they set or determine the correct config
-    values. -->
-  <target
-    name="configRepo"
-    depends="init"
-    if="localRepoExists">
-    <echo message="git config task to execute in ${buildModelDir}" />
-    <!-- in macro "config" we list, then set then list again the configuration. -->
-    <git-config
-      repodir="${buildModelDir}"
-      configKey="core.autocrlf"
-      configValue="input" />
-  </target>
-
-  <!-- This is "the key" task. If it succeeds, we run tests (reports), and
-    if they "pass", we promote to "staging". -->
-  <target
-    name="runAggregatorCleanBuild"
-    description="Runs a clean aggregation"
-    depends="init,rewriteRepositoryURL,installAggregatorAndTools">
-    <!-- If not otherwise set in properties file, use these values. Note
-      the
-      build.eclipse.org production machine must override these values for
-      property
-      values appropriate for it (namely production.properties). -->
-    <!-- We no longer "trust" Eclipse and Equinox repos. -trustedContributions
-      Eclipse,Equinox -->
-    <property
-      name="AGG_APP_ARGS"
-      value="${AGGREGATOR_APP_BASE_ARGS} --action CLEAN_BUILD" />
-    <echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
-    <!-- Important: on any non-production machines it is important to _not_
-      use eclipse.p2.mirrors=false, so this value should be supplied by calling
-      script's properties. Note, we include '-vmargs' here, in case there
-      are not
-      any. Not sure if the use of -vmargs _requires_ arguments or not, but
-      probably
-      would. note: -Declipse.p2.MD5Check=false may be needed as a workaround
-      for
-      bug [253713] (should not actually be required ... but have left note
-      for
-      historical reference) note: rememeber that JAVA_6 should not be used
-      for
-      jar processor, see for example, bug 244603 and bug 279596. -->
-
-
-    <exec
-      executable="${eclipseExecutable}"
-      dir="${basedir}"
-      failonerror="false"
-      resultproperty="buildStatus">
-
-      <!-- Adding -consolelog makes for too much, unneeded output, since
-        the
-        aggregator produces its verbose own output, slightly cleaner. <arg
-        value="-consolelog"
-        /> -->
-      <arg value="-nosplash" />
-      <arg value="-data" />
-      <arg value="${eclipseWorkspaceBase}/runAggregatorCleanBuild" />
-      <arg value="--launcher.suppressErrors" />
-      <arg value="-application" />
-      <arg value="org.eclipse.cbi.p2repo.cli.headless" />
-      <arg value="aggregate" />
-      <arg value="--buildId" />
-      <arg value="${buildTimestamp}" />
-      <arg line="${AGG_APP_ARGS}" />
-      <arg line="${vm_setting}" />
-      <arg line="${builder_vm_args_settings}" />
-    </exec>
-
-    <antcall target="checkStatus">
-      <param
-        name="status"
-        value="${buildStatus}" />
-      <param
-        name="message"
-        value="Aggregation Failed" />
-    </antcall>
-
-    <echo message="Waiting 2 seconds..." />
-    <sleep seconds="2" />
-    <echo message="Waiting 2 seconds..." />
-    <sleep seconds="2" />
-    <echo message="Waiting 2 seconds..." />
-    <sleep seconds="2" />
-
-    <antcall target="createBuildinfo" />
-    <antcall target="createXZformats" />
-    <!-- The tests depend on the symbolic link of "latests" being created,
-      so we pause a few seconds for NSF to catch up. -->
-    <echo message="Waiting 2 seconds..." />
-    <sleep seconds="2" />
-    <echo message="Waiting 2 seconds..." />
-    <sleep seconds="2" />
-    <echo message="Waiting 2 seconds..." />
-    <sleep seconds="2" />
-
-    <antcall target="runTests">
-      <param
-        name="tests"
-        value="cleanBuildTests" />
-    </antcall>
-
-  </target>
-
-  <target name="checkStatus">
-    <echo message="status: ${status}" />
-    <condition
-      property="statusOK"
-      value="true">
-      <equals
-        forceString="true"
-        arg1="${status}"
-        arg2="0" />
-    </condition>
-    <echo message="statusOK: ${statusOK}" />
-    <antcall target="writeStatus" />
-    <fail
-      message="${message}"
-      unless="statusOK" />
-
-  </target>
-
-  <target
-    name="writeStatus"
-    unless="statusOK">
-    <echo
-      message="build failed"
-      file="${BUILD_HOME}/buildStatusFailed" />
-  </target>
-
-  <!-- Note: many tests would not be valid on "cached" version of repo, but,
-    some might? Currently no tests are called, but, we might alter, so we
-    make
-    sure installed now, in anticipation. -->
-  <target
-    name="runAggregatorBuildOnly"
-    description="Runs an aggregation, but uses prevoiusly cached artifacts, unless new ones are required by contribution"
-    depends="init,rewriteRepositoryURL,installAggregatorAndTools,initRunTestsXML">
-
-    <property
-      name="AGG_APP_ARGS"
-      value="${AGGREGATOR_APP_BASE_ARGS} --action BUILD" />
-    <echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
-    <!--
-      Important: on any non-production machines it is important to _not_
-      use eclipse.p2.mirrors=false, so this value should be supplied by calling
-      script's properties. Note, we include '-vmargs' here, in case there
-      are not any. Not sure if the use of -vmargs _requires_ arguments or
-      not, but
-      probably would. note: -Declipse.p2.MD5Check=false may be needed as
-      a workaround
-      for bug [253713] (should not be required any longer ... but have left
-      note
-      for historical reference) Another historical note, we used to "force"
-      JAVA_5 to be be used for jar processor, see for example, bug 244603
-      and bug 279596.
-      But we have not "forced" everyone to use Java 8.
-    -->
-
-    <exec
-      executable="${eclipseExecutable}"
-      dir="${basedir}"
-      failonerror="false"
-      resultproperty="buildStatus">
-      <arg value="-debug" />
-      <arg value="file://${BUILD_HOME_DIR}/p2options/.options" />
-      <!--
-        Adding -consolelog makes for too much, unneeded output, since
-        the aggregator produces its verbose own output, slightly cleaner.
-      -->
-      <arg value="-nosplash" />
-      <arg value="-data" />
-      <arg value="${eclipseWorkspaceBase}/runAggregatorBuildOnly" />
-      <arg value="--launcher.suppressErrors" />
-      <arg value="-application" />
-      <arg value="org.eclipse.cbi.p2repo.cli.headless" />
-      <arg value="aggregate" />
-      <arg value="--buildId" />
-      <arg value="${buildTimestamp}" />
-      <arg line="${AGG_APP_ARGS}" />
-      <arg line="${vm_setting}" />
-      <arg line="${builder_vm_args_settings}" />
-    </exec>
-
-    <antcall target="checkStatus">
-      <param
-        name="status"
-        value="${buildStatus}" />
-      <param
-        name="message"
-        value="Aggregation Failed" />
-    </antcall>
-
-    <antcall target="createBuildinfo" />
-
-    <antcall target="runTests">
-      <param
-        name="tests"
-        value="cachedBuildTests" />
-    </antcall>
-
-  </target>
-
-  <!--
-    Note, we currently have no "tests" for the "validate only" case, but
-    we could, might someday, so we go ahead an install, in anticipation.
-    For example, we might simply test that all aggrcon files specify
-    unique URL (to simple repository) or that "versions" are
-    specified in *.aggrcon file.
-  -->
-  <target
-    name="runAggregatorValidateOnly"
-    description="Runs an aggregation, but validates constraints only. Does not fetch artifacts."
-    depends="init,rewriteRepositoryURL,installAggregatorAndTools,initRunTestsXML">
-
-    <property
-      name="AGG_APP_ARGS"
-      value="${AGGREGATOR_APP_BASE_ARGS} --action VALIDATE" />
-    <echo message="AGG_APP_ARGS: ${AGG_APP_ARGS}" />
-
-
-    <exec
-      executable="${eclipseExecutable}"
-      dir="${basedir}"
-      failonerror="false"
-      resultproperty="buildStatus">
-      <arg value="-debug" />
-      <!--
-        In case extra tracing is desired:
-        <arg value="file://${BUILD_HOME}/org.eclipse.simrel.tools/p2options/.options"
-        />
-      -->
-      <!--
-        Adding -consolelog makes for too much, unneeded output, since
-        the aggregator produces its verbose own output, slightly cleaner.
-      -->
-      <arg value="-nosplash" />
-      <arg value="-data" />
-      <arg value="${eclipseWorkspaceBase}/runAggregatorValidateOnly" />
-      <arg value="--launcher.suppressErrors" />
-      <arg value="-application" />
-      <arg value="org.eclipse.cbi.p2repo.cli.headless" />
-      <arg value="aggregate" />
-      <arg value="--buildId" />
-      <arg value="${buildTimestamp}" />
-      <arg line="${AGG_APP_ARGS}" />
-      <arg line="${vm_setting}" />
-      <arg line="${builder_vm_args_settings}" />
-    </exec>
-
-    <antcall target="checkStatus">
-      <param
-        name="status"
-        value="${buildStatus}" />
-      <param
-        name="message"
-        value="Aggregation Failed" />
-    </antcall>
-
-    <!-- setting dir to our workspace, so tests done on what "we" have -->
-    <antcall target="createBuildinfo" />
-
-    <antcall target="runTests">
-      <param
-        name="tests"
-        value="validateOnlyTests" />
-    </antcall>
-
-  </target>
-
-  <target
-    name="runTests"
-    if="runTestsXML">
-    <ant
-      antfile="${runTestsXML}"
-      target="${tests}"
-      dir="${BUILD_HOME}" />
-
-  </target>
-
-  <target
-    name="initRunTestsXML"
-    depends="getBuildToolsDir"
-    if="toolsAvailable"
-    unless="runTestsXML">
-    <path id="runTests.paths">
-      <fileset
-        dir="${buildToolsDir}"
-        includes="runTests.xml" />
-    </path>
-    <property
-      name="runTestsXML"
-      refid="runTests.paths" />
-    <echo message="runTestsXML file: ${runTestsXML}" />
-  </target>
-
-  <target name="getBuildToolsDir">
-    <property
-      name="buildToolsDir"
-      value="${BUILD_HOME}/org.eclipse.simrel.tools" />
-    <available
-      file="${buildToolsDir}"
-      property="toolsAvailable" />
-  </target>
-  <target
-    name="init"
-    depends="getJVMLocation, getBUILD_HOME, setDefaultBUILD_HOME, setDefaultRelease, getBuildTimestamp, getJobName, getJobNumber, getBuildToolsDir, gitRevParseTools, getBuildModelDir"
-    unless="isInitialized">
-
-    <!-- We assign a reasonable value for local builds, but for production
-      builds should be .../production.properties This property file name
-      is itself
-      a property, so it can be overridden on one machine versus another.
-      We do
-      it this way, instead of just specifying -propertyFile on command line,
-      so
-      that the property values can be "nested" in other property values and
-      evaluated
-      lazily. -->
-    <property
-      name="aggrPropertyFile"
-      value="${buildToolsDir}/aggr.properties" />
-
-    <property file="${aggrPropertyFile}" />
-
-      <!-- 
-      The "binary platform" is enough, for now, and since smaller than the SDK,
-      it is recommended as the "base" to install tools into. But a typical "SDK" has been
-      left in this comment in case users are doing more than a normal "aggregation build".
-      value="/home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200/eclipse-SDK-4.6.1-linux-gtk-x86_64.tar.gz" 
-      -->
-      <!--
-      Note: if there is local file system version of the prereq platform, 
-      if it faster to specify file://<location of platform>.
-      <property name="platformLocation" value="file:///home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200" />
-      We use "http://" by default to make it easy to "run from anywhere", but
-      on the production machine, in production.properties, we specify the "file://" form.
-      -->
-
-    <property
-      name="platformLocation"
-      value="http://download.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200" />
-    <property
-      name="platformFilename"
-      value="eclipse-SDK-4.6.1-linux-gtk-x86_64.tar.gz" />
-    <property
-      name="localPrereqCache"
-      value="${BUILD_HOME}/localPrereqs" />
-    <property
-      name="platformResource"
-      value="${platformLocation}/${platformFilename}" /> 
-      <!-- directory must exist before "get" uses it or else the file is given name of "localPrereqs" -->
-    <mkdir dir="${localPrereqCache}" />
-
-
-    <property
-      name="ECLIPSE_HOME"
-      value="${BUILD_HOME}/eclipseInstall" />
-
-    <property
-      name="ECLIPSE_EXE"
-      value="${ECLIPSE_HOME}/eclipse/eclipse" />
-
-    <property
-      name="AGGREGATOR_RESULTS"
-      value="${BUILD_HOME}/aggregation" />
-
-    <!-- git_protocol should be changed to somethign like "file://" for production
-      builds, for efficiency and to avoid problems when the "internal" network
-      is down. (Note no trailing slash). It can be added to a local copy
-      of 'aggrPropertyFile' -->
-    <property
-      name="git_protocol"
-      value="git://git.eclipse.org" />
-
-    <!--
-      rewriteRepositoryURLValue is an important variable, passed in through
-      production.properties. It is the trigger to change http:// values,
-      to file:// values. At one point, we needed, unrewriteMapsLine, to know
-      how to
-      "change back" and now use commonRepositoryDownloadURLValue to know
-      "what to
-      look for" to change to rewriteRepositoryURLValue, but this should not
-      be
-      needed to be changed, since we make the strong assumption that, in
-      *.aggrcon
-      files, this string occurs only in repository location attributes. If
-      not true,
-      more complex parsing/replacement would be required.
-    -->
-    <property
-      name="commonRepositoryDownloadURLValue"
-      value="http://download.eclipse.org" />
-
-    <condition property="localRepoExists">
-      <available file="${buildModelDir}/.git" />
-    </condition>
-
-    <property
-      name="eclipseWorkspaceBase"
-      value="${BUILD_HOME}/eclipseworkspaces" />
-
-    <!--
-      If the eclipse workspace exists, remove it, to make sure we are
-      starting "fresh". Eclipse will create it. Be sure some "archive
-      artifacts" job saves it away, if desired, just for it's ".log",
-      if nothing else.
-    -->
-    <delete
-      dir="${eclipseWorkspaceBase}"
-      quiet="true" />
-
-    <!-- Note: we put -vmargs directly in builder_vm_args_settings so that if desired
-      to not have ANY vmargs, then we will not be left with a dangling (empty)
-      -vmargs at the end of eclipse command line. -->
-    <property
-      name="builder_vm_args"
-      value="-Xmx1024M -Djava.io.tmpdir=${BUILD_HOME}/tmp" />
-    <condition
-      property="builder_vm_args_settings"
-      value="-vmargs ${builder_vm_args}">
-      <isset property="builder_vm_args" />
-    </condition>
-
-    <!-- tmp directory must exist, for Java to use it -->
-    <mkdir dir="${BUILD_HOME}/tmp" />
-    <echo message="Made directory ${BUILD_HOME}/tmp" />
-
-
-    <property
-      name="eclipseExecutable"
-      value="${ECLIPSE_EXE}" />
-
-    <available
-      file="${ECLIPSE_HOME}/eclipse"
-      type="dir"
-      property="eclipseExists" />
-
-    <!-- set installEclipseAndTools on command line to force a reinstall,
-      Otherwise, only installed if not installed yet. -->
-    <condition property="installEclipseAndTools">
-      <not>
-        <isset property="eclipseExists" />
-      </not>
-    </condition>
-
-    <!-- saveAndInstallEclipseAndTools should only be true if "installEclipseAndTools"
-      are set on command line properties (and a version already exists). -->
-    <condition property="saveAndInstallEclipseAndTools">
-      <and>
-        <isset property="eclipseExists" />
-        <isset property="installEclipseAndTools" />
-      </and>
-    </condition>
-
-    <!-- note the "https" may have to be "http" on localhost, non-production
-      hudson machines -->
-    <property
-      name="hostForURL"
-      value="https://hudson.eclipse.org" />
-
-    <!-- TODO: this will not be correct for local builds, probably. Could
-      do
-      more to detect "local builds" and either not set, or set to correct
-      values
-      for a "local hudson". -->
-    <property
-      name="LOG_URL"
-      value="${hostForURL}/simrel/job/${jobName}/${jobNumber}/console" />
-
-    <!-- These are the arguments to the aggregator that are constant, whether
-      doing "production build" or "local build". If doing production build,
-      then
-      is also needs the &dash;$dash;production argument (it is the one that
-      cuases
-      "blame mail" to be sent). If PRODUCTION is not set externally (such
-      as on
-      command line, or in a property file, we set it to blank here to avoid
-      the
-      literal '${PRODUCTION} from being passed as an argument. Be sure to
-      udpate
-      emailFrom as "build master" changes. -->
-    <property
-      name="PRODUCTION"
-      value="" />
-    <!-- In the distant past, we have also used these arguments. The maven
-      result one was always experimental. We have also learned it it better
-      not
-      to "trust" any repository. Can only use one or the other, not both
-      &dash;&dash;mavenResult
-      &dash;&dash;trustedContributions Eclipse,Equinox -->
-    <property
-      name="AGGREGATOR_APP_BASE_ARGS"
-      value="${PRODUCTION} --buildModel ${buildModelDir}/simrel.aggr --buildRoot ${AGGREGATOR_RESULTS} --eclipseLogLevel DEBUG --logLevel DEBUG --emailFrom david_williams@eclipse.org --emailFromName ${release}Aggregator --logURL ${LOG_URL} --subjectPrefix ${release}Aggregation" />
-
-    <echo message="= = = Properties at end of init = = = " />
-    <echo message="git_protocol: ${git_protocol}" />
-    <echo message="PRODUCTION: ${PRODUCTION}" />
-    <echo message="rewriteRepositoryURLValue: ${rewriteRepositoryURLValue}" />
-    <echo message="buildModelCommit: ${buildModelCommit}" />
-    <echo message="toolsRepoCommit: ${toolsRepoCommit}" />
-    <echo message="aggrPropertyFile: ${aggrPropertyFile}" />
-    <echo message="buildId: ${buildTimestamp}" />
-    <echo message="user.dir: ${user.dir}" />
-    <echo message="user.home: ${user.home}" />
-    <echo message="BUILD_HOME (normally HUDSON workspace): ${BUILD_HOME}" />
-    <echo message="Eclipse workspace base: ${eclipseWorkspaceBase}" />
-    <echo message="PATH: ${env.PATH}" />
-    <echo message="JAVA_HOME: ${JAVA_HOME}" />
-    <echo message="hostForURL: ${hostForURL}" />
-    <echo message="jobName: ${jobName}" />
-    <echo message="jobNumber: ${jobNumber}" />
-    <echo message="ECLIPSE_EXE:  ${ECLIPSE_EXE}" />
-    <echo message="eclipseExists: ${eclipseExists}" />
-    <echo message="builder_vm_args: ${builder_vm_args}" />
-    <echo message="builder_vm_args_settings: ${builder_vm_args_settings}" />
-    <echo message=" = = = = = = = = = = = = " />
-    <echoproperties />
-
-    <!-- remove "build failed" status file, if there is one from previous
-      run. -->
-    <delete
-      failonerror="true"
-      quiet="true">
-      <fileset dir="${BUILD_HOME}">
-        <include name="buildStatusFailed" />
-      </fileset>
-    </delete>
-
-    <!-- no need to initialize twice -->
-    <property
-      name="isInitialized"
-      value="true" />
-
-  </target>
-
-  <target
-    name="getBuildTimestamp"
-    depends="getHudsonTimestamp"
-    unless="buildTimestamp">
-    <tstamp>
-      <format
-        property="buildTimestamp"
-        pattern="yyyy-MM-dd_HH-mm-ss"
-        timezone="UTC_TIME" />
-    </tstamp>
-    <echo message="Using Ant computed timestamp (since not running on Hudson): ${buildTimestamp}." />
-  </target>
-
-  <target
-    name="getHudsonTimestamp"
-    unless="buildTimestamp"
-    if="env.BUILD_ID">
-    <property
-      name="buildTimestamp"
-      value="${env.BUILD_ID}" />
-    <echo message="Using timestamp from Hudson Build ID: ${buildTimestamp}" />
-  </target>
-
-  <target
-    name="getJobName"
-    depends="getHudsonJobName"
-    unless="jobName">
-    <property
-      name="jobName"
-      value="none" />
-    <echo message="Using default jobName: none." />
-  </target>
-
-  <target
-    name="getHudsonJobName"
-    unless="jobName"
-    if="env.JOB_NAME">
-    <property
-      name="jobName"
-      value="${env.JOB_NAME}" />
-    <echo message="Using jobName from Hudson Builder: ${jobName}" />
-  </target>
-
-  <target
-    name="getJobNumber"
-    depends="getHudsonJobNumber"
-    unless="jobNumber">
-
-    <property
-      name="jobNumber"
-      value="none" />
-    <echo message="Using default jobNumber: ${jobNumber}." />
-  </target>
-
-  <target
-    name="getHudsonJobNumber"
-    unless="jobNumber"
-    if="env.BUILD_NUMBER">
-    <property
-      name="jobNumber"
-      value="${env.BUILD_NUMBER}" />
-    <echo message="Using jobNumber from Hudson Builder: ${jobNumber}" />
-  </target>
-
-  <target
-    name="getBUILD_HOME"
-    depends="getHudsonBUILD_HOME"
-    unless="BUILD_HOME">
-    <condition
-      property="BUILD_HOME"
-      value="${env.BUILD_HOME}">
-      <isset property="env.BUILD_HOME" />
-    </condition>
-  </target>
-
-  <target
-    name="getHudsonBUILD_HOME"
-    unless="BUILD_HOME">
-    <condition
-      property="BUILD_HOME"
-      value="${env.WORKSPACE}">
-      <isset property="env.WORKSPACE" />
-    </condition>
-  </target>
-
-  <target
-    name="setDefaultBUILD_HOME"
-    unless="BUILD_HOME">
-    <property
-      name="BUILD_HOME"
-      value="${basedir}" />
-    <property
-      name="buildModelDir"
-      value="${basedir}" />
-
-    <echo
-      message="WARNING: BUILD_HOME set to a default value, ${BUILD_HOME}. Typically this is not desired and may mean there is a configuration issue." />
-    <echo message="WARNING: This implies we also set buildModelDir to ${basedir}" />
-
-  </target>
-  <target
-    name="setDefaultRelease"
-    unless="release">
-    <property
-      name="release"
-      value="noReleaseSpecified" />
-    <echo
-      message="WARNING: release set to a default value, ${release}. Typically this is not desired and may mean there is a configuration issue." />
-  </target>
-  <!-- Only rewrite, if a value has been provided -->
-  <!-- TODO: should make the "exclude" part automatic based on presence/abscense
-    of "useTrusted" property -->
-  <target
-    name="rewriteRepositoryURL"
-    if="rewriteRepositoryURLValue"
-    unless="rewroteURLs">
-    <replace
-      dir="${buildModelDir}"
-      token="${commonRepositoryDownloadURLValue}"
-      value="${rewriteRepositoryURLValue}">
-      <include name="*.aggrcon" />
-      <!-- <exclude name="ep.aggrcon"/> <exclude name="equinox.aggrcon"/> -->
-    </replace>
-    <echo message="Rewrote repository location URLs ..." />
-    <echo message="        From: ${commonRepositoryDownloadURLValue}" />
-    <echo message="          To: ${rewriteRepositoryURLValue}" />
-    <echo message="   Excluding no files since no composite artifacts, just agregate" />
-    <!-- <echo message=" Excluding: ep.aggrcon"/> <echo message=" Excluding:
-      ep.aggrcon, equinox.aggrcon"/> -->
-    <property
-      name="rewroteURLs"
-      value="true" />
-
-  </target>
-
-  <target
-    name="getBuildModelDir"
-    unless="buildModelDir">
-    <property
-      name="buildModelDir"
-      value="${BUILD_HOME}/org.eclipse.simrel.build" />
-  </target>
-
-  <target name="createXZformats">
-    <exec
-      executable="/bin/bash"
-      dir="${basedir}"
-      failonerror="true">
-      <arg line="convertxz.sh ${AGGREGATOR_RESULTS}/final" />
-    </exec>
-  </target>
-
-  <target
-    name="createBuildinfo"
-    depends="init, gitRevParseModel, gitRevParseTools">
-
-    <property
-      name="BUILD_INFO_DIR"
-      value="${AGGREGATOR_RESULTS}/final/buildInfo" />
-  	<!-- 
-  	  Note: The propertyfile task literally edits the properties, 
-  	  if the file already exists, does not create a new one. Therefore 
-  	  we delete it first.
-  	-->
-    <delete dir="${BUILD_INFO_DIR}" />
-    <mkdir dir="${BUILD_INFO_DIR}" />
-
-    <propertyfile file="${BUILD_INFO_DIR}/buildInfo.properties">
-      <entry
-        key="buildModelCommit"
-        value="${buildModelCommit}" />
-      <entry
-        key="toolsRepoCommit"
-        value="${toolsRepoCommit}" />
-      <entry
-        key="triggerJobName"
-        value="${jobName}" />
-      <entry
-        key="triggerJobNumber"
-        value="${jobNumber}" />
-      <entry
-        key="triggerBuildTimestamp"
-        value="${buildTimestamp}" />
-      <entry
-        key="triggerBuildId"
-        value="${buildTimestamp}" />
-    </propertyfile>
-    <!-- echo the key ones to end of log, just to have redundant record. -->
-    <echo message="buildModelCommit: ${buildModelCommit}" />
-    <echo message="toolsRepoCommit: ${toolsRepoCommit}" />
-    <echo message="triggerJobName: ${jobName}" />
-    <echo message="triggerJobNumber: ${jobNumber}" />
-    <echo message="triggerBuildTimestamp: ${buildTimestamp}" />
-    <echo message="triggerBuildId: ${buildTimestamp}" />
-    <!-- just as well write out everything ... just in case something else
-      needed in future. -->
-    <echoproperties destfile="${BUILD_INFO_DIR}/allInfo.properties" />
-  </target>
-
-  <target
-    name="gitRevParseModel"
-    depends="getBuildModelDir">
-    <git-rev-parse
-      repodir="${buildModelDir}"
-      returnproperty="buildModelCommit" />
-    <echo message="In target gitRevParseModel, buildModelCommit: ${buildModelCommit}" />
-  </target>
-  <target
-    name="gitRevParseTools"
-    depends="getBuildToolsDir"
-    if="toolsAvailable">
-    <git-rev-parse
-      repodir="${buildToolsDir}"
-      returnproperty="toolsRepoCommit" />
-    <echo message="In target gitRevParseTools, toolsRepoCommit: ${toolsRepoCommit}" />
-  </target>
-
-  <target
-    name="default"
-    description="By default run the runAggregatorValidateOnly target">
-    <echo message="Using default target:" />
-    <echo message="     runAggregatorValidateOnly" />
-    <echo message="  Other meaningful targets to specify explicitly:" />
-    <echo message="     runAggregatorBuildOnly" />
-    <echo message="     runAggregatorCleanBuild" />
-    <antcall target="runAggregatorValidateOnly" />
-  </target>
-
-  <target
-    name="savePrevious"
-    depends="init"
-    if="saveAndInstallEclipseAndTools"
-    unless="previousSaved">
-
-    <!-- Remember, old, saved versions may have to be maually cleaned up,
-      from
-      time to time. But probably handled well enough by an occasional, manual
-      "clean
-      workspace" from Hudson's web interface. -->
-    <move
-      verbose="true"
-      todir="${ECLIPSE_HOME}/eclipse${buildTimestamp}">
-      <fileset dir="${ECLIPSE_HOME}/eclipse" />
-    </move>
-
-    <property
-      name="previousSaved"
-      value="true" />
-  </target>
-    <!-- It is not required for user to specify "vm", only
-         needed if they want to override the system (or Hudson) 
-         default. We do the "work" in getJVMLocationInternal
-         so we can set a "null default" in this task.
-    -->
-  <target
-    name="getJVMLocation"
-    depends="getJVMLocationInternal"
-    unless="vm_setting">
-      <!-- if vm_setting not set in 'getJVMLocationInternal'
-           then we set it to "null" here so that is has a safe value
-           when later used as <arg line="${vm_setting} />
-      -->
-    <property
-      name="vm_setting"
-      value="" />
-    <echo message="vm_setting has no value: ${vm_setting}" />
-  </target>
-  <target
-    name="getJVMLocationInternal"
-    depends="getJAVA_HOME"
-    if="JAVA_HOME"
-    unless="vm_setting">
-    <property
-      name="vm_setting"
-      value="-vm ${JAVA_HOME}/jre/bin" />
-    <echo message="at end of 'getJVMLocationInternal' vm_setting: ${vm_setting}" />
-  </target>
-    <!-- we have all these "checks" and "print out" since
-         it is not known how ant "knows about" JAVA_HOME.
-         That is, ant could be running in a Java different from
-         the one that is desired to be used to run aggregator.
-         Put another way, users can define JAVA_HOME as an environment 
-         variable, or pass in a -DJAVA_HOME value. The later takes 
-         priority, if both exists. 
-         Example: -DJAVA_HOME=/shared/common/jdk1.8.0_x64-latest
-    -->
-  <target
-    name="getJAVA_HOME"
-    depends="printPredefinedJAVA_HOME"
-    unless="JAVA_HOME">
-    <condition
-      property="JAVA_HOME"
-      value="${env.JAVA_HOME}">
-      <isset property="env.JAVA_HOME" />
-    </condition>
-    <echo message="at end of 'getJAVA_HOME', JAVA_HOME: ${JAVA_HOME}" />
-  </target>
-  <target
-    name="printPredefinedJAVA_HOME"
-    if="JAVA_HOME">
-    <echo message="Found JAVA_HOME already defined to be ${JAVA_HOME}" />
-  </target>
+  <import file="build.xml" />
 
   <target
     name="getModelFromGit"
+    description="This target is left over from doing cronjobs or running from command line. Is not required with running from Hudson"
     depends="getBUILD_HOME, init, initBranch, cloneRepo, configRepo, pullRepo, getModelFromGerrit"
     unless="modelRetrived">
 
-    <!-- While Hudson normall does clone and 'pull'
+    <!--
+         While Hudson normally does clone and 'pull'
          we provide these methods in "fetchAndbuild.xml",
          to ease some command line methods of running.
      -->
diff --git a/production.properties b/production.properties
index d690bc6..b215f9b 100644
--- a/production.properties
+++ b/production.properties
@@ -1,19 +1,22 @@
 #!/usr/bin/env bash
 
 # common variables used in scripts
+# See the top of build.xml and aggr.properties for more
+# description of what may or may not be overridden in
+# property files.
 
 # this is what causes "blame mail" to be sent out.
 PRODUCTION=--production
 
-# This makes getting the git repos more efficient, when 
+# This makes getting the git repos more efficient, when
 # running on Eclipse.org infrastructure.
 git_protocol=file://
 
 # This is important, for efficiency in production builds,
-# It is used to "rewrite" the URLS in aggr file that are specified as 
+# It is used to "rewrite" the URLS in aggr file that are specified as
 # http://download.eclipse.org/<projectRepos>
 rewriteRepositoryURLValue=file:///home/data/httpd/download.eclipse.org
 
-# we specify root location of platform as "file://" on production machine 
+# we specify root location of platform as "file://" on production machine
 # to that it is quicker for ant to "get" it.
 rootLocation=file:///home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200
diff --git a/runTests.xml b/runTests.xml
index 482a227..15bd81b 100644
--- a/runTests.xml
+++ b/runTests.xml
@@ -1,14 +1,15 @@
 <project
   name="SimRel Tests"
   basedir="."
-  default="runTests">
+  default="runReports">
 
+  <!-- define 'env' globally -->
   <property environment="env" />
-  <!-- This property file name is itself a property, so it can be overridden
+
+  <!-- The 'aggrPropertyFile' property file name is itself a property, so it can be overridden
     on one machine versus another. We do it this way, instead of just specifying
     -propertyFile on command line, so that the property values can be "nested"
     in other property values and evaluated lazily. -->
-
   <property
     name="aggrPropertyFile"
     value="aggr.properties" />
@@ -20,7 +21,6 @@
        .../reporeports/reports contains the actual reports.
        .../reporeports contains the index.html file.
   -->
-
   <property
     name="testRepoDirectory"
     value="${BUILD_HOME}/aggregation/final" />
@@ -34,13 +34,13 @@
 
   <!-- We should be passed (or, inherit) the release value from where
        this script it called in build.xml.
-       TODO: would be best to control this value from Hudson property, 
+       TODO: would be best to control this value from Hudson property,
        so that changes in future do not require changes in code.
-       NOTE: another example of where "update" and "mainline" would 
+       NOTE: another example of where "update" and "mainline" would
        be useful variables to have?
   -->
   <!-- reference repository for update releases is alwasy the previous release.
-       reference repository for mainline release should be the latest "update staging" repostory, 
+       reference repository for mainline release should be the latest "update staging" repostory,
        once it exists and is accurate.
   -->
   <condition
@@ -69,35 +69,30 @@
      So far, only the "clean build" has any real tests, be eventually others
      could have some checks/tests.
   -->
-  <target name="validateOnlyTests">
+  <target
+    name="validateOnlyTests"
+    description="Tests appropriate when only metadata available">
     <echo message="No validation-only tests, yet (other then the aggregation validation itself)." />
   </target>
 
-  <target name="cachedBuildTests">
+  <target
+    name="cachedBuildTests"
+    description="Tests appropriate when metadata and artifacts available (though, for cached build, may be 'extra' artifacts not cleaned up yet">
     <echo message="No cached build tests, yet (other then the cached aggregation build itself)." />
   </target>
 
   <target
     name="cleanBuildTests"
-    depends="runTests">
+    description="The primary and final time to test metadata and artifacts."
+    depends="runReports">
     <echo>
       Ran standard clean build reports and tests.
       See report in ${reportOutputDir}.
     </echo>
   </target>
 
-  <target name="runTests">
-    <echo message="Creating Reports" />
-
-    <echoproperties />
-
-    <antcall target="runReports" />
-
-    <!-- currently, we never "fail" ... but, will in future -->
-    <fail if="failuresoccurred" />
-  </target>
-
   <target name="runReports">
+    <echo message="Creating Reports" />
     <property
       name="REPORT_APP_NAME"
       value="org.eclipse.cbi.p2repo.analyzers.repoReport" />
@@ -115,7 +110,9 @@
     <exec
       executable="${eclipseTestExecutable}"
       dir="${basedir}"
-      failonerror="true">
+      failonerror="false"
+      failifexecutionfails="true"
+      resultproperty="applicationResult">
       <arg value="-nosplash" />
       <arg value="-debug" />
       <arg value="--launcher.suppressErrors" />
@@ -124,6 +121,18 @@
       <arg value="-vmargs" />
       <arg line="${VM_TEST_ARGS}" />
     </exec>
+
+    <echo message="DEBUG: resultproperty: ${resultproperty}" />
+    <condition property="failuresoccurred">
+      <not>
+        <equals
+          arg1="resultproperty"
+          arg2="0" />
+      </not>
+    </condition>
+      <!-- currently, we (should) never "fail" ... but, will in future -->
+      <!-- need to learn how to signal "unstable" to Hudson, as opposed to outright failure. -->
+    <fail if="failuresoccurred" />
   </target>
 
 </project>
\ No newline at end of file