Thu, 16 Sep 2010 11:18:41 -0700
Merge
ohair@85 | 1 | <?xml version="1.0"?> |
ohair@85 | 2 | <!-- |
ohair@116 | 3 | Copyright (c) 2009, Oracle and/or its affiliates. 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@116 | 8 | published by the Free Software Foundation. Oracle designates this |
ohair@85 | 9 | particular file as subject to the "Classpath" exception as provided |
ohair@116 | 10 | by Oracle 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@116 | 22 | Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@116 | 23 | or visit www.oracle.com if you need additional information or have any |
ohair@116 | 24 | 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@124 | 78 | <istrue value="${allow.downloads}"/> |
ohair@85 | 79 | <not> |
ohair@85 | 80 | <isset property="@DROP@.master.bundle.copy.exists"/> |
ohair@85 | 81 | </not> |
ohair@85 | 82 | </and> |
ohair@85 | 83 | </condition> |
ohair@85 | 84 | </target> |
ohair@85 | 85 | |
ohair@85 | 86 | <!-- Download bundles from a url. --> |
ohair@85 | 87 | <target name="-@DROP@-url-bundle" |
ohair@85 | 88 | depends="init, -@DROP@-ready, -@DROP@-url-should-be-used" |
ohair@85 | 89 | if="@DROP@.url.should.be.used" |
ohair@85 | 90 | unless="@DROP@.ready"> |
ohair@85 | 91 | <echo message="Downloading from ${@DROP@.master.bundle.url}"/> |
ohair@85 | 92 | <dirname property="@DROP@.bundle.dirname" file="${@DROP@.bundle.copy}"/> |
ohair@85 | 93 | <mkdir dir="${@DROP@.bundle.dirname}"/> |
ohair@85 | 94 | <delete file="${@DROP@.bundle.copy}.temp"/> |
ohair@85 | 95 | <delete file="${@DROP@.bundle.copy}"/> |
ohair@85 | 96 | <get src="${@DROP@.master.bundle.url}" dest="${@DROP@.bundle.copy}.temp"/> |
ohair@85 | 97 | <move file="${@DROP@.bundle.copy}.temp" tofile="${@DROP@.bundle.copy}"/> |
ohair@85 | 98 | <property name="@DROP@.master.bundle.found" value="true"/> |
ohair@85 | 99 | </target> |
ohair@85 | 100 | |
ohair@85 | 101 | <!-- Fill in the drop zones, but just when needed. --> |
ohair@85 | 102 | <target name="@DROP@-update" |
ohair@85 | 103 | depends="init, |
ohair@85 | 104 | -@DROP@-copy-bundle, |
ohair@85 | 105 | -@DROP@-url-bundle, |
ohair@85 | 106 | -@DROP@-ready" |
ohair@85 | 107 | if="@DROP@.master.bundle.found" |
ohair@85 | 108 | unless="@DROP@.ready"> |
ohair@85 | 109 | <delete dir="${@DROP@.root.dir}"/> |
ohair@85 | 110 | <delete dir="${@DROP@.root.dir}-temp"/> |
ohair@85 | 111 | <mkdir dir="${@DROP@.root.dir}-temp"/> |
ohair@91 | 112 | <checksum file="${@DROP@.bundle.copy}" |
ohair@91 | 113 | property="@DROP@.bundle.md5.checksum.is"/> |
ohair@91 | 114 | <condition property="@DROP@.bundle.md5.checksum.good"> |
ohair@91 | 115 | <equals arg1="${@DROP@.bundle.md5.checksum}" |
ohair@91 | 116 | arg2="${@DROP@.bundle.md5.checksum.is}"/> |
ohair@91 | 117 | </condition> |
ohair@91 | 118 | <fail unless="@DROP@.bundle.md5.checksum.good"> |
ohair@91 | 119 | Checksum on file ${@DROP@.bundle.copy} is |
ohair@91 | 120 | ${@DROP@.bundle.md5.checksum.is}, not ${@DROP@.bundle.md5.checksum} |
ohair@91 | 121 | </fail> |
ohair@85 | 122 | <unzip src="${@DROP@.bundle.copy}" dest="${@DROP@.root.dir}-temp"/> |
ohair@85 | 123 | <move file="${@DROP@.root.dir}-temp" tofile="${@DROP@.root.dir}"/> |
ohair@85 | 124 | <touch> |
ohair@85 | 125 | <fileset dir="${@DROP@.root.dir}"/> |
ohair@85 | 126 | </touch> |
ohair@85 | 127 | <condition property="patch.utility" value="gpatch" else="patch"> |
ohair@85 | 128 | <os name="SunOS"/> |
ohair@85 | 129 | </condition> |
ohair@85 | 130 | <apply executable="${patch.utility}" |
ohair@85 | 131 | dir="${@DROP@.root.dir}" |
ohair@85 | 132 | parallel="false" |
ohair@85 | 133 | failonerror="true" |
ohair@85 | 134 | verbose="true"> |
ohair@85 | 135 | <arg value="-l"/> |
ohair@85 | 136 | <arg value="-p0"/> |
ohair@85 | 137 | <arg value="-i"/> |
ohair@85 | 138 | <filelist dir="${patches.dir}/@DROP@" files="${@DROP@.patch.list}"/> |
ohair@85 | 139 | </apply> |
ohair@85 | 140 | <echo file="${@DROP@.root.dir}/PATCHED" |
ohair@85 | 141 | message="Patches have been applied."/> |
ohair@85 | 142 | </target> |
ohair@85 | 143 | |
ohair@85 | 144 | </project> |