build-drop-template.xml

Thu, 22 Apr 2010 16:54:28 -0700

author
mikejwre
date
Thu, 22 Apr 2010 16:54:28 -0700
changeset 111
cf4686bf35ab
parent 91
cc35f0e129d2
child 116
4ac192952d75
permissions
-rw-r--r--

Added tag jdk7-b90 for changeset ead7c4566a00

ohair@85 1 <?xml version="1.0"?>
ohair@85 2 <!--
ohair@85 3 Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
ohair@85 4 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@85 5
ohair@85 6 This code is free software; you can redistribute it and/or modify it
ohair@85 7 under the terms of the GNU General Public License version 2 only, as
ohair@85 8 published by the Free Software Foundation. Sun designates this
ohair@85 9 particular file as subject to the "Classpath" exception as provided
ohair@85 10 by Sun in the LICENSE file that accompanied this code.
ohair@85 11
ohair@85 12 This code is distributed in the hope that it will be useful, but WITHOUT
ohair@85 13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@85 14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@85 15 version 2 for more details (a copy is included in the LICENSE file that
ohair@85 16 accompanied this code).
ohair@85 17
ohair@85 18 You should have received a copy of the GNU General Public License version
ohair@85 19 2 along with this work; if not, write to the Free Software Foundation,
ohair@85 20 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@85 21
ohair@85 22 Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
ohair@85 23 CA 95054 USA or visit www.sun.com if you need additional information or
ohair@85 24 have any questions.
ohair@85 25 -->
ohair@85 26
ohair@85 27 <project name="@DROP@-drop" default="all" basedir=".">
ohair@85 28
ohair@85 29 <!-- Locations of master drop bundles. -->
ohair@85 30 <property name="@DROP@.master.bundle.copy"
ohair@85 31 value="${@DROP@.master.bundle.dir}/${@DROP@.bundle.name}"/>
ohair@85 32 <property name="@DROP@.master.bundle.url"
ohair@85 33 value="${@DROP@.master.bundle.url.base}/${@DROP@.bundle.name}"/>
ohair@85 34
ohair@85 35 <!-- Location where the copied bundle lands. -->
ohair@85 36 <property name="@DROP@.bundle.copy"
ohair@91 37 value="${drop.expanded.dir}/bundles/${@DROP@.bundle.name}"/>
ohair@85 38
ohair@85 39 <!-- Root of exploded area. -->
ohair@85 40 <property name="@DROP@.root.dir" value="${drop.dir}/@DROP@"/>
ohair@85 41 <property name="@DROP@.src.dir" value="${@DROP@.root.dir}/src"/>
ohair@85 42
ohair@85 43 <!-- To see if the drop areas are ready. (ignoring bundles) -->
ohair@85 44 <target name="-@DROP@-ready">
ohair@85 45 <condition property="@DROP@.ready">
ohair@91 46 <or>
ohair@91 47 <available file="${drop.included.dir}" type="dir"/>
ohair@91 48 <and>
ohair@91 49 <available file="${@DROP@.root.dir}" type="dir"/>
ohair@91 50 <available file="${@DROP@.root.dir}/PATCHED" type="file"/>
ohair@91 51 </and>
ohair@91 52 </or>
ohair@85 53 </condition>
ohair@85 54 </target>
ohair@85 55
ohair@85 56 <!-- Copy over bundles from some shared master area. -->
ohair@85 57 <condition property="@DROP@.master.bundle.copy.exists">
ohair@85 58 <available file="${@DROP@.master.bundle.copy}" type="file"/>
ohair@85 59 </condition>
ohair@85 60 <target name="-@DROP@-copy-bundle"
ohair@85 61 depends="init, -@DROP@-ready"
ohair@85 62 if="@DROP@.master.bundle.copy.exists"
ohair@85 63 unless="@DROP@.ready">
ohair@85 64 <echo message="Copying from ${@DROP@.master.bundle.copy}"/>
ohair@85 65 <dirname property="@DROP@.bundle.dirname" file="${@DROP@.bundle.copy}"/>
ohair@85 66 <mkdir dir="${@DROP@.bundle.dirname}"/>
ohair@85 67 <delete file="${@DROP@.bundle.copy}.temp"/>
ohair@85 68 <delete file="${@DROP@.bundle.copy}"/>
ohair@85 69 <copy file="${@DROP@.master.bundle.copy}" tofile="${@DROP@.bundle.copy}.temp"/>
ohair@85 70 <move file="${@DROP@.bundle.copy}.temp" tofile="${@DROP@.bundle.copy}"/>
ohair@85 71 <property name="@DROP@.master.bundle.found" value="true"/>
ohair@85 72 </target>
ohair@85 73
ohair@85 74 <!-- Determine if the master url download should be used. -->
ohair@85 75 <target name="-@DROP@-url-should-be-used" unless="@DROP@.url.should.be.used">
ohair@85 76 <condition property="@DROP@.url.should.be.used">
ohair@85 77 <and>
ohair@85 78 <not>
ohair@85 79 <isset property="@DROP@.master.bundle.copy.exists"/>
ohair@85 80 </not>
ohair@85 81 </and>
ohair@85 82 </condition>
ohair@85 83 </target>
ohair@85 84
ohair@85 85 <!-- Download bundles from a url. -->
ohair@85 86 <target name="-@DROP@-url-bundle"
ohair@85 87 depends="init, -@DROP@-ready, -@DROP@-url-should-be-used"
ohair@85 88 if="@DROP@.url.should.be.used"
ohair@85 89 unless="@DROP@.ready">
ohair@85 90 <echo message="Downloading from ${@DROP@.master.bundle.url}"/>
ohair@85 91 <dirname property="@DROP@.bundle.dirname" file="${@DROP@.bundle.copy}"/>
ohair@85 92 <mkdir dir="${@DROP@.bundle.dirname}"/>
ohair@85 93 <delete file="${@DROP@.bundle.copy}.temp"/>
ohair@85 94 <delete file="${@DROP@.bundle.copy}"/>
ohair@85 95 <get src="${@DROP@.master.bundle.url}" dest="${@DROP@.bundle.copy}.temp"/>
ohair@85 96 <move file="${@DROP@.bundle.copy}.temp" tofile="${@DROP@.bundle.copy}"/>
ohair@85 97 <property name="@DROP@.master.bundle.found" value="true"/>
ohair@85 98 </target>
ohair@85 99
ohair@85 100 <!-- Fill in the drop zones, but just when needed. -->
ohair@85 101 <target name="@DROP@-update"
ohair@85 102 depends="init,
ohair@85 103 -@DROP@-copy-bundle,
ohair@85 104 -@DROP@-url-bundle,
ohair@85 105 -@DROP@-ready"
ohair@85 106 if="@DROP@.master.bundle.found"
ohair@85 107 unless="@DROP@.ready">
ohair@85 108 <delete dir="${@DROP@.root.dir}"/>
ohair@85 109 <delete dir="${@DROP@.root.dir}-temp"/>
ohair@85 110 <mkdir dir="${@DROP@.root.dir}-temp"/>
ohair@91 111 <checksum file="${@DROP@.bundle.copy}"
ohair@91 112 property="@DROP@.bundle.md5.checksum.is"/>
ohair@91 113 <condition property="@DROP@.bundle.md5.checksum.good">
ohair@91 114 <equals arg1="${@DROP@.bundle.md5.checksum}"
ohair@91 115 arg2="${@DROP@.bundle.md5.checksum.is}"/>
ohair@91 116 </condition>
ohair@91 117 <fail unless="@DROP@.bundle.md5.checksum.good">
ohair@91 118 Checksum on file ${@DROP@.bundle.copy} is
ohair@91 119 ${@DROP@.bundle.md5.checksum.is}, not ${@DROP@.bundle.md5.checksum}
ohair@91 120 </fail>
ohair@85 121 <unzip src="${@DROP@.bundle.copy}" dest="${@DROP@.root.dir}-temp"/>
ohair@85 122 <move file="${@DROP@.root.dir}-temp" tofile="${@DROP@.root.dir}"/>
ohair@85 123 <touch>
ohair@85 124 <fileset dir="${@DROP@.root.dir}"/>
ohair@85 125 </touch>
ohair@85 126 <condition property="patch.utility" value="gpatch" else="patch">
ohair@85 127 <os name="SunOS"/>
ohair@85 128 </condition>
ohair@85 129 <apply executable="${patch.utility}"
ohair@85 130 dir="${@DROP@.root.dir}"
ohair@85 131 parallel="false"
ohair@85 132 failonerror="true"
ohair@85 133 verbose="true">
ohair@85 134 <arg value="-l"/>
ohair@85 135 <arg value="-p0"/>
ohair@85 136 <arg value="-i"/>
ohair@85 137 <filelist dir="${patches.dir}/@DROP@" files="${@DROP@.patch.list}"/>
ohair@85 138 </apply>
ohair@85 139 <echo file="${@DROP@.root.dir}/PATCHED"
ohair@85 140 message="Patches have been applied."/>
ohair@85 141 </target>
ohair@85 142
ohair@85 143 </project>

mercurial