1 <project name="Shared build targets">
\r
2 <!-- the following properties must be set from the calling script
\r
3 <property name="eclipse.installation.dir" value="${buildDirectory}"/>
\r
4 <property name="eclipse.local.tar.non.server" value="${test.eclipse.host}"/>
\r
5 eclipse.download.cache,pluginbuilder.eclipse.url
\r
7 <property name="pluginbuilder.additional.feature.urls" value="featureurl1,featureurl2"/>
\r
10 <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${buildHome}/build-files/ant-contrib.jar" />
\r
12 <target name="unpack.eclipse">
\r
13 <condition property="unpack.eclipse">
\r
15 <available type="dir" file="${eclipse.installation.dir}"/>
\r
18 <antcall target="-unpack.eclipse.ifnecessary"/>
\r
21 <!-- call either with or feature.url or pluginbuilder.eclipse.url
\r
22 sets property archive.location to the archive path in download cache.
\r
24 <target name="-set.archive.location" if="pluginbuilder.is.server">
\r
25 <condition property="archive.url" value="${feature.url}" else="${pluginbuilder.eclipse.url}">
\r
26 <isset property="feature.url"/>
\r
28 <mkdir dir="${eclipse.download.cache}"/>
\r
29 <tempfile destdir="${eclipse.download.cache}" property="tmp.file" suffix=".txt" prefix="downloadurl"/>
\r
30 <echo file="${tmp.file}" message="${archive.url}"/>
\r
31 <checksum file="${tmp.file}" property="pluginbuilder.eclipse.url.checksum"/>
\r
32 <delete file="${tmp.file}"/>
\r
33 <property name="archive.location" value="${eclipse.download.cache}/${pluginbuilder.eclipse.url.checksum}"/>
\r
34 <!-- <echo message="${archive.location} is archive location for ${archive.url}"/> -->
\r
37 <target name="-set.eclipse.local.tar.server" if="pluginbuilder.is.server" depends="-set.archive.location">
\r
38 <property name="eclipse.local.tar" value="${archive.location}"/>
\r
41 <target name="-set.eclipse.local.tar.non.server" unless="pluginbuilder.is.server">
\r
42 <property name="eclipse.local.tar" value="${eclipse.local.tar.non.server}"/>
\r
45 <target name="-get.archive.ifnecessary" unless="eclipse.is.downloaded">
\r
46 <condition property="archive.url" value="${feature.url}" else="${pluginbuilder.eclipse.url}">
\r
47 <isset property="feature.url"/>
\r
49 <get src="${archive.url}" dest="${archive.location}" />
\r
52 <target name="-get.archive" depends="-set.archive.location" if="pluginbuilder.is.server">
\r
53 <condition property="eclipse.is.downloaded">
\r
54 <available file="${archive.location}" property="${eclipse.is.downloaded}"/>
\r
56 <antcall target="-get.archive.ifnecessary"/>
\r
59 <target name="-get.features" if="pluginbuilder.is.server" >
\r
60 <property name="pluginbuilder.feature.urls" value=""/>
\r
61 <foreach list="${pluginbuilder.feature.urls}" param="feature.url" delimiter="," target="-get.archive" inheritall="true"/>
\r
64 <target name="-unpack.features" if="pluginbuilder.is.server">
\r
65 <property name="pluginbuilder.feature.urls" value=""/>
\r
66 <foreach list="${pluginbuilder.feature.urls}" param="feature.url" delimiter="," target="-unpack.feature" inheritall="true"/>
\r
69 <target name="-unpack.feature" depends="-set.archive.location">
\r
70 <property name="tempunziplocation" value="${buildDirectory}/tmpunzip"/>
\r
71 <delete dir="${tempunziplocation}" failonerror="false"/>
\r
72 <mkdir dir="${tempunziplocation}"/>
\r
73 <unzip src="${archive.location}" overwrite="true" dest="${tempunziplocation}"/>
\r
74 <condition property="moveroot" value="${tempunziplocation}/eclipse" else="${tempunziplocation}">
\r
75 <available file="${tempunziplocation}/eclipse" type="dir"/>
\r
77 <move todir="${eclipse.installation.dir}" includeemptydirs="true">
\r
78 <fileset dir="${moveroot}" includes="**"/>
\r
82 <target name="-unpack.eclipse.ifnecessary" if="unpack.eclipse">
\r
83 <antcall target="-get.archive"/>
\r
84 <condition property="is.windows">
\r
85 <os family="windows"/>
\r
87 <antcall target="-unpack.eclipse.windows"/>
\r
88 <antcall target="-unpack.eclipse.linux"/>
\r
89 <antcall target="-get.features"/>
\r
90 <antcall target="-unpack.features"/>
\r
93 <target name="-unpack.eclipse.windows" if="is.windows" depends="-set.eclipse.local.tar.server,-set.eclipse.local.tar.non.server">
\r
94 <unzip src="${eclipse.local.tar}" overwrite="true" dest="${eclipse.installation.dir}/.."/>
\r
97 <target name="-unpack.eclipse.linux" unless="is.windows" depends="-set.eclipse.local.tar.server,-set.eclipse.local.tar.non.server">
\r
98 <untar src="${eclipse.local.tar}" overwrite="true" dest="${eclipse.installation.dir}/.." compression="gzip"/>
\r
101 <target name="test">
\r
102 <property name="buildDirectory" value="C:/Temp/tst"/>
\r
103 <mkdir dir="${buildDirectory}"/>
\r
104 <property name="eclipse.download.cache" value="C:/Temp/downloadcache"/>
\r
105 <property name="pluginbuilder.is.server" value="true"/>
\r
106 <property name="pluginbuilder.eclipse.url" value="http://mirror.yoxos-eclipse-distribution.de/eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-PDE-3.2.2.zip"/>
\r
108 <property name="eclipse.installation.dir" value="C:/Temp/eclipse_root/eclipse"/>
\r
109 <delete dir="${eclipse.installation.dir}" failonerror="false"/>
\r
110 <property name="pluginbuilder.feature.urls" value="http://self.pluginbuilder.org/0.2.0/org.pluginbuilder.feature-0.2.0.20070218PRD.zip,http://mirror.yoxos-eclipse-distribution.de/eclipse.org/eclipse/downloads/drops/R-3.2.2-200702121330/eclipse-examples-3.2.2.zip"/>
\r
111 <antcall target="unpack.eclipse"/>
\r