ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!-- ====================================================================== |
| 3 | Sep 8, 2005 4:18:21 PM |
| 4 | |
| 5 | test |
| 6 | test dependencies |
| 7 | |
| 8 | naci |
| 9 | ====================================================================== --> |
| 10 | <project name="test" default="get"> |
| 11 | <description> |
| 12 | test dependencies |
| 13 | </description> |
| 14 | |
| 15 | <!-- ================================= |
| 16 | target: get |
| 17 | ================================= --> |
| 18 | <property file="@dependencyProperties@" /> |
| 19 | |
| 20 | |
| 21 | <!-- - - - - - - - - - - - - - - - - - |
| 22 | target: init |
| 23 | - - - - - - - - - - - - - - - - - --> |
| 24 | <target name="init"> |
| 25 | <property name="dependency.name" value="${@dependencyGroupId@name}" /> |
| 26 | <property name="dependency.description" value="${@dependencyGroupId@url}" /> |
| 27 | <property name="dependency.url" value="${@dependencyGroupId@url}" /> |
ndai | a04ffd5 | 2005-09-14 16:28:32 +0000 | [diff] [blame] | 28 | <property name="local.cache.dir" value="." /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 29 | |
| 30 | <condition property="dependency.file" value="${@dependencyGroupId@file}"> |
| 31 | <not> |
| 32 | <or> |
| 33 | <isset property="@dependencyGroupId@file.linux-gtk-x86" /> |
ndai | 0c96ca6 | 2006-01-19 16:49:24 +0000 | [diff] [blame] | 34 | <isset property="@dependencyGroupId@file.linux-gtk-ppc" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 35 | <isset property="@dependencyGroupId@file.win32-win32-x86" /> |
ndai | dab24cb | 2006-07-28 15:22:38 +0000 | [diff] [blame^] | 36 | <isset property="@dependencyGroupId@file.macosx-carbon-ppc" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 37 | </or> |
| 38 | </not> |
| 39 | </condition> |
| 40 | <condition property="dependency.file" value="${@dependencyGroupId@file.win32-win32-x86}"> |
| 41 | <and> |
| 42 | <isset property="@dependencyGroupId@file.win32-win32-x86" /> |
| 43 | <equals arg1="win32" arg2="${baseos}" /> |
| 44 | <equals arg1="win32" arg2="${basews}" /> |
| 45 | <equals arg1="x86" arg2="${basearch}" /> |
| 46 | </and> |
| 47 | </condition> |
| 48 | <condition property="dependency.file" value="${@dependencyGroupId@file.linux-gtk-x86}"> |
| 49 | <and> |
| 50 | <isset property="@dependencyGroupId@file.linux-gtk-x86" /> |
| 51 | <equals arg1="linux" arg2="${baseos}" /> |
| 52 | <equals arg1="gtk" arg2="${basews}" /> |
| 53 | <equals arg1="x86" arg2="${basearch}" /> |
| 54 | </and> |
| 55 | </condition> |
ndai | 0c96ca6 | 2006-01-19 16:49:24 +0000 | [diff] [blame] | 56 | <condition property="dependency.file" value="${@dependencyGroupId@file.linux-gtk-ppc}"> |
| 57 | <and> |
| 58 | <isset property="@dependencyGroupId@file.linux-gtk-ppc" /> |
| 59 | <equals arg1="linux" arg2="${baseos}" /> |
| 60 | <equals arg1="gtk" arg2="${basews}" /> |
| 61 | <equals arg1="ppc" arg2="${basearch}" /> |
| 62 | </and> |
| 63 | </condition> |
ndai | dab24cb | 2006-07-28 15:22:38 +0000 | [diff] [blame^] | 64 | <condition property="dependency.file" value="${@dependencyGroupId@file.macosx-carbon-ppc}"> |
| 65 | <and> |
| 66 | <isset property="@dependencyGroupId@file.macosx-carbon-ppc" /> |
| 67 | <equals arg1="macosx" arg2="${baseos}" /> |
| 68 | <equals arg1="carbon" arg2="${basews}" /> |
| 69 | <equals arg1="ppc" arg2="${basearch}" /> |
| 70 | </and> |
| 71 | </condition> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 72 | <condition property="dependency.autodownload" value="${@dependencyGroupId@autodownload}"> |
| 73 | <isset property="@dependencyGroupId@autodownload" /> |
| 74 | </condition> |
| 75 | <condition property="dependency.releng.url" value="${@dependencyGroupId@releng.url}"> |
| 76 | <isset property="@dependencyGroupId@releng.url" /> |
| 77 | </condition> |
| 78 | </target> |
| 79 | |
| 80 | |
| 81 | <target name="get" depends="init"> |
| 82 | |
| 83 | <fail unless="dependency.file" 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." /> |
| 84 | |
| 85 | <echo message="Getting ${dependency.file}" /> |
| 86 | <echo message="Url: ${dependency.url}" /> |
| 87 | |
| 88 | <ant antfile="@dependencyDir@/build.xml" target="default" /> |
| 89 | |
| 90 | </target> |
| 91 | |
| 92 | |
| 93 | <!-- ================================= |
| 94 | target: install |
| 95 | ================================= --> |
| 96 | <target name="install" depends="init"> |
| 97 | <echo message="Installing ${dependency.file}" /> |
| 98 | <echo message="destination: ${install.destination}" /> |
jeffliu | d0eb4a7 | 2005-09-28 14:58:59 +0000 | [diff] [blame] | 99 | <antcall target="cleanInstall"/> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 100 | <property file="${install.destination}/installmanifest.properties" /> |
| 101 | <antcall target="callInstall" /> |
| 102 | <echo message="${install.destination}/installmanifest.properties" /> |
| 103 | <echo file="${install.destination}/installmanifest.properties" append="true"> |
| 104 | @dependencyGroupId@.${dependency.file}.installed=true |
| 105 | </echo> |
| 106 | </target> |
| 107 | |
jeffliu | d0eb4a7 | 2005-09-28 14:58:59 +0000 | [diff] [blame] | 108 | <target name="cleanInstall" if="clean"> |
| 109 | <available file="${install.destination}/installmanifest.properties" property="installmanifest.exists"/> |
| 110 | <antcall target="cleanInstall2"/> |
| 111 | </target> |
| 112 | |
| 113 | <target name="cleanInstall2" if="installmanifest.exists"> |
| 114 | <replace file="${install.destination}/installmanifest.properties" token="@dependencyGroupId@.${dependency.file}.installed=true"/> |
| 115 | </target> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 116 | |
| 117 | <target name="callInstall" unless="@dependencyGroupId@.${dependency.file}.installed"> |
| 118 | <ant antfile="@dependencyDir@/build.xml" target="install" /> |
| 119 | </target> |
| 120 | |
ndai | dab24cb | 2006-07-28 15:22:38 +0000 | [diff] [blame^] | 121 | </project> |