jlanuti | 3349f77 | 2007-04-12 20:41:49 +0000 | [diff] [blame^] | 1 | <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 | releng.tag [optional] |
| 16 | wtp.dir [optional] |
| 17 | clean [optional] |
| 18 | --> |
| 19 | |
| 20 | <!-- Note to be cross-platform, "environment variables" are only appropriate for |
| 21 | some variables, e.g. ones we set, since properties are case sensitive, even if |
| 22 | the environment variables on your operating system are not, e.g. it will |
| 23 | be ${env.Path} not ${env.PATH} on Windows --> |
| 24 | <property environment="env" /> |
| 25 | |
| 26 | |
| 27 | <target name="main"> |
| 28 | <property file="${build.home}/releng.wtpbuilder/build.properties"/> |
| 29 | <property file="${build.home}/releng.wtpbuilder/distribution/wtp.api/api.properties"/> |
| 30 | <property name="wtp.api" value="${build.home}/releng.wtpbuilder/distribution/wtp.api"/> |
| 31 | <property name="apiRoot" value="${build.home}/apiRoot"/> |
| 32 | <delete dir="${apiRoot}" failonerror="false"/> |
| 33 | <mkdir dir="${apiRoot}"/> |
| 34 | <antcall target="getReleng"/> |
| 35 | <property file="${apiRoot}/releng/maps/dependencies.properties"/> |
| 36 | <property name="local.cache.dir" value="${env.LOCAL_PREREQS_CACHE}"/> |
| 37 | <property name="wtp.dir" value="${local.cache.dir}"/> |
| 38 | <property name="install.destination" value="${apiRoot}"/> |
| 39 | <antcall target="getDependencies"/> |
| 40 | <condition property="wtp-sdk" value="wtp-sdk-${buildId}.zip" else="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip"> |
| 41 | <available file="${wtp.dir}/wtp-sdk-${buildId}.zip"/> |
| 42 | </condition> |
| 43 | <condition property="wtp-wst-tests" value="wtp-wst-Automated-Tests-${buildId}.zip" else="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip"> |
| 44 | <available file="${wtp.dir}/wtp-wst-Automated-Tests-${buildId}.zip"/> |
| 45 | </condition> |
| 46 | <condition property="wtp-jst-tests" value="wtp-jst-Automated-Tests-${buildId}.zip" else="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip"> |
| 47 | <available file="${wtp.dir}/wtp-jst-Automated-Tests-${buildId}.zip"/> |
| 48 | </condition> |
| 49 | <antcall target="run"/> |
| 50 | <antcall target="upload"/> |
| 51 | </target> |
| 52 | |
| 53 | <target name="getReleng"> |
| 54 | <property name="releng.tag" value="v${buildType}${timestamp}"/> |
| 55 | <cvs |
| 56 | cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools" |
| 57 | package="releng" |
| 58 | dest="${apiRoot}" |
| 59 | command="export" |
| 60 | tag="${releng.tag}" |
| 61 | /> |
| 62 | </target> |
| 63 | |
| 64 | <target name="getDependencies"> |
| 65 | <antcall target="getAndInstall"> |
| 66 | <param name="groupId" value="eclipse" /> |
| 67 | </antcall> |
| 68 | <antcall target="getAndInstall"> |
| 69 | <param name="groupId" value="eclipseTestFramework" /> |
| 70 | <param name="clean" value="true" /> |
| 71 | </antcall> |
| 72 | <antcall target="getAndInstall"> |
| 73 | <param name="groupId" value="emf" /> |
| 74 | </antcall> |
| 75 | <antcall target="getAndInstall"> |
| 76 | <param name="groupId" value="gef" /> |
| 77 | </antcall> |
| 78 | <antcall target="getAndInstall"> |
| 79 | <param name="groupId" value="jem" /> |
| 80 | </antcall> |
| 81 | <antcall target="getAndInstall"> |
| 82 | <param name="groupId" value="tomcat.5" /> |
| 83 | </antcall> |
| 84 | <antcall target="getAndInstall"> |
| 85 | <param name="groupId" value="jonas.4" /> |
| 86 | </antcall> |
| 87 | <antcall target="getAndInstall"> |
| 88 | <param name="groupId" value="oagis.release" /> |
| 89 | </antcall> |
| 90 | <antcall target="getAndInstall"> |
| 91 | <param name="groupId" value="oagis.wsdl" /> |
| 92 | </antcall> |
| 93 | |
| 94 | <!-- this appears to be pretty explict hard coding for windows machines. |
| 95 | I wonder why the usual "get dependencies" methods would not work? |
| 96 | --> |
| 97 | <antcall target="get"> |
| 98 | <param name="groupId" value="eclipse" /> |
| 99 | <param name="baseos" value="win32" /> |
| 100 | <param name="basews" value="win32" /> |
| 101 | <param name="basearch" value="x86" /> |
| 102 | </antcall> |
| 103 | |
| 104 | |
| 105 | <antcall target="get"> |
| 106 | <param name="groupId" value="tptp" /> |
| 107 | </antcall> |
| 108 | <mkdir dir="${apiRoot}/piagent"/> |
| 109 | <condition property="isLinux"> |
| 110 | <equals arg1="${baseos}" arg2="linux"/> |
| 111 | </condition> |
| 112 | <antcall target="setupPIAgent.linux"/> |
| 113 | <antcall target="setupPIAgent.win32"/> |
| 114 | <antcall target="getAndInstallWTP"> |
| 115 | <param name="file" value="wtp-sdk-${buildId}.zip" /> |
| 116 | </antcall> |
| 117 | <antcall target="getAndInstallWTP"> |
| 118 | <param name="file" value="wtp-sdk-${buildType}-${buildId}-${timestamp}.zip" /> |
| 119 | </antcall> |
| 120 | <antcall target="getAndInstallWTP"> |
| 121 | <param name="file" value="wtp-wst-Automated-Tests-${buildId}.zip" /> |
| 122 | </antcall> |
| 123 | <antcall target="getAndInstallWTP"> |
| 124 | <param name="file" value="wtp-wst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" /> |
| 125 | </antcall> |
| 126 | <antcall target="getAndInstallWTP"> |
| 127 | <param name="file" value="wtp-jst-Automated-Tests-${buildId}.zip" /> |
| 128 | </antcall> |
| 129 | <antcall target="getAndInstallWTP"> |
| 130 | <param name="file" value="wtp-jst-Automated-Tests-${buildType}-${buildId}-${timestamp}.zip" /> |
| 131 | </antcall> |
| 132 | <delete file="${local.cache.dir}/wtp-apiscanner.zip"/> |
| 133 | <get src="http://download.eclipse.org/webtools/downloads/wtp-apiscanner.zip" dest="${local.cache.dir}/wtp-apiscanner.zip"/> |
| 134 | <unzip src="${local.cache.dir}/wtp-apiscanner.zip" dest="${apiRoot}"/> |
| 135 | </target> |
| 136 | |
| 137 | <target name="get"> |
| 138 | <property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/> |
| 139 | <ant antfile="${dependencyTargets}" target="checkDependency"> |
| 140 | <property name="groupId" value="${groupId}" /> |
| 141 | </ant> |
| 142 | </target> |
| 143 | |
| 144 | <target name="getAndInstall"> |
| 145 | <property name="dependencyTargets" value="${build.home}/releng.wtpbuilder/scripts/dependency/build.xml"/> |
| 146 | <ant antfile="${dependencyTargets}" target="checkDependency"> |
| 147 | <property name="groupId" value="${groupId}" /> |
| 148 | </ant> |
| 149 | <ant antfile="${dependencyTargets}" target="installDependency"> |
| 150 | <property name="groupId" value="${groupId}" /> |
| 151 | </ant> |
| 152 | </target> |
| 153 | |
| 154 | <target name="getAndInstallWTP"> |
| 155 | <available file="${wtp.dir}/${file}" property="file.exists"/> |
| 156 | <antcall target="getWTP"/> |
| 157 | <available file="${wtp.dir}/${file}" property="file.exists"/> |
| 158 | <antcall target="installWTP"/> |
| 159 | </target> |
| 160 | |
| 161 | <target name="getWTP"> |
| 162 | <condition property="file.url.1" value="http://download.eclipse.org/webtools/committers" else="http://download.eclipse.org/webtools/downloads"> |
| 163 | <isset property="build.committers"/> |
| 164 | </condition> |
| 165 | <condition property="file.url" value="${file.url.1}/drops/${build.stream}/${buildType}-${buildId}-${timestamp}" else="${file.url.1}/drops/${buildType}-${buildId}-${timestamp}"> |
| 166 | <isset property="build.stream"/> |
| 167 | </condition> |
| 168 | <antcall target="getWTP2"/> |
| 169 | </target> |
| 170 | |
| 171 | <target name="getWTP2" unless="file.exists"> |
| 172 | <property name="file.url" value="http://download.eclipse.org/webtools/downloads/drops/${build.stream}/${buildType}-${buildId}-${timestamp}"/> |
| 173 | <mkdir dir="${wtp.dir}"/> |
| 174 | <get dest="${wtp.dir}/${file}" src="${file.url}/${file}" ignoreerrors="true"/> |
| 175 | </target> |
| 176 | |
| 177 | <target name="installWTP" if="file.exists"> |
| 178 | <unzip src="${wtp.dir}/${file}" dest="${install.destination}" overwrite="true"/> |
| 179 | </target> |
| 180 | |
| 181 | <target name="setupPIAgent.linux" if="isLinux"> |
| 182 | <unzip src="${local.cache.dir}/${tptp.file.linux-gtk-x86}" dest="${apiRoot}/piagent"> |
| 183 | <patternset> |
| 184 | <include name="lib/*"/> |
| 185 | </patternset> |
| 186 | </unzip> |
| 187 | <move todir="${apiRoot}/piagent" flatten="true"> |
| 188 | <fileset dir="${apiRoot}/piagent/lib"/> |
| 189 | </move> |
| 190 | </target> |
| 191 | |
| 192 | <target name="setupPIAgent.win32" unless="isLinux"> |
| 193 | <unzip src="${local.cache.dir}/${tptp.file.win32-win32-x86}" dest="${apiRoot}/piagent"> |
| 194 | <patternset> |
| 195 | <include name="bin/*"/> |
| 196 | </patternset> |
| 197 | </unzip> |
| 198 | <move todir="${apiRoot}/piagent" flatten="true"> |
| 199 | <fileset dir="${apiRoot}/piagent/bin"/> |
| 200 | </move> |
| 201 | </target> |
| 202 | |
| 203 | <target name="run"> |
| 204 | <cvs |
| 205 | cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools" |
| 206 | package="releng.builder/tools/apitools/adopter_usages" |
| 207 | dest="${apiRoot}" |
| 208 | command="export" |
| 209 | tag="HEAD" |
| 210 | /> |
| 211 | <mkdir dir="${apiRoot}/adopters"/> |
| 212 | <antcall target="runEclipseApp"> |
| 213 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.APIRefCompatibilityScanner"/> |
| 214 | <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}/${jem.file} -Duse=${apiRoot}/releng.builder/tools/apitools/adopter_usages -DoutputDir=${apiRoot}/adopters -Xmx512M"/> |
| 215 | </antcall> |
| 216 | <copy tofile="${apiRoot}/apiresults/api-ref-compatibility.html" file="${apiRoot}/adopters/api-ref-compatibility.html"/> |
| 217 | <copy tofile="${apiRoot}/apiresults/api-ref-compatibility.xml" file="${apiRoot}/adopters/api-ref-compatibility.xml"/> |
| 218 | |
| 219 | <antcall target="runEclipseApp"> |
| 220 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/> |
| 221 | <param name="vmargs" value="-Dsrc=${local.cache.dir}/${eclipse.file.win32-win32-x86} -DoutputDir=${apiRoot}/api-eclipse -Dexcludes=.*internal.*"/> |
| 222 | </antcall> |
| 223 | <antcall target="runEclipseApp"> |
| 224 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/> |
| 225 | <param name="vmargs" value="-Dsrc=${local.cache.dir}/${emf.file} -DoutputDir=${apiRoot}/api-emf -Dexcludes=.*internal.*"/> |
| 226 | </antcall> |
| 227 | <antcall target="runEclipseApp"> |
| 228 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/> |
| 229 | <param name="vmargs" value="-Dsrc=${local.cache.dir}/${gef.file} -DoutputDir=${apiRoot}/api-gef -Dexcludes=.*internal.*"/> |
| 230 | </antcall> |
| 231 | <antcall target="runEclipseApp"> |
| 232 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/> |
| 233 | <param name="vmargs" value="-Dsrc=${local.cache.dir}/${jem.file} -DoutputDir=${apiRoot}/api-jem -Dexcludes=.*internal.*"/> |
| 234 | </antcall> |
| 235 | <antcall target="runEclipseApp"> |
| 236 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.Java2API"/> |
| 237 | <param name="vmargs" value="-Dsrc=${local.cache.dir}/${wtp-sdk} -DoutputDir=${apiRoot}/api-wtp"/> |
| 238 | </antcall> |
| 239 | |
| 240 | <antcall target="runJavaMain"> |
| 241 | <param name="classname" value="org.eclipse.wtp.releng.tools.component.api.violation.APIViolationScanner"/> |
| 242 | <param name="args" value="-src ${local.cache.dir}/${wtp-sdk} -api ${apiRoot}/api-eclipse ${apiRoot}/api-emf ${apiRoot}/api-gef ${apiRoot}/api-jem -outputDir ${apiRoot}/apiresults -html -includes org.eclipse.* -excludes org.eclipse.wst.* org.eclipse.jst.* -debug"/> |
| 243 | </antcall> |
| 244 | |
| 245 | <antcall target="runJavaMain"> |
| 246 | <param name="classname" value="org.eclipse.wtp.releng.tools.component.api.API2ComponentAPI"/> |
| 247 | <param name="args" value="-src ${local.cache.dir}/${wtp-sdk} -api ${local.cache.dir}/${wtp-sdk} -outputDir ${apiRoot}/apiresults -html"/> |
| 248 | </antcall> |
| 249 | |
| 250 | <antcall target="runEclipseApp"> |
| 251 | <param name="application" value="org.eclipse.wtp.releng.tools.component.core.JavadocScanner"/> |
| 252 | <param name="vmargs" value="-Dsrc=${local.cache.dir}/${wtp-sdk} -DoutputDir=${apiRoot}/apiresults -Dapi=${local.cache.dir}/${wtp-sdk} -Dexcludes=.*internal.* -DskipAPIGen=true -Dhtml=true"/> |
| 253 | </antcall> |
| 254 | |
| 255 | <antcall target="runJavaMain"> |
| 256 | <param name="classname" value="org.eclipse.wtp.releng.tools.component.api.violation.NonAPIDependencyScanner"/> |
| 257 | <param name="args" value="-src ${local.cache.dir}/${wtp-sdk} -api ${local.cache.dir}/${wtp-sdk} -outputDir ${apiRoot}/apiresults -refapi ${apiRoot}/api-eclipse ${apiRoot}/api-emf ${apiRoot}/api-gef ${apiRoot}/api-jem -includes org.eclipse.* -skipAPIGen"/> |
| 258 | </antcall> |
| 259 | |
| 260 | <mkdir dir="${apiRoot}/results/consolelogs"/> |
| 261 | <copy todir="${apiRoot}" overwrite="true"> |
| 262 | <fileset dir="${build.home}/releng.wtpbuilder/distribution/wtp.tests/testScripts"/> |
| 263 | </copy> |
| 264 | <copy file="${build.home}/releng.wtpbuilder/distribution/wtp.api/testScripts/test.xml" tofile="${apiRoot}/test.xml" overwrite="true"/> |
| 265 | <ant antfile="${build.home}/releng.wtpbuilder/distribution/wtp.tests/build.xml" target="runTestEclipse"> |
| 266 | <property name="testRoot" value="${apiRoot}"/> |
| 267 | <property name="testTarget" value="all"/> |
| 268 | </ant> |
| 269 | <antcall target="runJavaMain"> |
| 270 | <param name="classname" value="org.eclipse.wtp.releng.tools.component.CodeCoverageScanner"/> |
| 271 | <param name="args" value="-api ${local.cache.dir}/${wtp-sdk} -src ${local.cache.dir}/${wtp-sdk} ${local.cache.dir}/${wtp-wst-tests} ${local.cache.dir}/${wtp-jst-tests} -trcxml ${apiRoot}/apiresults/trcxml -outputDir ${apiRoot}/apiresults -skipAPIGen -html"/> |
| 272 | </antcall> |
| 273 | |
| 274 | <cvs |
| 275 | cvsRoot=":pserver:anonymous@dev.eclipse.org:/cvsroot/webtools" |
| 276 | package="releng.builder/tools/apitools/api_progress" |
| 277 | dest="${apiRoot}" |
| 278 | command="export" |
| 279 | tag="HEAD" |
| 280 | /> |
| 281 | <antcall target="runJavaMain"> |
| 282 | <param name="classname" value="org.eclipse.wtp.releng.tools.component.api.progress.APIProgressScanner"/> |
| 283 | <param name="args" value="-api ${local.cache.dir}/${wtp-sdk} -src ${local.cache.dir}/${wtp-sdk} -outputDir ${apiRoot}/apiresults -progressDir ${apiRoot}/releng.builder/tools/apitools/api_progress/1.0 -timestamp ${timestamp} -excludes .*infopop .*doc.isv .*doc.user .*source org.eclipse.wst org.eclipse.jst"/> |
| 284 | </antcall> |
| 285 | |
| 286 | <antcall target="runJavaMain"> |
| 287 | <param name="classname" value="org.eclipse.wtp.releng.tools.component.CodeCoverageScanner"/> |
| 288 | <param name="args" value="-api ${apiRoot}/api-wtp -src ${local.cache.dir}/${wtp-sdk} ${local.cache.dir}/${wtp-wst-tests} ${local.cache.dir}/${wtp-jst-tests} -trcxml ${apiRoot}/apiresults/trcxml -outputDir ${apiRoot}/apiresults/full_test_coverage -html -includeAllTC -title Test_Coverage_Report"/> |
| 289 | </antcall> |
| 290 | </target> |
| 291 | |
| 292 | <target name="runEclipseApp"> |
| 293 | <property name="vmargs" value=""/> |
| 294 | <java classpath="${apiRoot}/eclipse/startup.jar" fork="true" classname="org.eclipse.core.launcher.Main" failonerror="true" timeout="3600000" dir="${apiRoot}"> |
| 295 | <jvmarg value="-Dosgi.ws=${env.BASEWS}" /> |
| 296 | <jvmarg value="-Dosgi.os=${env.BASEOS}" /> |
| 297 | <jvmarg value="-Dosgi.arch=${env.BASEARCH}" /> |
| 298 | <jvmarg value="-Xmx512M" /> |
| 299 | <jvmarg line="${vmargs}" /> |
| 300 | <arg value="-application" /> |
| 301 | <arg value="${application}" /> |
| 302 | </java> |
| 303 | </target> |
| 304 | |
| 305 | <target name="runJavaMain"> |
| 306 | <java fork="true" classname="${classname}" failonerror="false" timeout="3600000" dir="${apiRoot}"> |
| 307 | <classpath> |
| 308 | <fileset dir="${apiRoot}/eclipse/plugins"> |
| 309 | <include name="**/org.eclipse.wtp.releng.tools.component.core*.jar"/> |
| 310 | </fileset> |
| 311 | <fileset dir="${apiRoot}/lib"> |
| 312 | <include name="**/org.eclipse.core.contenttype*.jar"/> |
| 313 | <include name="**/org.eclipse.core.jobs*.jar"/> |
| 314 | <include name="**/org.eclipse.core.resources*.jar"/> |
| 315 | <include name="**/org.eclipse.core.runtime*.jar"/> |
| 316 | <include name="**/org.eclipse.equinox*.jar"/> |
| 317 | <include name="**/org.eclipse.jdt.core*.jar"/> |
| 318 | <include name="**/org.eclipse.jface.text*.jar"/> |
| 319 | <include name="**/org.eclipse.osgi*.jar"/> |
| 320 | <include name="**/org.eclipse.text*.jar"/> |
| 321 | <include name="**/org.eclipse.equinox.launcher_*.jar"/> |
| 322 | </fileset> |
| 323 | </classpath> |
| 324 | <jvmarg value="-Xmx512M"/> |
| 325 | <arg line="${args}"/> |
| 326 | </java> |
| 327 | </target> |
| 328 | |
| 329 | <target name="upload" if="login"> |
| 330 | <mkdir dir="${build.home}/archives"/> |
| 331 | <zip destfile="${build.home}/archives/${buildType}-${buildId}-${timestamp}.zip" basedir="${build.home}/apiRoot/apiresults"/> |
| 332 | <condition property="upload.path.1" |
| 333 | else="${login}@download1.eclipse.org:~/downloads/webtools/downloads" |
| 334 | value="${login}@download1.eclipse.org:~/downloads/webtools/committers"> |
| 335 | <isset property="build.committers"/> |
| 336 | </condition> |
| 337 | <condition property="upload.path" |
| 338 | else="${upload.path.1}/drops/${buildType}-${buildId}-${timestamp}" |
| 339 | value="${upload.path.1}/drops/${build.stream}/${buildType}-${buildId}-${timestamp}"> |
| 340 | <isset property="build.stream"/> |
| 341 | </condition> |
| 342 | <exec executable="scp" dir="${build.home}"> |
| 343 | <arg line="-r ./apiRoot/apiresults ${upload.path}"/> |
| 344 | </exec> |
| 345 | </target> |
| 346 | |
| 347 | <target name="clean" if="clean"> |
| 348 | <property file="${build.home}/releng.wtpbuilder/build.properties"/> |
| 349 | <property name="local.cache.dir" value="${env.LOCAL_PREREQS_CACHE}"/> |
| 350 | <property name="apiRoot" value="${build.home}/apiRoot"/> |
| 351 | <property name="wtp.dir" value="${local.cache.dir}"/> |
| 352 | <delete dir="${apiRoot}" failonerror="false"/> |
| 353 | <delete failonerror="false"> |
| 354 | <fileset dir="${wtp.dir}" includes="wtp-*"/> |
| 355 | </delete> |
| 356 | </target> |
| 357 | |
| 358 | </project> |