ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!-- ====================================================================== |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 3 | Sep 8, 2005 4:18:21 PM |
| 4 | |
| 5 | test |
| 6 | test dependencies |
| 7 | |
| 8 | naci |
| 9 | ====================================================================== --> |
| 10 | <project |
| 11 | name="test" |
| 12 | default="get"> |
| 13 | <description>test dependencies</description> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 14 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 15 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 16 | <!-- Note to be cross-platform, "environment variables" are only appropriate for |
| 17 | some variables, e.g. ones we set, since properties are case sensitive, even if |
| 18 | the environment variables on your operating system are not, e.g. it will |
| 19 | be ${env.Path} not ${env.PATH} on Windows --> |
| 20 | <property environment="env" /> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 21 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 22 | <!-- |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 23 | Note: if baseos, basews, and basearch are "passed in" to this |
| 24 | file, then they take priority, and retain their value. Otherwise, |
| 25 | use the current environment. Normally, the current environment is |
| 26 | desired, but sometimes, such as for creating the "all in ones", it may |
| 27 | be desired to "get" packages for other combinations. |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 28 | --> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 29 | <property |
| 30 | name="baseos" |
| 31 | value="${env.BASEOS}" /> |
| 32 | <property |
| 33 | name="basews" |
| 34 | value="${env.BASEWS}" /> |
| 35 | <property |
| 36 | name="basearch" |
| 37 | value="${env.BASEARCH}" /> |
| 38 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 39 | <!-- ================================= |
| 40 | target: get |
| 41 | ================================= --> |
| 42 | <property file="@dependencyProperties@" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 43 | |
| 44 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 45 | <!-- - - - - - - - - - - - - - - - - - |
| 46 | target: init |
| 47 | - - - - - - - - - - - - - - - - - --> |
| 48 | <target name="init"> |
| 49 | <property |
| 50 | name="dependency.name" |
| 51 | value="${@dependencyGroupId@name}" /> |
| 52 | <property |
| 53 | name="dependency.description" |
| 54 | value="${@dependencyGroupId@url}" /> |
| 55 | <property |
| 56 | name="dependency.url" |
| 57 | value="${@dependencyGroupId@url}" /> |
| 58 | <property |
| 59 | name="local.cache.dir" |
| 60 | value="." /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 61 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 62 | <condition |
| 63 | property="dependency.file" |
| 64 | value="${@dependencyGroupId@file}"> |
| 65 | <not> |
| 66 | <or> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 67 | <isset |
| 68 | property="@dependencyGroupId@file.linux-gtk-x86" /> |
| 69 | <isset |
| 70 | property="@dependencyGroupId@file.linux-gtk-ppc" /> |
| 71 | <isset |
| 72 | property="@dependencyGroupId@file.win32-win32-x86" /> |
| 73 | <isset |
| 74 | property="@dependencyGroupId@file.macosx-carbon-ppc" /> |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 75 | </or> |
| 76 | </not> |
| 77 | </condition> |
| 78 | <condition |
| 79 | property="dependency.file" |
| 80 | value="${@dependencyGroupId@file.win32-win32-x86}"> |
| 81 | <and> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 82 | <isset |
| 83 | property="@dependencyGroupId@file.win32-win32-x86" /> |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 84 | <equals |
| 85 | arg1="win32" |
| 86 | arg2="${baseos}" /> |
| 87 | <equals |
| 88 | arg1="win32" |
| 89 | arg2="${basews}" /> |
| 90 | <equals |
| 91 | arg1="x86" |
| 92 | arg2="${basearch}" /> |
| 93 | </and> |
| 94 | </condition> |
| 95 | <condition |
| 96 | property="dependency.file" |
| 97 | value="${@dependencyGroupId@file.linux-gtk-x86}"> |
| 98 | <and> |
| 99 | <isset property="@dependencyGroupId@file.linux-gtk-x86" /> |
| 100 | <equals |
| 101 | arg1="linux" |
| 102 | arg2="${baseos}" /> |
| 103 | <equals |
| 104 | arg1="gtk" |
| 105 | arg2="${basews}" /> |
| 106 | <equals |
| 107 | arg1="x86" |
| 108 | arg2="${basearch}" /> |
| 109 | </and> |
| 110 | </condition> |
| 111 | <condition |
| 112 | property="dependency.file" |
| 113 | value="${@dependencyGroupId@file.linux-gtk-ppc}"> |
| 114 | <and> |
| 115 | <isset property="@dependencyGroupId@file.linux-gtk-ppc" /> |
| 116 | <equals |
| 117 | arg1="linux" |
| 118 | arg2="${baseos}" /> |
| 119 | <equals |
| 120 | arg1="gtk" |
| 121 | arg2="${basews}" /> |
| 122 | <equals |
| 123 | arg1="ppc" |
| 124 | arg2="${basearch}" /> |
| 125 | </and> |
| 126 | </condition> |
| 127 | <condition |
| 128 | property="dependency.file" |
| 129 | value="${@dependencyGroupId@file.macosx-carbon-ppc}"> |
| 130 | <and> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 131 | <isset |
| 132 | property="@dependencyGroupId@file.macosx-carbon-ppc" /> |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 133 | <equals |
| 134 | arg1="macosx" |
| 135 | arg2="${baseos}" /> |
| 136 | <equals |
| 137 | arg1="carbon" |
| 138 | arg2="${basews}" /> |
| 139 | <equals |
| 140 | arg1="ppc" |
| 141 | arg2="${basearch}" /> |
| 142 | </and> |
| 143 | </condition> |
| 144 | <condition |
| 145 | property="dependency.autodownload" |
| 146 | value="${@dependencyGroupId@autodownload}"> |
| 147 | <isset property="@dependencyGroupId@autodownload" /> |
| 148 | </condition> |
| 149 | <condition |
| 150 | property="dependency.releng.url" |
| 151 | value="${@dependencyGroupId@releng.url}"> |
| 152 | <isset property="@dependencyGroupId@releng.url" /> |
| 153 | </condition> |
| 154 | </target> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 155 | |
| 156 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 157 | <target |
| 158 | name="get" |
| 159 | depends="init"> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 160 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 161 | <fail |
| 162 | unless="dependency.file" |
| 163 | message="The dependent file ${dependency.name} is not a supported os-ws-arch. Did you set baseos, basews,baesarch and make use your dependency.file property matches it." /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 164 | |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 165 | <echo |
| 166 | level="info" |
| 167 | message="Getting ${dependency.file}" /> |
| 168 | <echo |
| 169 | level="info" |
| 170 | message="Url: ${dependency.url}" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 171 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 172 | <ant |
| 173 | antfile="@dependencyDir@/build.xml" |
| 174 | target="default" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 175 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 176 | </target> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 177 | |
| 178 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 179 | <!-- ================================= |
| 180 | target: install |
| 181 | ================================= --> |
| 182 | <target |
| 183 | name="install" |
| 184 | depends="init"> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 185 | <echo |
| 186 | level="debug" |
| 187 | message="Installing ${dependency.file}" /> |
| 188 | <echo |
| 189 | level="debug" |
| 190 | message="destination: ${install.destination}" /> |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 191 | <antcall target="cleanInstall" /> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 192 | <property |
| 193 | file="${install.destination}/installmanifest.properties" /> |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 194 | <antcall target="callInstall" /> |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 195 | <echo |
| 196 | level="debug" |
| 197 | message="installmanifest.properties: ${install.destination}/installmanifest.properties" /> |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 198 | <echo |
| 199 | file="${install.destination}/installmanifest.properties" |
| 200 | append="true"> |
| 201 | @dependencyGroupId@${dependency.file}.installed=true |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 202 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 203 | @dependencyGroupId@dir=${local.cache.dir} |
| 204 | @dependencyGroupId@file=${dependency.file} |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 205 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 206 | </echo> |
| 207 | </target> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 208 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 209 | <target |
| 210 | name="cleanInstall" |
| 211 | if="clean"> |
| 212 | <available |
| 213 | file="${install.destination}/installmanifest.properties" |
| 214 | property="installmanifest.exists" /> |
| 215 | <antcall target="cleanInstall2" /> |
| 216 | </target> |
jeffliu | d0eb4a7 | 2005-09-28 14:58:59 +0000 | [diff] [blame] | 217 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 218 | <target |
| 219 | name="cleanInstall2" |
| 220 | if="installmanifest.exists"> |
| 221 | <replace |
| 222 | file="${install.destination}/installmanifest.properties" |
| 223 | token="@dependencyGroupId@${dependency.file}.installed=true" /> |
| 224 | </target> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 225 | |
david_williams | 1cff0e9 | 2006-11-23 00:40:29 +0000 | [diff] [blame] | 226 | <target |
| 227 | name="callInstall" |
| 228 | unless="@dependencyGroupId@${dependency.file}.installed"> |
| 229 | <ant |
| 230 | antfile="@dependencyDir@/build.xml" |
| 231 | target="install" /> |
| 232 | </target> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 233 | |
ndai | dab24cb | 2006-07-28 15:22:38 +0000 | [diff] [blame] | 234 | </project> |