Bug 488667 - React to deltapack removal

Signed-off-by: David Williams<david_williams@us.ibm.com>
diff --git a/org.eclipse.pde.build.tests/test.xml b/org.eclipse.pde.build.tests/test.xml
index 536b5f5..e701416 100644
--- a/org.eclipse.pde.build.tests/test.xml
+++ b/org.eclipse.pde.build.tests/test.xml
@@ -27,6 +27,9 @@
     <delete>
       <fileset dir="${eclipse-home}" includes="org*.xml"/>
     </delete>
+
+    <antcall target="createDeltaPack" />
+
   </target>
 
   <!-- This target defines the tests that need to be run. -->
@@ -68,5 +71,138 @@
   <target name="performance">
   </target>
   -->
+  <target name="initcreateDeltaPack">
+
+    <!--
+      In product tests, currentUpdateSite is provided by the testing infrastructure.
+      It should be similar to somethign like
+      http://download.eclipse.org/eclipse/updates/4.6-I-builds/I20160419-0800/
+    -->
+
+    <fail
+      unless="currentUpdateSite"
+      message="currentUpdateSite must be provided to this script." />
+
+    <!--
+      'executionDir' is ${testDir}/eclipse-testing"
+      'install' is ${executionDir}/test-eclipse
+      The eclipse to-be-tested is intalled under ${install}
+      So 'deltapack' will be a peer to it.
+      In productin tests, 'install' and 'executionDir' are provided by the testing
+      infrastructure.
+    -->
+    <property
+      name="installDeltapack"
+      value="${install}/deltapack" />
+
+    <property
+      name="featureTemp"
+      value="${executionDir}/featureTemp" />
+  </target>
+
+  <!--
+    This 'createDeltaPack' target is conceptually very similar to the one we refer to in our
+    documentation, in our Git repo, at
+    http://git.eclipse.org/c/platform/eclipse.platform.releng.aggregator.git/plain/scripts/createdeltapack.xml
+    Only in this one, there is no need to "zip up" the delta pack.
+  -->
+  <target
+    name="createDeltaPack"
+    depends="initcreateDeltaPack"
+    unless="deltaPackInstalled">
+
+
+    <echo message="DEBUG: echoproperties at beginning of deltapack (after init)" />
+    <echoproperties />
+    <delete
+      verbose="true"
+      dir="${featureTemp}" />
+    <mkdir dir="${featureTemp}" />
+    <delete
+      verbose="true"
+      dir="${installDeltapack}" />
+    <mkdir dir="${installDeltapack}" />
+
+    <p2.mirror
+      source="${currentUpdateSite}"
+      log="${executionDir}/deltapackmirrorlog.txt"
+      verbose="true"
+      ignoreerrors="true">
+      <destination
+        kind="metadata"
+        location="file://${featureTemp}"
+        name="RCP Delta Pack Repo"
+        format="${currentUpdateSite}" />
+      <destination
+        kind="artifact"
+        location="file://${featureTemp}"
+        name="RCP Delta Pack Repo"
+        format="${currentUpdateSite}" />
+      <iu
+        id="org.eclipse.platform.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.platform.source.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.rcp.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.rcp.source.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.jdt.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.jdt.source.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.rcp.configuration.feature.group"
+        version="" />
+
+      <iu
+        id="org.eclipse.equinox.executable"
+        version="" />
+      <iu
+        id="org.eclipse.e4.rcp.feature.group"
+        version="" />
+      <iu
+        id="org.eclipse.e4.rcp.source.feature.group"
+        version="" />
+      <slicingOptions
+        includeOptional="false"
+        includeNonGreedy="false"
+        followStrict="true"
+        followOnlyFilteredRequirements="true"
+        latestVersionOnly="true" />
+    </p2.mirror>
+    <p2.remove.iu>
+      <repository location="file://${featureTemp}" />
+      <iu id="org.eclipse.jdt.feature.jar" />
+      <iu id="org.eclipse.jdt.source.feature.jar" />
+      <iu id="org.eclipse.platform.feature.jar" />
+      <iu id="org.eclipse.platform.source.feature.jar" />
+      <iu id="org.eclipse.rcp.feature.jar" />
+      <iu id="org.eclipse.rcp.source.feature.jar" />
+      <iu id="org.eclipse.e4.rcp.feature.jar" />
+      <iu id="org.eclipse.e4.rcp.source.feature.jar" />
+    </p2.remove.iu>
+    <p2.repo2runnable
+      destination="file://${installDeltapack}/eclipse"
+      failonerror="true">
+      <source>
+        <repository location="file://${featureTemp}" />
+      </source>
+    </p2.repo2runnable>
+    <delete verbose="true">
+      <fileset
+        dir="${installDeltapack}/eclipse"
+        includes="*.jar" />
+      <fileset
+        dir="${installDeltapack}/eclipse"
+        includes="*.xml" />
+    </delete>
+
+  </target>
 
 </project>