blob: 91e5ffb1a188b448e061f9512430510663022815 [file] [log] [blame]
jlanutieb351ff2007-04-03 13:33:59 +00001<project default="main" basedir=".">
2
3 <!--
4 Required inputs:
5
6 build.home
7 buildType
8 buildId
9 timestamp
10 env.BASEOS
11 env.BASEWS
12 env.BASEARCH
13 build.stream [optional]
14 build.committers [optional]
15 wtp.dir [optional]
16 -->
17
18 <!-- Note to be cross-platform, "environment variables" are only appropriate for
19 some variables, e.g. ones we set, since properties are case sensitive, even if
20 the environment variables on your operating system are not, e.g. it will
21 be ${env.Path} not ${env.PATH} on Windows -->
22 <property environment="env" />
23
24 <target name="main">
25 <property file="${build.home}/releng.wtpbuilder/build.properties"/>
26 <property name="apiRoot" value="${build.home}/adopterScanRoot"/>
27 <delete dir="${apiRoot}" failonerror="false"/>
28 <mkdir dir="${apiRoot}"/>
29 <antcall target="getReleng"/>
30 <property file="${apiRoot}/releng/maps/dependencies.properties"/>
31 <property name="local.cache.dir" value="${env.LOCAL_PREREQS_CACHE}"/>
32 <property name="wtp.dir" value="${local.cache.dir}"/>
33 <property name="install.destination" value="${apiRoot}"/>
34 <antcall target="getDependencies"/>
35 <condition property="wtp-sdk" value="wtp-sdk-${buildId}.zip" else="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip">
36 <available file="${wtp.dir}/wtp-sdk-${buildId}.zip"/>
37 </condition>
jlanutieb351ff2007-04-03 13:33:59 +000038 <antcall target="run"/>
39 <antcall target="upload"/>
jlanuti22cd7572007-04-10 20:52:52 +000040 <antcall target="clean"/>
jlanutieb351ff2007-04-03 13:33:59 +000041 </target>
42
43 <target name="getReleng">
44 <property name="releng.tag" value="v${buildType}${timestamp}"/>
45 <cvs
46 cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
47 package="releng"
48 dest="${apiRoot}"
49 command="export"
50 tag="${releng.tag}"
51 />
52 </target>
53
54 <target name="getDependencies">
55 <condition property="isLinux">
56 <equals arg1="${baseos}" arg2="linux"/>
57 </condition>
58 <antcall target="getAndInstall">
59 <param name="groupId" value="eclipse" />
60 </antcall>
61 <antcall target="getAndInstall">
62 <param name="groupId" value="emf" />
63 </antcall>
64 <antcall target="getAndInstall">
65 <param name="groupId" value="gef" />
66 </antcall>
67 <antcall target="getAndInstall">
68 <param name="groupId" value="dtp" />
69 </antcall>
70 <!-- this appears to be pretty explict hard coding for windows machines.
71 I wonder why the usual "get dependencies" methods would not work?
72 -->
73 <antcall target="get">
74 <param name="groupId" value="eclipse" />
75 <param name="baseos" value="win32" />
76 <param name="basews" value="win32" />
77 <param name="basearch" value="x86" />
78 </antcall>
79 <antcall target="getAndInstallWTP">
80 <param name="file" value="wtp-sdk-${buildId}.zip" />
81 </antcall>
82 <antcall target="getAndInstallWTP">
83 <param name="file" value="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip" />
84 </antcall>
85 <delete file="${local.cache.dir}/wtp-apiscanner.zip"/>
86 <get src="http://download.eclipse.org/webtools/downloads/wtp-apiscanner.zip" dest="${local.cache.dir}/wtp-apiscanner.zip"/>
87 <unzip src="${local.cache.dir}/wtp-apiscanner.zip" dest="${apiRoot}"/>
jlanuti334be1a2007-04-10 19:22:28 +000088
89 <!-- get path to equinox jar inside ${eclipse.home} folder (copy/rename actual jar) -->
jlanuti18df9502007-04-10 19:28:06 +000090 <copy failonerror="false" tofile="${apiRoot}/eclipse/startup.jar">
jlanuti334be1a2007-04-10 19:22:28 +000091 <fileset dir="${apiRoot}/eclipse/plugins"
92 includes="**/org.eclipse.equinox.launcher_*.jar" />
93 </copy>
jlanutieb351ff2007-04-03 13:33:59 +000094 </target>
95
96 <target name="getAndInstall">
97 <property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/>
98 <ant antfile="${dependencyTargets}" target="checkDependency">
99 <property name="groupId" value="${groupId}" />
100 </ant>
101 <ant antfile="${dependencyTargets}" target="installDependency">
102 <property name="groupId" value="${groupId}" />
103 </ant>
104 </target>
105
106 <target name="get">
107 <property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/>
108 <ant antfile="${dependencyTargets}" target="checkDependency">
109 <property name="groupId" value="${groupId}" />
110 </ant>
111 </target>
112
113 <target name="getAndInstallWTP">
114 <available file="${wtp.dir}/${file}" property="file.exists"/>
115 <antcall target="getWTP"/>
116 <available file="${wtp.dir}/${file}" property="file.exists"/>
117 <antcall target="installWTP"/>
118 </target>
119
120 <target name="getWTP">
121 <condition property="file.url.1" value="http://download.eclipse.org/webtools/committers" else="http://download.eclipse.org/webtools/downloads">
122 <isset property="build.committers"/>
123 </condition>
124 <condition property="file.url" value="${file.url.1}/drops/${build.stream}/${buildType}-${buildId}-${timestamp}" else="${file.url.1}/drops/${buildType}-${buildId}-${timestamp}">
125 <isset property="build.stream"/>
126 </condition>
127 <antcall target="getWTP2"/>
128 </target>
129
130 <target name="getWTP2" unless="file.exists">
131 <property name="file.url" value="http://download.eclipse.org/webtools/downloads/drops/${build.stream}/${buildType}-${buildId}-${timestamp}"/>
132 <mkdir dir="${wtp.dir}"/>
133 <get dest="${wtp.dir}/${file}" src="${file.url}/${file}" ignoreerrors="true"/>
134 </target>
135
136 <target name="installWTP" if="file.exists">
137 <unzip src="${wtp.dir}/${file}" dest="${install.destination}" overwrite="true"/>
138 </target>
139
140 <target name="run">
141 <cvs
142 cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools"
jlanutiac43c072007-04-18 19:58:40 +0000143 package="releng.wtptools/api/adopter_usages"
jlanutieb351ff2007-04-03 13:33:59 +0000144 dest="${apiRoot}"
145 command="export"
146 tag="HEAD"
147 />
148 <mkdir dir="${apiRoot}/adopters"/>
jlanutieb351ff2007-04-03 13:33:59 +0000149 <antcall target="runEclipseApp">
150 <param name="application" value="org.eclipse.wtp.releng.tools.component.core.APIRefCompatibilityScanner"/>
jlanuti9471a9c2007-05-15 18:56:52 +0000151 <param name="vmargs" value="-Dsrc=${local.cache.dir}/${wtp-sdk},${local.cache.dir}/${eclipse.file.win32-win32-x86},${local.cache.dir}/${emf.file},${local.cache.dir}/${gef.file},${local.cache.dir}/${dtp.file} -Duse=${apiRoot}/releng.wtptools/api/adopter_usages -DoutputDir=${apiRoot}/adopters -Xmx512M"/>
jlanutieb351ff2007-04-03 13:33:59 +0000152 </antcall>
jlanuti999eeaa2007-04-09 17:36:05 +0000153 <copy tofile="${apiRoot}/apiresults/api-ref-compatibility.html" file="${apiRoot}/adopters/api-ref-compatibility.html"/>
154 <copy tofile="${apiRoot}/apiresults/api-ref-compatibility.xml" file="${apiRoot}/adopters/api-ref-compatibility.xml"/>
jlanutieb351ff2007-04-03 13:33:59 +0000155 </target>
156
157 <target name="runEclipseApp">
158 <property name="vmargs" value=""/>
jlanuti334be1a2007-04-10 19:22:28 +0000159 <java jar="${apiRoot}/eclipse/startup.jar" fork="true" failonerror="true" timeout="3600000" dir="${apiRoot}">
jlanutieb351ff2007-04-03 13:33:59 +0000160 <jvmarg value="-Dosgi.ws=${env.BASEWS}" />
161 <jvmarg value="-Dosgi.os=${env.BASEOS}" />
162 <jvmarg value="-Dosgi.arch=${env.BASEARCH}" />
163 <jvmarg value="-Xmx512M" />
164 <jvmarg line="${vmargs}" />
165 <arg value="-application" />
166 <arg value="${application}" />
167 </java>
168 </target>
169
170 <target name="upload" if="login">
171 <mkdir dir="${build.home}/archives"/>
172 <zip destfile="${build.home}/archives/${buildType}-${buildId}-${timestamp}.zip" basedir="${apiRoot}/apiresults"/>
173 <condition property="upload.path.1"
174 else="${login}@build.eclipse.org:~/downloads/webtools/downloads"
175 value="${login}@build.eclipse.org:~/downloads/webtools/committers">
176 <isset property="build.committers"/>
177 </condition>
178 <condition property="upload.path"
179 else="${upload.path.1}/drops/${buildType}-${buildId}-${timestamp}"
180 value="${upload.path.1}/drops/${build.stream}/${buildType}-${buildId}-${timestamp}">
181 <isset property="build.stream"/>
182 </condition>
183 <exec executable="scp" dir="${build.home}">
184 <arg line="-r ./adopterScanRoot/apiresults ${upload.path}"/>
185 </exec>
186 </target>
jlanuti22cd7572007-04-10 20:52:52 +0000187
188 <target name="clean" if="clean">
189 <delete failonerror="false">
190 <fileset dir="${env.LOCAL_PREREQS_CACHE}" includes="wtp-*"/>
191 </delete>
192 </target>
jlanutieb351ff2007-04-03 13:33:59 +0000193
194</project>