changeset 888:19f9b6548c70

7011272: langtools build.xml should provide a patch target Reviewed-by: jonathan, jjh
author ksrini
date Fri, 14 Jan 2011 13:59:18 -0800
parents 0a509c765657
children 5cf6c432ef2f
files make/build.xml
diffstat 1 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/make/build.xml	Fri Jan 14 11:55:53 2011 -0800
+++ b/make/build.xml	Fri Jan 14 13:59:18 2011 -0800
@@ -352,6 +352,45 @@
         </java>
     </target>
 
+    <!-- a patching facility to speed up incorporating the langtools' classfiles
+         into a jdk of your choice. Either target.java.home or patch.jdk can be
+         set on the command line; setting target.java.home has the advantage of
+         patching the jdk used for jtreg and other tests.
+    -->
+    <target name="patch" depends="build-all-classes">
+        <condition property="patch.jdk" value="${target.java.home}">
+            <available file="${target.java.home}" type="dir"/>
+        </condition>
+        <fail message="patch.jdk or target.java.home is not set, please set target.java.home, or patch.jdk for an alternate jdk image to patch">
+            <condition>
+                <not>
+                    <isset property="patch.jdk"/>
+                </not>
+            </condition>
+        </fail>
+        <property name="patch.tools.jar" location="${patch.jdk}/lib/tools.jar"/>
+        <property name="patch.rt.jar" location="${patch.jdk}/jre/lib/rt.jar"/>
+        <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing tools.jar">
+            <condition>
+                <not>
+                    <available file="${patch.tools.jar}" type="file"/>
+                </not>
+            </condition>
+        </fail>
+        <fail message="patch.jdk or target.java.home must point to a valid jdk image: missing rt.jar">
+            <condition>
+                <not>
+                    <available file="${patch.rt.jar}" type="file"/>
+                </not>
+            </condition>
+        </fail>
+        <zip zipfile="${patch.tools.jar}" update="true">
+            <zipfileset dir="${build.classes.dir}" includes="com/**"/>
+        </zip>
+        <zip zipfile="${patch.rt.jar}" update="true">
+            <zipfileset dir="${build.classes.dir}" includes="javax/**"/>
+        </zip>
+    </target>
 
     <!--
     **** Debugging/diagnostic targets.