Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 1 | <?xml version="1.0"?> |
| 2 | <!-- |
| 3 | Copyright (c) 2010 Stephan Herrmann and others. |
Stephan Herrmann | 3570538 | 2020-03-03 21:42:19 +0100 | [diff] [blame] | 4 | This program and the accompanying materials |
| 5 | are made available under the terms of the Eclipse Public License 2.0 |
| 6 | which accompanies this distribution, and is available at |
| 7 | https://www.eclipse.org/legal/epl-2.0/ |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 8 | |
Stephan Herrmann | 3570538 | 2020-03-03 21:42:19 +0100 | [diff] [blame] | 9 | SPDX-License-Identifier: EPL-2.0 |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 10 | Contributors: |
| 11 | Stephan Herrmann - initial API and implementation |
| 12 | --> |
| 13 | <project name="Main Object Teams Build and Test Automation" default="INFO"> |
| 14 | |
| 15 | <target name="showGivenProperties" |
| 16 | description="Show values of all properties that should be passed from our caller."> |
| 17 | <echo>Properties passed into this script: |
| 18 | ------------------------------------------------------------------------------ |
Stephan Herrmann | 5acccae | 2019-04-13 17:46:35 +0200 | [diff] [blame] | 19 | path of base eclipse SDK: |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 20 | eclipse-app.tgz = ${eclipse-app.tgz} |
Stephan Herrmann | af43e4a | 2013-04-29 23:19:56 +0200 | [diff] [blame] | 21 | eclipse SDK build qualifier: |
| 22 | eclipse.sdk.qualifier = ${eclipse.sdk.qualifier} |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 23 | path of eclipse test framework: |
Stephan Herrmann | 8372dc2 | 2010-06-03 22:41:05 +0000 | [diff] [blame] | 24 | eclipse.tests.zip= ${eclipse.tests.zip} |
| 25 | path of published updates: |
| 26 | published.updates= ${published.updates} |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 27 | should sources be built (true|false)? |
| 28 | do.build.all = ${do.build.all} |
| 29 | should test be run (true|false)? |
| 30 | do.run.tests = ${do.run.tests} |
Stephan Herrmann | 56428e9 | 2013-02-23 12:29:56 +0100 | [diff] [blame] | 31 | directory for tempory files during testing: |
| 32 | test.tmpDir = ${test.tmpDir} |
Stephan Herrmann | e73f885 | 2016-11-01 00:23:59 +0100 | [diff] [blame] | 33 | git working area |
| 34 | fetchCacheLocation = ${fetchCacheLocation} |
Stephan Herrmann | e8ce6eb | 2016-11-01 01:01:55 +0100 | [diff] [blame] | 35 | path to map file (with substitutions): |
| 36 | map.file.path = ${map.file.path} |
| 37 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 38 | ------------------------------------------------------------------------------ |
| 39 | </echo> |
| 40 | </target> |
| 41 | |
| 42 | <target name="setupProperties" depends="showGivenProperties"> |
| 43 | |
| 44 | <dirname property="_toplevelDir" file="${ant.file}"/> |
| 45 | |
| 46 | <!-- main configuration file (version dependent names etc.): --> |
| 47 | <loadproperties srcfile="${_toplevelDir}/run.properties" /> |
| 48 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 49 | <!-- ======== Directories (indentation shows structure): ======== --> |
| 50 | <!-- build scripts: --> |
| 51 | <property name="OTScriptDir" value="${_toplevelDir}" /> |
| 52 | <property name="buildfile" value="${OTScriptDir}/build.xml" /> |
| 53 | <property name="builder-otcompiler" value="${OTScriptDir}/OT-Compiler" /> |
| 54 | <property name="builder-otdt" value="${OTScriptDir}/OTDT-Build" /> |
Stephan Herrmann | 8924563 | 2019-04-13 20:05:41 +0200 | [diff] [blame] | 55 | |
| 56 | <!-- directories for testing: --> |
| 57 | <property name="test.root.dir" value="${user.dir}/test-root" /> |
| 58 | <!-- This name is used in individual test.xml of test plugins: --> |
| 59 | <property name="test.eclipseDir" value="${test.root.dir}/eclipse" /> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 60 | |
| 61 | <!-- directories for the build: --> |
| 62 | <property name="build.root.dir" value="${user.dir}/build-root" /> |
Stephan Herrmann | 33c2604 | 2010-06-03 10:24:16 +0000 | [diff] [blame] | 63 | <!-- These names are hard coded in pde-build: --> |
| 64 | <property name="buildDirectory" value="${build.root.dir}/src" /> |
Stephan Herrmann | 342fbb3 | 2019-04-13 20:20:46 +0200 | [diff] [blame] | 65 | <property name="bootLocation" value="${build.root.dir}/eclipse" /> |
Stephan Herrmann | 8924563 | 2019-04-13 20:05:41 +0200 | [diff] [blame] | 66 | <property name="baseLocation" value="${test.eclipseDir}" /> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 67 | |
| 68 | <!-- directories for update sites: --> |
| 69 | <property name="otdtUpdatesDir" value="${user.dir}/updateSite"/> |
| 70 | <property name="testsUpdatesDirBase" value="${user.dir}/updateSiteTests"/> |
Stephan Herrmann | 20ff77c | 2010-06-03 09:31:09 +0000 | [diff] [blame] | 71 | <!-- will have sub directories "eclipse" and "otdt" --> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 72 | |
Stephan Herrmann | eac9068 | 2013-04-29 23:29:13 +0200 | [diff] [blame] | 73 | <!-- ======== Insert SDK build qualifier into our configuration files: ======== --> |
| 74 | <copy file="${map.file.path}.in" tofile="${map.file.path}"> |
| 75 | <filterset> |
| 76 | <filter token="SDK_QUALIFIER" value="${eclipse.sdk.qualifier}"/> |
| 77 | </filterset> |
| 78 | </copy> |
Stephan Herrmann | eac9068 | 2013-04-29 23:29:13 +0200 | [diff] [blame] | 79 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 80 | <!-- ======== More Configuration Details: ======== --> |
| 81 | <!-- maybe obsolete: file prefix to distinguish output files. --> |
| 82 | <property name="file-id" value="XXX" /> |
| 83 | |
| 84 | <!-- Configure Java for STAGE 1 and STAGE 2 building: --> |
| 85 | <property name="vm" value="java" /> |
| 86 | <property name="vm.args" value="-Xmx912m" /> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 87 | |
| 88 | <property name="installmode" value="clean" /> |
| 89 | |
| 90 | <property name="saxon.jar.name" value="saxon8.jar" /> |
| 91 | <property name="saxon.jar.path" value="${user.home}/.ant/lib/${saxon.jar.name}" /> |
Stephan Herrmann | 2ab0c0e | 2016-11-01 14:21:09 +0100 | [diff] [blame] | 92 | <available file="${saxon.jar.path}" property="_hasSaxon.jar" /> <!-- on HIPP this is set to true by the caller --> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 93 | |
| 94 | <!-- ant's os.arch is slightly different than osgi's arch --> |
Stephan Herrmann | 1a9d85a | 2010-05-17 22:45:31 +0000 | [diff] [blame] | 95 | <condition property="arch" value="x86_64"> <!-- HACK: hard coding 64-bit architecture --> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 96 | <os arch="i386" /> |
| 97 | </condition> |
| 98 | <condition property="arch" value="ppc64"> <!-- HACK: hard coding 64-bit architecture --> |
| 99 | <os arch="ppc" /> |
| 100 | </condition> |
Stephan Herrmann | 005fc31 | 2010-05-18 12:52:58 +0000 | [diff] [blame] | 101 | <condition property="arch" value="x86_64"> <!-- Map ant's arch to OSGi arch --> |
| 102 | <os arch="amd64" /> |
| 103 | </condition> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 104 | <!-- if not set above, set it to os.arch --> |
| 105 | <property name="arch" value="${os.arch}" /> |
| 106 | |
| 107 | </target> |
| 108 | |
| 109 | |
| 110 | <target name="INFO"> |
| 111 | <echo>Usage: |
Stephan Herrmann | b105b08 | 2011-05-15 00:39:56 +0000 | [diff] [blame] | 112 | ant -f run.xml ot-junit-all -> runs OTDT Build and Testprocess |
| 113 | ant -f run.xml ot-junit-otdt -> runs OTDT Build and Testprocess excluding jdt tests |
| 114 | ant -f run.xml ot-junit-build -> runs just OTDT Buildprocess |
| 115 | ant -f run.xml ot-compiler-build -> just build the compiler |
| 116 | ant -f run.xml ot-junit-run -> runs just OTDT Tests w/o TestSetup |
| 117 | </echo> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 118 | </target> |
| 119 | |
| 120 | <target name="ot-junit-all" depends="setupProperties,checkOS" description="Build all and run all tests."> |
| 121 | <echo message="Starting BuildProcess and Testrun in ${build.root.dir}"/> |
| 122 | <antcall target="verifyAntInstall"/> |
| 123 | <antcall target="setupTests" /> |
| 124 | <antcall target="runAllTests"/> |
| 125 | </target> |
| 126 | |
Stephan Herrmann | d8c8165 | 2010-11-06 15:01:14 +0000 | [diff] [blame] | 127 | <target name="ot-junit-otdt" depends="setupProperties,checkOS" description="Build all and run otdt tests."> |
| 128 | <echo message="Starting BuildProcess and Testrun in ${build.root.dir}"/> |
| 129 | <antcall target="verifyAntInstall"/> |
| 130 | <antcall target="setupTests" /> |
| 131 | <antcall target="runOTDTTests"/> |
| 132 | </target> |
| 133 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 134 | <target name="ot-junit-build" depends="setupProperties,checkOS" description="build everything without running tests"> |
| 135 | <echo message="Starting BuildProcess in ${build.root.dir}"/> |
| 136 | <antcall target="verifyAntInstall"/> |
Stephan Herrmann | 8b5e97e | 2013-07-30 18:44:03 +0200 | [diff] [blame] | 137 | <antcall target="setupTests" /> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 138 | </target> |
| 139 | |
Stephan Herrmann | b59f3f0 | 2011-05-15 00:17:51 +0000 | [diff] [blame] | 140 | <target name="ot-compiler-build" depends="setupProperties,checkOS" description="build only the compiler (for debugging the build)"> |
| 141 | <echo message="Starting BuildProcess in ${build.root.dir}"/> |
| 142 | <antcall target="verifyAntInstall"/> |
| 143 | <antcall target="createOTCompilerEclipse"/> |
| 144 | </target> |
| 145 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 146 | <target name="ot-junit-run" depends="setupProperties,checkOS" description="Run tests without building"> |
| 147 | <echo message="Starting Testrun ${test.root.dir}"/> |
| 148 | <antcall target="runAllTests" /> |
| 149 | </target> |
| 150 | |
Stephan Herrmann | 8b5e97e | 2013-07-30 18:44:03 +0200 | [diff] [blame] | 151 | <target name="ot-junit-run-ot" depends="setupProperties,checkOS" description="Run OT tests without building"> |
| 152 | <echo message="Starting Testrun ${test.root.dir}"/> |
| 153 | <antcall target="runOTDTTests" /> |
| 154 | </target> |
| 155 | |
Stephan Herrmann | eb0f292 | 2018-08-09 13:27:26 +0200 | [diff] [blame] | 156 | <target name="ot-junit-run-onlyone" depends="setupProperties,checkOS" description="Run OT tests without building"> |
| 157 | <echo message="Starting Testrun ${test.root.dir}"/> |
Stephan Herrmann | a887ab7 | 2018-08-09 14:11:12 +0200 | [diff] [blame] | 158 | <antcall target="setupTests" /> |
Stephan Herrmann | eb0f292 | 2018-08-09 13:27:26 +0200 | [diff] [blame] | 159 | <antcall target="runOnlyoneTests" /> |
| 160 | </target> |
| 161 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 162 | <!-- =================== END Public Targets ==================== --> |
| 163 | |
| 164 | <!-- === Setup Targets: === --> |
| 165 | |
| 166 | <target name="verifyAntInstall" unless="_hasSaxon.jar"> |
| 167 | <copy failonerror="true" overwrite="false" file="${OTScriptDir}/${saxon.jar.name}" tofile="${saxon.jar.path}"></copy> |
| 168 | <echo message="Needed to copy saxon8.jar to ${saxon.jar.path}. Please restart the build." /> |
| 169 | <echo message="For an explanation, see http://ant.apache.org/faq.html#delegating-classloader-1.6" /> |
| 170 | <fail message="See above. Please restart the build."/> |
| 171 | </target> |
| 172 | |
| 173 | <!-- checks on which os ant is run, set ${os} and ${ws} accordingly --> |
| 174 | <target name="determineOS"> |
| 175 | <condition property="os.isWindows"> |
| 176 | <os family="windows"/> |
| 177 | </condition> |
| 178 | |
| 179 | <condition property="os.isLinux"> |
| 180 | <os name="Linux" /> |
| 181 | </condition> |
| 182 | </target> |
| 183 | |
| 184 | <target name="checkOS" depends="determineOS,windows,linux"/> |
| 185 | |
| 186 | <target name="windows" if="os.isWindows"> |
| 187 | <echo message="OS is Windows"/> |
| 188 | <property name="os" value="win32" /> |
| 189 | <property name="ws" value="win32" /> |
| 190 | </target> |
| 191 | |
| 192 | <target name="linux" unless="os.isWindows" > |
| 193 | <echo message="OS is Linux"/> |
| 194 | <!-- eclipse-app.tgz is already passed from the calling script --> |
| 195 | <property name="os" value="linux" /> |
| 196 | <property name="ws" value="gtk" /> |
| 197 | </target> |
| 198 | |
Stephan Herrmann | b5ca034 | 2021-03-04 20:08:55 +0100 | [diff] [blame] | 199 | <target name="setupForCompile" depends="checkOS,setupProperties" unless="_hasCreatedOTDTEclipse"> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 200 | <antcall target="UnzipEclipse"/> |
| 201 | <antcall target="AddPluginsToEclipse"/> |
| 202 | </target> |
| 203 | |
| 204 | <target name="UnzipEclipse"> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 205 | <echo message="Extracting Boot Eclipse (${eclipse-app.tgz}) in ${build.root.dir}..."/> |
Stephan Herrmann | dd1efd5 | 2021-03-03 16:18:08 +0100 | [diff] [blame] | 206 | <tempfile property="eclipse.app.tmp" prefix="eclipse-app"/> |
Stephan Herrmann | ec8afbe | 2021-03-03 15:53:26 +0100 | [diff] [blame] | 207 | <get src="${eclipse-app.tgz}" dest="${eclipse.app.tmp}"/> |
| 208 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 209 | <mkdir dir="${build.root.dir}"/> |
Stephan Herrmann | ec8afbe | 2021-03-03 15:53:26 +0100 | [diff] [blame] | 210 | <untar compression="gzip" src="${eclipse.app.tmp}" dest="${build.root.dir}"/> |
| 211 | <echo message="Extracting Base Eclipse (${eclipse.app.tmp}) in ${test.root.dir}..."/> |
Stephan Herrmann | d3be87b | 2019-04-13 20:14:21 +0200 | [diff] [blame] | 212 | <mkdir dir="${test.root.dir}"/> |
Stephan Herrmann | ec8afbe | 2021-03-03 15:53:26 +0100 | [diff] [blame] | 213 | <untar compression="gzip" src="${eclipse.app.tmp}" dest="${test.root.dir}"/> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 214 | <delete> |
Stephan Herrmann | dd1efd5 | 2021-03-03 16:18:08 +0100 | [diff] [blame] | 215 | <!-- avoid conflict with OTDT-variant when resolving source plug-ins against baseLocation: --> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 216 | <fileset dir="${baseLocation}/plugins/" includes="org.eclipse.jdt.core_*.v* org.eclipse.jdt.core.source_*.v*" /> |
Stephan Herrmann | 9e3ac7e | 2022-12-27 23:12:48 +0100 | [diff] [blame] | 217 | <fileset dir="${baseLocation}/plugins/" includes="org.eclipse.jdt.core.compiler.batch_*.v* org.eclipse.jdt.core.compiler.batch.source_*.v*" /> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 218 | </delete> |
Stephan Herrmann | e71cef9 | 2021-03-03 16:47:54 +0100 | [diff] [blame] | 219 | <delete file="${eclipse.app.tmp}"></delete> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 220 | </target> |
| 221 | |
Stephan Herrmann | 342fbb3 | 2019-04-13 20:20:46 +0200 | [diff] [blame] | 222 | <target name="AddPluginsToEclipse" description="Add git.pde.build plugins to the boot Eclipse"> |
| 223 | <mkdir dir="${bootLocation}/dropins/plugins"/> |
| 224 | <copy file="${OTScriptDir}/lib/${git.pde.build}" todir="${bootLocation}/dropins/plugins" /> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 225 | </target> |
| 226 | |
| 227 | <!-- ==== BUILDING AND RUNNING: ==== --> |
| 228 | |
| 229 | <!-- ==== BUILD STAGE 1: ==== --> |
| 230 | <!-- setting an empty inputstring is a workaround for http://issues.apache.org/bugzilla/show_bug.cgi?id=34461 --> |
| 231 | <target name="createOTCompilerEclipse" depends="setupForCompile" description="create the bootstrapping Eclipse with OT/J compiler"> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 232 | <echo message="Invoke pdebuild for creating the base new OT-Compiler"/> |
| 233 | <java |
| 234 | inputstring="" |
| 235 | dir="${baseLocation}" |
| 236 | fork="true" |
| 237 | classname="org.eclipse.equinox.launcher.Main" |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 238 | classpath="${bootLocation}/plugins/${org.eclipse.equinox.launcher_jar}"> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 239 | <arg value="-Dosgi.ws=${ws}"/> |
| 240 | <arg value="-Dosgi.os=${os}"/> |
| 241 | <arg value="-Dosgi.arch=${arch}"/> |
| 242 | <arg value="-application"/> |
| 243 | <arg value="org.eclipse.ant.core.antRunner"/> |
| 244 | <arg value="-buildfile"/> |
| 245 | <arg value="${buildfile}"/> |
| 246 | <arg value="-Dbuild.root.dir=${build.root.dir}"/> |
| 247 | <arg value="-DbaseLocation=${baseLocation}"/> |
Stephan Herrmann | ce88e99 | 2019-07-14 17:45:55 +0200 | [diff] [blame] | 248 | <arg value="-DbootLocation=${bootLocation}"/> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 249 | <arg value="-DOTScriptDir=${OTScriptDir}"/> |
| 250 | <arg value="-Drun.eclipseScriptDir=${run.eclipseScriptDir}"/> |
| 251 | <arg value="-Dbuilder=${builder-otcompiler}"/> |
| 252 | <arg value="-D${installmode}=true"/> <!-- <- obsolete? --> |
| 253 | <arg value="-Dcomponent.short=OT-Compiler"/> |
| 254 | <arg value="-DotdtUpdatesDir=${otdtUpdatesDir}"/> |
| 255 | <arg value="-Dconfigs=*,*,*"/> |
| 256 | <arg value="-Dbaseos=${os}"/> |
| 257 | <arg value="-Dbasews=${ws}"/> |
| 258 | <arg value="-Dbasearch=${arch}"/> |
| 259 | <arg value="-Dtest.root.dir=${test.root.dir}"/> |
| 260 | <arg value="-Dtest.eclipseDir=${test.eclipseDir}"/> |
| 261 | <arg value="-DmapVersionTag=${mapVersionTag}"/> |
| 262 | <arg value="-Dmap.file.path=${map.file.path}"/> |
Stephan Herrmann | bd1e219 | 2019-07-17 23:44:52 +0200 | [diff] [blame] | 263 | <arg value="-DfetchCacheLocation=${fetchCacheLocation}"/> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 264 | <arg value="-Declipse.sdk.qualifier=${eclipse.sdk.qualifier}"/> |
| 265 | <arg value="-Declipse-app.tgz=${eclipse-app.tgz}"/> |
| 266 | <arg value="-Declipse.tests.zip=${eclipse.tests.zip}"/> |
| 267 | <!--arg value="-verbose" /--> |
| 268 | <jvmarg value="${vm.args}"/> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 269 | </java> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 270 | <!-- Now we should have an update site with the patch feature, time to install it into the boot eclipse: --> |
| 271 | <ant antfile="${OTScriptDir}/p2helper.xml" target="installFeature" dir="${bootLocation}"> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 272 | <property name="feature" value="org.eclipse.objectteams.otdt.core.patch.feature.group"/> |
| 273 | <property name="sourceUpdatesDir" value="${otdtUpdatesDir}"/> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 274 | <property name="targetEclipseDir" value="${bootLocation}"/> |
Stephan Herrmann | 30912d6 | 2019-05-23 20:00:33 +0200 | [diff] [blame] | 275 | </ant> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 276 | <!-- make space for next stage of building, avoid duplicate jdt.core plugins from stages 1 & 2 --> |
Stephan Herrmann | d3035fa | 2022-12-30 13:47:30 +0100 | [diff] [blame^] | 277 | <!-- |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 278 | <delete includeemptydirs="true"> |
| 279 | <fileset dir="${otdtUpdatesDir}" includes="**"/> |
| 280 | </delete> |
Stephan Herrmann | d3035fa | 2022-12-30 13:47:30 +0100 | [diff] [blame^] | 281 | --> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 282 | </target> |
| 283 | |
| 284 | <!-- ==== BUILD STAGE 2: ==== --> |
| 285 | <!-- setting an empty inputstring is a workaround for http://issues.apache.org/bugzilla/show_bug.cgi?id=34461 --> |
| 286 | <target name="createOTDTEclipse" depends="createOTCompilerEclipse" unless="_hasCreatedOTDTEclipse"> |
| 287 | |
| 288 | <!-- Make org.eclipse.test.performance available while compiling test projects: --> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 289 | <echo message="Pre-installing Eclipse Test Framework into base Eclipse..."/> |
Stephan Herrmann | 67cbf1c | 2010-09-26 09:59:15 +0000 | [diff] [blame] | 290 | <mkdir dir="${testsUpdatesDirBase}/eclipse"/> |
Stephan Herrmann | d827cfd | 2021-03-03 16:31:26 +0100 | [diff] [blame] | 291 | <tempfile property="eclipse.tests.tmp" prefix="eclipse.tests"/> |
| 292 | <get src="${eclipse.tests.zip}" dest="${eclipse.tests.tmp}"/> |
Stephan Herrmann | dd1efd5 | 2021-03-03 16:18:08 +0100 | [diff] [blame] | 293 | <unzip dest="${testsUpdatesDirBase}/eclipse" src="${eclipse.tests.tmp}"/> |
Stephan Herrmann | e71cef9 | 2021-03-03 16:47:54 +0100 | [diff] [blame] | 294 | <delete file="${eclipse.tests.tmp}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 295 | <ant antfile="${OTScriptDir}/p2helper.xml" target="installFeature" dir="${baseLocation}"> |
| 296 | <property name="feature" value="org.eclipse.test.feature.group"/> |
Stephan Herrmann | 20ff77c | 2010-06-03 09:31:09 +0000 | [diff] [blame] | 297 | <property name="sourceUpdatesDir" value="${testsUpdatesDirBase}/eclipse"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 298 | <property name="targetEclipseDir" value="${baseLocation}"/> |
| 299 | </ant> |
Stephan Herrmann | 8372dc2 | 2010-06-03 22:41:05 +0000 | [diff] [blame] | 300 | |
| 301 | <!-- pre-load updateSite with published releases: --> |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 302 | <!-- don't use previous artifacts during the transition to OTDRE: |
Stephan Herrmann | 0c9b572 | 2010-06-04 22:13:03 +0000 | [diff] [blame] | 303 | <mkdir dir="${otdtUpdatesDir}/plugins"/> |
| 304 | <mkdir dir="${otdtUpdatesDir}/features"/> |
| 305 | <exec executable="/bin/sh"> |
| 306 | <arg value="-c"/> |
| 307 | <arg value="ln -s ${published.updates}/features/* ${otdtUpdatesDir}/features/"/> |
| 308 | </exec> |
| 309 | <exec executable="/bin/sh"> |
| 310 | <arg value="-c"/> |
| 311 | <arg value="ln -s ${published.updates}/plugins/* ${otdtUpdatesDir}/plugins/"/> |
| 312 | </exec> |
Stephan Herrmann | a5b8dbf | 2015-10-18 17:46:21 +0200 | [diff] [blame] | 313 | --> |
Stephan Herrmann | 8372dc2 | 2010-06-03 22:41:05 +0000 | [diff] [blame] | 314 | <!-- pre-load category-less metadata: --> |
Stephan Herrmann | a5b8dbf | 2015-10-18 17:46:21 +0200 | [diff] [blame] | 315 | <!-- |
Stephan Herrmann | 8372dc2 | 2010-06-03 22:41:05 +0000 | [diff] [blame] | 316 | <copy failonerror="false" flatten="true" toDir="${otdtUpdatesDir}"> |
| 317 | <fileset dir="${user.dir}/metadata"> |
| 318 | <include name="*.xml"/> |
| 319 | </fileset> |
| 320 | </copy> |
Stephan Herrmann | a5b8dbf | 2015-10-18 17:46:21 +0200 | [diff] [blame] | 321 | --> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 322 | |
| 323 | <echo message="Invoke pdebuild for creating a full OTDT"/> |
| 324 | <java |
| 325 | inputstring="" |
Stephan Herrmann | 84a4f63 | 2019-04-13 20:36:08 +0200 | [diff] [blame] | 326 | dir="${bootLocation}" |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 327 | fork="true" |
| 328 | classname="org.eclipse.equinox.launcher.Main" |
Stephan Herrmann | 3b9c6ee | 2019-07-20 17:17:41 +0200 | [diff] [blame] | 329 | classpath="${bootLocation}/plugins/${org.eclipse.equinox.launcher_jar}"> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 330 | <arg value="-clean"/> |
| 331 | <arg value="-Dosgi.ws=${ws}"/> |
| 332 | <arg value="-Dosgi.os=${os}"/> |
| 333 | <arg value="-Dosgi.arch=${arch}"/> |
| 334 | <arg value="-application"/> |
| 335 | <arg value="org.eclipse.ant.core.antRunner"/> |
| 336 | <arg value="-buildfile"/> |
| 337 | <arg value="${buildfile}"/> |
| 338 | <arg value="-Dbuild.root.dir=${build.root.dir}"/> |
Stephan Herrmann | 1c25fec | 2019-04-13 20:44:20 +0200 | [diff] [blame] | 339 | <arg value="-DbootLocation=${bootLocation}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 340 | <arg value="-DbaseLocation=${baseLocation}"/> |
Stephan Herrmann | 4d4276f | 2019-04-13 22:06:31 +0200 | [diff] [blame] | 341 | <arg value="-DtransformedRepoLocation=${baseLocation}"/> <!-- fetch jars into target --> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 342 | <arg value="-Drun.eclipseScriptDir=${run.eclipseScriptDir}"/> |
| 343 | <arg value="-DOTScriptDir=${OTScriptDir}"/> |
| 344 | <arg value="-Dbuilder=${builder-otdt}"/> |
| 345 | <arg value="-D${installmode}=true"/> |
| 346 | <arg value="-Dcomponent.short=OTDT-Build"/> |
| 347 | <arg value="-DotdtUpdatesDir=${otdtUpdatesDir}"/> |
Stephan Herrmann | 20ff77c | 2010-06-03 09:31:09 +0000 | [diff] [blame] | 348 | <arg value="-DtestsUpdatesDirBase=${testsUpdatesDirBase}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 349 | <arg value="-Dbaseos=${os}"/> |
| 350 | <arg value="-Dbasews=${ws}"/> |
| 351 | <arg value="-Dbasearch=${arch}"/> |
| 352 | <arg value="-Dtest.root.dir=${test.root.dir}"/> |
| 353 | <arg value="-Dtest.eclipseDir=${test.eclipseDir}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 354 | <arg value="-DmapVersionTag=${mapVersionTag}"/> |
Stephan Herrmann | 414d073 | 2016-11-01 11:43:14 +0100 | [diff] [blame] | 355 | <arg value="-Dmap.file.path=${map.file.path}"/> |
| 356 | <arg value="-DfetchCacheLocation=${fetchCacheLocation}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 357 | <arg value="-Ddo.run.tests=${do.run.tests}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 358 | <arg value="-Declipse-app.tgz=${eclipse-app.tgz}"/> |
| 359 | <arg value="-Declipse.tests.zip=${eclipse.tests.zip}"/> |
Stephan Herrmann | eacdfde | 2010-08-25 05:58:42 +0000 | [diff] [blame] | 360 | <!--arg value="-verbose" /--> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 361 | <jvmarg value="${vm.args}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 362 | <!-- arg value="${verboseAnt}"/ --> |
| 363 | <!-- arg value="-debug" / --> |
| 364 | </java> |
Stephan Herrmann | 20ff77c | 2010-06-03 09:31:09 +0000 | [diff] [blame] | 365 | <!-- At this point a local update site exists, thanks to p2gathering=true --> |
Stephan Herrmann | 99e184d | 2010-06-11 17:27:25 +0000 | [diff] [blame] | 366 | |
Stephan Herrmann | 3110174 | 2019-05-23 19:11:12 +0200 | [diff] [blame] | 367 | <ant antfile="${OTScriptDir}/p2helper.xml" target="patchMetadata" dir="${otdtUpdatesDir}"/> |
| 368 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 369 | <property name="_hasCreatedOTDTEclipse" value="true" /> |
| 370 | </target> |
| 371 | |
| 372 | <!-- TESTING at STAGE 3: --> |
Stephan Herrmann | 21972f6 | 2021-03-04 19:29:10 +0100 | [diff] [blame] | 373 | <!-- assumed from previous invocation: depends="createOTDTEclipse" --> |
| 374 | <target name="setupTests" description="Install the tests into an fresh OTDT"> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 375 | <available file="${buildDirectory}/label.properties" property="label.properties.exists" /> |
| 376 | <ant antfile="${OTScriptDir}/test.xml" target="setupTests" dir="${build.root.dir}"> |
| 377 | <property name="os" value="${os}" /> |
| 378 | <property name="ws" value="${ws}" /> |
| 379 | <property name="arch" value="${arch}" /> |
| 380 | <property name="baseos" value="${os}" /> |
| 381 | <property name="basews" value="${ws}" /> |
| 382 | <property name="basearch" value="${arch}" /> |
| 383 | <property name="eclipse-app.tgz" value="${eclipse-app.tgz}" /> |
| 384 | <property file="${buildDirectory}/label.properties" /> |
| 385 | <property name="otdtUpdatesDir" value="${otdtUpdatesDir}" /> |
Stephan Herrmann | 20ff77c | 2010-06-03 09:31:09 +0000 | [diff] [blame] | 386 | <property name="testsUpdatesDirBase" value="${testsUpdatesDirBase}" /> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 387 | </ant> |
| 388 | </target> |
| 389 | |
| 390 | <target name="runAllTests" description="Delegate to the next level script to perform the actual testing."> |
| 391 | <ant antfile="${OTScriptDir}/test.xml" target="all" dir="${build.root.dir}"> |
| 392 | <property name="os" value="${os}" /> |
| 393 | <property name="ws" value="${ws}" /> |
| 394 | <property name="arch" value="${arch}" /> |
| 395 | <property name="baseos" value="${os}" /> |
| 396 | <property name="basews" value="${ws}" /> |
| 397 | <property name="basearch" value="${arch}" /> |
| 398 | <property name="otdtUpdatesDir" value="${otdtUpdatesDir}" /> |
Stephan Herrmann | 20ff77c | 2010-06-03 09:31:09 +0000 | [diff] [blame] | 399 | <property name="testsUpdatesDirBase" value="${testsUpdatesDirBase}" /> |
Stephan Herrmann | 56428e9 | 2013-02-23 12:29:56 +0100 | [diff] [blame] | 400 | <property name="test.tmpDir" value="${test.tmpDir}"/> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 401 | <property name="vmargs" value="${vmargs}" /> |
| 402 | </ant> |
| 403 | </target> |
| 404 | |
Stephan Herrmann | d8c8165 | 2010-11-06 15:01:14 +0000 | [diff] [blame] | 405 | <target name="runOTDTTests" description="Delegate to the next level script to perform the actual testing."> |
| 406 | <ant antfile="${OTScriptDir}/test.xml" target="otdt-tests" dir="${build.root.dir}"> |
| 407 | <property name="os" value="${os}" /> |
| 408 | <property name="ws" value="${ws}" /> |
| 409 | <property name="arch" value="${arch}" /> |
| 410 | <property name="baseos" value="${os}" /> |
| 411 | <property name="basews" value="${ws}" /> |
| 412 | <property name="basearch" value="${arch}" /> |
| 413 | <property name="otdtUpdatesDir" value="${otdtUpdatesDir}" /> |
| 414 | <property name="testsUpdatesDirBase" value="${testsUpdatesDirBase}" /> |
Stephan Herrmann | 56428e9 | 2013-02-23 12:29:56 +0100 | [diff] [blame] | 415 | <property name="test.tmpDir" value="${test.tmpDir}"/> |
Stephan Herrmann | d8c8165 | 2010-11-06 15:01:14 +0000 | [diff] [blame] | 416 | <property name="vmargs" value="${vmargs}" /> |
| 417 | </ant> |
| 418 | </target> |
| 419 | |
Stephan Herrmann | eb0f292 | 2018-08-09 13:27:26 +0200 | [diff] [blame] | 420 | <target name="runOnlyoneTests" description="Delegate to the next level script to perform the actual testing."> |
| 421 | <ant antfile="${OTScriptDir}/test.xml" target="onlyone" dir="${build.root.dir}"> |
| 422 | <property name="os" value="${os}" /> |
| 423 | <property name="ws" value="${ws}" /> |
| 424 | <property name="arch" value="${arch}" /> |
| 425 | <property name="baseos" value="${os}" /> |
| 426 | <property name="basews" value="${ws}" /> |
| 427 | <property name="basearch" value="${arch}" /> |
| 428 | <property name="otdtUpdatesDir" value="${otdtUpdatesDir}" /> |
| 429 | <property name="testsUpdatesDirBase" value="${testsUpdatesDirBase}" /> |
| 430 | <property name="test.tmpDir" value="${test.tmpDir}"/> |
| 431 | <property name="vmargs" value="${vmargs}" /> |
| 432 | </ant> |
| 433 | </target> |
| 434 | |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 435 | <!-- currently unused target name="collectResults"> |
Stephan Herrmann | a1eeb30 | 2013-04-29 23:51:25 +0200 | [diff] [blame] | 436 | <ant target="collect" antfile="${test.root.dir}/library.xml" dir="${otresults}"> |
Stephan Herrmann | dcd87c1 | 2010-04-25 10:59:27 +0000 | [diff] [blame] | 437 | <property name="includes" value="org.*.xml"/> |
| 438 | <property name="output-file" value="AllTestSuites.xml"/> |
| 439 | </ant> |
| 440 | </target --> |
| 441 | |
| 442 | </project> |