| <?xml version="1.0"?> |
| <!-- ====================================================================== |
| Sep 8, 2005 4:18:21 PM |
| |
| test |
| test dependencies |
| |
| naci |
| ====================================================================== --> |
| <project |
| name="test" |
| default="get"> |
| <description>test dependencies</description> |
| |
| |
| <!-- Note to be cross-platform, "environment variables" are only appropriate for |
| some variables, e.g. ones we set, since properties are case sensitive, even if |
| the environment variables on your operating system are not, e.g. it will |
| be ${env.Path} not ${env.PATH} on Windows --> |
| <property |
| environment="env"/> |
| |
| <!-- |
| Note: if baseos, basews, and basearch are "passed in" to this |
| file, then they take priority, and retain their value. Otherwise, |
| use the current environment. Normally, the current environment is |
| desired, but sometimes, such as for creating the "all in ones", it may |
| be desired to "get" packages for other combinations. |
| --> |
| <property |
| name="baseos" |
| value="${env.BASEOS}"/> |
| <property |
| name="basews" |
| value="${env.BASEWS}"/> |
| <property |
| name="basearch" |
| value="${env.BASEARCH}"/> |
| |
| <!-- ================================= |
| target: get |
| ================================= --> |
| <property |
| file="@dependencyProperties@"/> |
| |
| |
| <!-- - - - - - - - - - - - - - - - - - |
| target: init |
| - - - - - - - - - - - - - - - - - --> |
| <target |
| name="init"> |
| <property |
| name="dependency.name" |
| value="${@dependencyGroupId@name}"/> |
| <property |
| name="dependency.description" |
| value="${@dependencyGroupId@descriptions}"/> |
| <property |
| name="dependency.url" |
| value="${@dependencyGroupId@url}"/> |
| |
| <property |
| name="dependency.tobeinstalledfeaturegroups" |
| value="${@dependencyGroupId@tobeinstalledfeaturegroups}"/> |
| |
| <property |
| name="local.cache.dir" |
| value="."/> |
| |
| <condition |
| property="dependency.file" |
| value="${@dependencyGroupId@file}"> |
| <not> |
| <or> |
| <isset |
| property="@dependencyGroupId@file.linux-gtk-x86"/> |
| <isset |
| property="@dependencyGroupId@file.linux-gtk-ppc"/> |
| <isset |
| property="@dependencyGroupId@file.win32-win32-x86"/> |
| <isset |
| property="@dependencyGroupId@file.macosx-carbon-ppc"/> |
| </or> |
| </not> |
| </condition> |
| <condition |
| property="dependency.file" |
| value="${@dependencyGroupId@file.win32-win32-x86}"> |
| <and> |
| <isset |
| property="@dependencyGroupId@file.win32-win32-x86"/> |
| <equals |
| arg1="win32" |
| arg2="${baseos}"/> |
| <equals |
| arg1="win32" |
| arg2="${basews}"/> |
| <equals |
| arg1="x86" |
| arg2="${basearch}"/> |
| </and> |
| </condition> |
| <condition |
| property="dependency.file" |
| value="${@dependencyGroupId@file.linux-gtk-x86}"> |
| <and> |
| <isset |
| property="@dependencyGroupId@file.linux-gtk-x86"/> |
| <equals |
| arg1="linux" |
| arg2="${baseos}"/> |
| <equals |
| arg1="gtk" |
| arg2="${basews}"/> |
| <equals |
| arg1="x86" |
| arg2="${basearch}"/> |
| </and> |
| </condition> |
| <condition |
| property="dependency.file" |
| value="${@dependencyGroupId@file.linux-gtk-ppc}"> |
| <and> |
| <isset |
| property="@dependencyGroupId@file.linux-gtk-ppc"/> |
| <equals |
| arg1="linux" |
| arg2="${baseos}"/> |
| <equals |
| arg1="gtk" |
| arg2="${basews}"/> |
| <equals |
| arg1="ppc" |
| arg2="${basearch}"/> |
| </and> |
| </condition> |
| <condition |
| property="dependency.file" |
| value="${@dependencyGroupId@file.macosx-carbon-ppc}"> |
| <and> |
| <isset |
| property="@dependencyGroupId@file.macosx-carbon-ppc"/> |
| <equals |
| arg1="macosx" |
| arg2="${baseos}"/> |
| <equals |
| arg1="carbon" |
| arg2="${basews}"/> |
| <equals |
| arg1="ppc" |
| arg2="${basearch}"/> |
| </and> |
| </condition> |
| <condition |
| property="dependency.autodownload" |
| value="${@dependencyGroupId@autodownload}"> |
| <isset |
| property="@dependencyGroupId@autodownload"/> |
| </condition> |
| <condition |
| property="dependency.releng.url" |
| value="${@dependencyGroupId@releng.url}"> |
| <isset |
| property="@dependencyGroupId@releng.url"/> |
| </condition> |
| </target> |
| |
| |
| <target |
| name="get" |
| depends="init"> |
| |
| <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."/> |
| |
| <echo |
| level="info" |
| message="Getting ${dependency.file}"/> |
| <echo |
| level="info" |
| message="Url: ${dependency.url}"/> |
| |
| <ant |
| antfile="@dependencyDir@/build.xml" |
| target="default"/> |
| |
| </target> |
| |
| |
| <!-- ================================= |
| target: install |
| ================================= --> |
| <target |
| name="install" |
| depends="init"> |
| <echo |
| level="info" |
| message="Installing ${dependency.file}"/> |
| <echo |
| level="info" |
| message="destination: ${install.destination}"/> |
| <antcall |
| target="cleanInstall"/> |
| <property |
| file="${install.destination}/installmanifest.properties"/> |
| <antcall |
| target="callInstall"/> |
| <echo |
| level="info" |
| message="installmanifest.properties: ${install.destination}/installmanifest.properties"/> |
| <echo |
| file="${install.destination}/installmanifest.properties" |
| append="true"> |
| @dependencyGroupId@${dependency.file}.installed=true |
| |
| @dependencyGroupId@dir=${local.cache.dir} |
| @dependencyGroupId@file=${dependency.file} |
| |
| </echo> |
| </target> |
| |
| <target |
| name="installRepo" |
| depends="init"> |
| <echo |
| level="info" |
| message="Installing ${dependency.file}"/> |
| <echo |
| level="info" |
| message="destination: ${install.destination}"/> |
| <antcall |
| target="cleanInstall"/> |
| <property |
| file="${install.destination}/installmanifest.properties"/> |
| <!-- |
| We first unzip the repo, then use p2 directory app to install into the eclispe used |
| for testing. |
| --> |
| <!-- |
| We use the exec method for unzip, so we won't fail if a |
| prereq can not be unzipped for some reason. See |
| https://bugs.eclipse.org/bugs/show_bug.cgi?id=283968 |
| --> |
| <echo |
| message="install repo for groupId: ${groupId}"/> |
| <property |
| name="tobeinstalledrepo" |
| value="${testRoot}/repos/${groupId}"/> |
| <echo |
| message="tobeinstalledrepo: ${tobeinstalledrepo}"/> |
| <echo |
| message="tobeInstalledfeaturegroups: ${dependency.tobeinstalledfeaturegroups}"/> |
| <mkdir |
| dir="${testRoot}/repos/${groupId}"/> |
| <exec |
| dir="." |
| executable="unzip"> |
| <arg |
| line="-o -qq ${local.cache.dir}/${dependency.file} -d ${tobeinstalledrepo}"/> |
| </exec> |
| <!-- |
| <unzip |
| dest="${install.destination}" |
| src="${local.cache.dir}/${dependency.file}" |
| overwrite="true" /> |
| --> |
| |
| <java |
| taskname="p2Director Install" |
| fork="true" |
| resultProperty="p2DirectorInstallResult" |
| failonerror="true" |
| timeout="1800000" |
| dir="${testRoot}" |
| jvm="${env.JAVA_6_HOME}/bin/java" |
| classname="org.eclipse.equinox.launcher.Main"> |
| <classpath> |
| <fileset |
| dir="${testRoot}/eclipse/plugins"> |
| <include |
| name="org.eclipse.equinox.launcher_*.jar"/> |
| </fileset> |
| </classpath> |
| <jvmarg |
| value="-Djava.io.tmpdir=${env.RECOMMENDED_TMP_DIR}"/> |
| <arg |
| value="-nosplash"/> |
| <arg |
| value="-debug"/> |
| <arg |
| value="-consolelog"/> |
| <arg |
| value="-data"/> |
| <arg |
| value="${testRoot}/p2DirectorInstall"/> |
| <arg |
| value="-application"/> |
| <arg |
| value="org.eclipse.equinox.p2.director"/> |
| <arg |
| value="-destination"/> |
| <arg |
| value="${testRoot}/eclipse"/> |
| <arg |
| value="-profile"/> |
| <arg |
| value="SDKProfile"/> |
| <arg |
| value="-repository"/> |
| <arg |
| value="file:/${tobeinstalledrepo}"/> |
| |
| |
| <arg |
| value="-installIU"/> |
| <arg |
| value="${dependency.tobeinstalledfeaturegroups}"/> |
| |
| |
| |
| <!-- make sure our forked env has a DISPLAY --> |
| <env |
| key="DISPLAY" |
| value="${env.DISPLAY}"/> |
| <redirector |
| output="${testRoot}/results/fullOutput.txt" |
| error="${testRoot}/results/fullErrorLog.txt"/> |
| <arg |
| value="-vmArgs"/> |
| <arg |
| value="-Declipse.p2.data.area=${testRoot}/eclipse/p2"/> |
| </java> |
| <echo |
| message="p2DirectorInstallResult: ${p2DirectorInstallResult}"/> |
| |
| |
| |
| |
| |
| </target> |
| |
| |
| <target |
| name="cleanInstall" |
| if="clean"> |
| <available |
| file="${install.destination}/installmanifest.properties" |
| property="installmanifest.exists"/> |
| <antcall |
| target="cleanInstall2"/> |
| </target> |
| |
| <target |
| name="cleanInstall2" |
| if="installmanifest.exists"> |
| <replace |
| file="${install.destination}/installmanifest.properties" |
| token="@dependencyGroupId@${dependency.file}.installed=true"/> |
| </target> |
| |
| <target |
| name="callInstall" |
| unless="@dependencyGroupId@${dependency.file}.installed"> |
| <ant |
| antfile="@dependencyDir@/build.xml" |
| target="install"/> |
| </target> |
| |
| </project> |