blob: 85499a8db28b9e1db6407116e84e9eea87f9ab65 [file] [log] [blame]
ndaib8cedc82005-09-13 18:00:32 +00001<?xml version="1.0"?>
2<!-- ======================================================================
david_williams1cff0e92006-11-23 00:40:29 +00003 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>
ndaib8cedc82005-09-13 18:00:32 +000014
david_williams403beae2007-12-09 02:10:40 +000015
david_williams42f9b242006-11-27 18:45:14 +000016 <!-- 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_williams403beae2007-12-09 02:10:40 +000021
david_williams42f9b242006-11-27 18:45:14 +000022 <!--
david_williams403beae2007-12-09 02:10:40 +000023 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_williams42f9b242006-11-27 18:45:14 +000028 -->
david_williams403beae2007-12-09 02:10:40 +000029 <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_williams1cff0e92006-11-23 00:40:29 +000039 <!-- =================================
40 target: get
41 ================================= -->
42 <property file="@dependencyProperties@" />
ndaib8cedc82005-09-13 18:00:32 +000043
44
david_williams1cff0e92006-11-23 00:40:29 +000045 <!-- - - - - - - - - - - - - - - - - -
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="." />
ndaib8cedc82005-09-13 18:00:32 +000061
david_williams1cff0e92006-11-23 00:40:29 +000062 <condition
63 property="dependency.file"
64 value="${@dependencyGroupId@file}">
65 <not>
66 <or>
david_williams403beae2007-12-09 02:10:40 +000067 <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_williams1cff0e92006-11-23 00:40:29 +000075 </or>
76 </not>
77 </condition>
78 <condition
79 property="dependency.file"
80 value="${@dependencyGroupId@file.win32-win32-x86}">
81 <and>
david_williams403beae2007-12-09 02:10:40 +000082 <isset
83 property="@dependencyGroupId@file.win32-win32-x86" />
david_williams1cff0e92006-11-23 00:40:29 +000084 <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_williams403beae2007-12-09 02:10:40 +0000131 <isset
132 property="@dependencyGroupId@file.macosx-carbon-ppc" />
david_williams1cff0e92006-11-23 00:40:29 +0000133 <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>
ndaib8cedc82005-09-13 18:00:32 +0000155
156
david_williams1cff0e92006-11-23 00:40:29 +0000157 <target
158 name="get"
159 depends="init">
ndaib8cedc82005-09-13 18:00:32 +0000160
david_williams1cff0e92006-11-23 00:40:29 +0000161 <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." />
ndaib8cedc82005-09-13 18:00:32 +0000164
david_williams403beae2007-12-09 02:10:40 +0000165 <echo
166 level="info"
167 message="Getting ${dependency.file}" />
168 <echo
169 level="info"
170 message="Url: ${dependency.url}" />
ndaib8cedc82005-09-13 18:00:32 +0000171
david_williams1cff0e92006-11-23 00:40:29 +0000172 <ant
173 antfile="@dependencyDir@/build.xml"
174 target="default" />
ndaib8cedc82005-09-13 18:00:32 +0000175
david_williams1cff0e92006-11-23 00:40:29 +0000176 </target>
ndaib8cedc82005-09-13 18:00:32 +0000177
178
david_williams1cff0e92006-11-23 00:40:29 +0000179 <!-- =================================
180 target: install
181 ================================= -->
182 <target
183 name="install"
184 depends="init">
david_williams403beae2007-12-09 02:10:40 +0000185 <echo
186 level="debug"
187 message="Installing ${dependency.file}" />
188 <echo
189 level="debug"
190 message="destination: ${install.destination}" />
david_williams1cff0e92006-11-23 00:40:29 +0000191 <antcall target="cleanInstall" />
david_williams403beae2007-12-09 02:10:40 +0000192 <property
193 file="${install.destination}/installmanifest.properties" />
david_williams1cff0e92006-11-23 00:40:29 +0000194 <antcall target="callInstall" />
david_williams403beae2007-12-09 02:10:40 +0000195 <echo
196 level="debug"
197 message="installmanifest.properties: ${install.destination}/installmanifest.properties" />
david_williams1cff0e92006-11-23 00:40:29 +0000198 <echo
199 file="${install.destination}/installmanifest.properties"
200 append="true">
201 @dependencyGroupId@${dependency.file}.installed=true
david_williams403beae2007-12-09 02:10:40 +0000202
david_williams1cff0e92006-11-23 00:40:29 +0000203 @dependencyGroupId@dir=${local.cache.dir}
204 @dependencyGroupId@file=${dependency.file}
david_williams403beae2007-12-09 02:10:40 +0000205
david_williams1cff0e92006-11-23 00:40:29 +0000206 </echo>
207 </target>
ndaib8cedc82005-09-13 18:00:32 +0000208
david_williams1cff0e92006-11-23 00:40:29 +0000209 <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>
jeffliud0eb4a72005-09-28 14:58:59 +0000217
david_williams1cff0e92006-11-23 00:40:29 +0000218 <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>
ndaib8cedc82005-09-13 18:00:32 +0000225
david_williams1cff0e92006-11-23 00:40:29 +0000226 <target
227 name="callInstall"
228 unless="@dependencyGroupId@${dependency.file}.installed">
229 <ant
230 antfile="@dependencyDir@/build.xml"
231 target="install" />
232 </target>
ndaib8cedc82005-09-13 18:00:32 +0000233
ndaidab24cb2006-07-28 15:22:38 +0000234</project>