nickboldt | 03a6f08 | 2019-02-12 15:17:11 -0500 | [diff] [blame] | 1 | <!-- |
| 2 | Copyright (c) 2005, 2019 IBM Corporation and others. |
| 3 | This program and the accompanying materials |
| 4 | are made available under the terms of the Eclipse Public License 2.0 |
| 5 | which accompanies this distribution, and is available at |
| 6 | https://www.eclipse.org/legal/epl-2.0/ |
| 7 | |
| 8 | SPDX-License-Identifier: EPL-2.0 |
| 9 | |
| 10 | Contributors: |
| 11 | IBM Corporation - initial API and implementation |
| 12 | --> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 13 | <project |
| 14 | name="build" |
| 15 | default="build" |
| 16 | basedir="."> |
david_williams | 67d2770 | 2006-11-20 16:36:52 +0000 | [diff] [blame] | 17 | |
david_williams | 3830fa6 | 2008-01-10 01:39:59 +0000 | [diff] [blame] | 18 | |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 19 | <!-- main --> |
| 20 | <target |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 21 | name="build" |
tle | 904471a | 2011-12-19 20:07:16 +0000 | [diff] [blame] | 22 | depends="init, preBuild" |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 23 | if="build_distro_target_exists"> |
david_williams | ef62fc4 | 2011-03-18 02:33:39 +0000 | [diff] [blame] | 24 | |
| 25 | <!-- remove eclipse builder at start of every major build, so it will be reinstalled --> |
| 26 | |
david_williams | 14cadd1 | 2011-03-23 06:43:39 +0000 | [diff] [blame] | 27 | <delete |
| 28 | failonerror="true" |
| 29 | quiet="true" |
| 30 | dir="${eclipse.builder.base.install.dir}"/> |
david_williams | ef62fc4 | 2011-03-18 02:33:39 +0000 | [diff] [blame] | 31 | |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 32 | <property |
| 33 | name="buildfile" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 34 | value="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 35 | <echo |
david_williams | 70e7c7f | 2008-01-08 04:02:12 +0000 | [diff] [blame] | 36 | level="info" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 37 | message="buildfile: ${buildfile}"/> |
| 38 | <!-- build --> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 39 | <ant antfile="${buildfile}"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 40 | </target> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 41 | <target |
| 42 | name="site" |
| 43 | depends="init" |
| 44 | if="site_distro_target_exists"> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 45 | <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"></ant> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 46 | </target> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 47 | <target |
| 48 | name="test" |
david_williams | 51bc3bd | 2010-08-24 03:32:43 +0000 | [diff] [blame] | 49 | depends="init,markIfNoTests" |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 50 | if="tests_distro_target_exists"> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 51 | <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 52 | <property |
| 53 | name="testRoot" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 54 | value="${env.PROJECT_TESTS}/${projectname}"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 55 | <property |
| 56 | name="dependencyTargets" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 57 | value="${wtp.builder.home}/scripts/dependency/build.xml"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 58 | <property |
| 59 | name="local.cache.dir" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 60 | value="${env.LOCAL_PREREQS_CACHE}"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 61 | </ant> |
| 62 | </target> |
david_williams | 9c32af1 | 2010-09-26 04:46:26 +0000 | [diff] [blame] | 63 | <target |
| 64 | name="package" |
| 65 | depends="init" |
| 66 | if="package_distro_target_exists"> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 67 | <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml"> |
david_williams | 8994edf | 2010-09-26 03:49:34 +0000 | [diff] [blame] | 68 | |
david_williams | 9c32af1 | 2010-09-26 04:46:26 +0000 | [diff] [blame] | 69 | </ant> |
| 70 | </target> |
david_williams | 7e568c7 | 2010-09-12 09:04:15 +0000 | [diff] [blame] | 71 | <target |
| 72 | name="markIfNoTests" |
| 73 | unless="tests_distro_target_exists"> |
| 74 | |
| 75 | <echo |
david_williams | 99658fe | 2010-09-17 14:21:00 +0000 | [diff] [blame] | 76 | message="This build for ${build.distribution} (${projectname}) provided no unit tests" |
david_williams | 7e568c7 | 2010-09-12 09:04:15 +0000 | [diff] [blame] | 77 | file="${buildDirectory}/${buildLabel}/noTestsProvided.txt"/> |
| 78 | |
| 79 | </target> |
david_williams | 9e7f584 | 2011-03-06 03:32:03 +0000 | [diff] [blame] | 80 | |
| 81 | <!-- we dont' use 'upload' any longer ... TODO: remove? --> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 82 | <target |
| 83 | name="upload" |
| 84 | depends="init" |
| 85 | if="upload_distro_target_exists"> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 86 | <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 87 | </target> |
david_williams | 51bc3bd | 2010-08-24 03:32:43 +0000 | [diff] [blame] | 88 | |
david_williams | b641ce3 | 2008-07-01 03:36:40 +0000 | [diff] [blame] | 89 | <!-- |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 90 | init: 1) set buildBranch property 2) call label.xml to create |
| 91 | label.properties file in <BUILD HOME>/projects/<project>/workdir |
| 92 | 3) check for existence of build.xml file for each of the build, |
| 93 | test, upload, site distribution locations and set properties |
david_williams | b641ce3 | 2008-07-01 03:36:40 +0000 | [diff] [blame] | 94 | --> |
david_williams | 14cadd1 | 2011-03-23 06:43:39 +0000 | [diff] [blame] | 95 | <target |
| 96 | name="init" |
| 97 | unless="buildInitialized"> |
| 98 | |
| 99 | |
| 100 | <!-- = = = standard properties pattern = = = --> |
| 101 | <!-- |
| 102 | Note to be cross-platform, "environment variables" are only |
| 103 | appropriate for some variables, e.g. ones we set, since |
| 104 | properties are case sensitive, even if the environment variables |
| 105 | on your operating system are not, e.g. it will be ${env.Path} |
| 106 | not ${env.PATH} on Windows |
| 107 | --> |
| 108 | <property environment="env"/> |
| 109 | <!-- |
| 110 | Let users override standard properties, if desired. If |
| 111 | directory, file, or some properties do not exist, then standard |
| 112 | properties will be used. |
| 113 | --> |
| 114 | <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/> |
| 115 | <property |
| 116 | name="keyCfgFile" |
| 117 | value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/> |
| 118 | <echo |
| 119 | level="debug" |
| 120 | message="keyCfgFile: ${keyCfgFile}"/> |
| 121 | <property file="${keyCfgFile}"/> |
| 122 | |
| 123 | <!-- TODO: I don't think this is loaded here. Wrong basedir? --> |
| 124 | <property file="${ant.project.name}.properties"/> |
| 125 | |
| 126 | |
| 127 | <!-- = = = end standard properties pattern = = = --> |
| 128 | <fail |
| 129 | unless="build.distribution" |
| 130 | message="build.distribution must be specified"/> |
| 131 | <echo message="build.distribution: ${build.distribution}"/> |
| 132 | |
| 133 | |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 134 | <dirname |
| 135 | file="${ant.file}" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 136 | property="wtp.builder.home"/> |
david_williams | 9e7f584 | 2011-03-06 03:32:03 +0000 | [diff] [blame] | 137 | |
| 138 | |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 139 | <!-- if not set above, assume R3.2.0 --> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 140 | <!-- this happens, for example, when using a "tempTest" branch --> |
| 141 | <property |
| 142 | name="buildBranch" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 143 | value="R3.2.0"/> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 144 | <touch file="${user.home}/.cvspass"/> |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 145 | <!-- |
| 146 | strip trailing blanks. Seems either Eclipse, or CVS make it |
| 147 | hard to not have trailing spaces |
| 148 | --> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 149 | <replaceregexp |
| 150 | flags="gm" |
| 151 | file="${wtp.builder.home}/build.properties" |
| 152 | match=" *$" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 153 | replace=""/> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 154 | <property file="${wtp.builder.home}/build.properties"/> |
david_williams | b641ce3 | 2008-07-01 03:36:40 +0000 | [diff] [blame] | 155 | |
david_williams | 1ae2030 | 2010-09-11 01:34:56 +0000 | [diff] [blame] | 156 | <!-- create label.properties file (if doesn't exist)--> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 157 | <ant antfile="${wtp.builder.home}/scripts/build/label.xml"/> |
| 158 | <property file="${buildDirectory}/label.properties"/> |
david_williams | 1e71b28 | 2008-03-10 10:12:40 +0000 | [diff] [blame] | 159 | <echo |
| 160 | level="info" |
david_williams | 1ae2030 | 2010-09-11 01:34:56 +0000 | [diff] [blame] | 161 | message="label file: ${buildDirectory}/label.properties"/> |
| 162 | |
david_williams | 7e568c7 | 2010-09-12 09:04:15 +0000 | [diff] [blame] | 163 | |
| 164 | |
| 165 | <property |
david_williams | 95d4652 | 2008-01-09 23:59:12 +0000 | [diff] [blame] | 166 | name="build.distribution" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 167 | value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 168 | <available |
david_williams | 3830fa6 | 2008-01-10 01:39:59 +0000 | [diff] [blame] | 169 | file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml" |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 170 | type="file" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 171 | property="build_distro_target_exists"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 172 | <available |
david_williams | 3830fa6 | 2008-01-10 01:39:59 +0000 | [diff] [blame] | 173 | file="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml" |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 174 | type="file" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 175 | property="site_distro_target_exists"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 176 | <available |
david_williams | 3830fa6 | 2008-01-10 01:39:59 +0000 | [diff] [blame] | 177 | file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml" |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 178 | type="file" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 179 | property="tests_distro_target_exists"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 180 | <available |
david_williams | 3830fa6 | 2008-01-10 01:39:59 +0000 | [diff] [blame] | 181 | file="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml" |
david_williams | 403beae | 2007-12-09 02:10:40 +0000 | [diff] [blame] | 182 | type="file" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 183 | property="upload_distro_target_exists"/> |
david_williams | 2398e36 | 2011-03-05 02:45:39 +0000 | [diff] [blame] | 184 | <available |
| 185 | file="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml" |
| 186 | type="file" |
david_williams | 9e7f584 | 2011-03-06 03:32:03 +0000 | [diff] [blame] | 187 | property="package_distro_target_exists"/> |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 188 | <!-- |
| 189 | fetch the HEAD stream of all projects if build type |
| 190 | specified as N |
| 191 | --> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 192 | <condition |
| 193 | property="fetchTag" |
Carl Anderson | 3cf4340 | 2012-08-15 12:27:17 -0400 | [diff] [blame] | 194 | value="CVS=HEAD,GIT=origin/master"> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 195 | <equals |
| 196 | arg1="${buildType}" |
david_williams | e04a778 | 2009-10-14 05:06:49 +0000 | [diff] [blame] | 197 | arg2="N"/> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 198 | </condition> |
david_williams | 14cadd1 | 2011-03-23 06:43:39 +0000 | [diff] [blame] | 199 | |
| 200 | <property |
| 201 | name="buildInitialized" |
| 202 | value="true"/> |
| 203 | |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 204 | </target> |
tle | 904471a | 2011-12-19 20:07:16 +0000 | [diff] [blame] | 205 | <!-- |
| 206 | Steps to do before running a build. |
| 207 | --> |
| 208 | <target name="preBuild"> |
| 209 | <!-- Verify that cvs is installed before starting a build. --> |
| 210 | <ant antfile="${wtp.builder.home}/scripts/build/checkSystemPrereq.xml"> |
| 211 | <property |
| 212 | name="commandName" |
| 213 | value="cvs"/> |
| 214 | <property |
| 215 | name="arguments" |
| 216 | value="--version"/> |
| 217 | </ant> |
| 218 | |
| 219 | <!-- Verify that grep is installed. --> |
| 220 | <ant antfile="${wtp.builder.home}/scripts/build/checkSystemPrereq.xml"> |
| 221 | <property |
| 222 | name="commandName" |
| 223 | value="grep"/> |
| 224 | <property |
| 225 | name="arguments" |
| 226 | value="--version"/> |
| 227 | </ant> |
| 228 | |
| 229 | <echo message="All build system prereqs passed"/> |
| 230 | </target> |
david_williams | 70e7c7f | 2008-01-08 04:02:12 +0000 | [diff] [blame] | 231 | </project> |