blob: a85a3054f2d194edb5b358cab7d03c657c44ea63 [file] [log] [blame]
david_williams9e5f0a92007-08-29 00:09:02 +00001<project
2 name="build"
3 default="build"
4 basedir=".">
david_williams67d27702006-11-20 16:36:52 +00005
david_williams3830fa62008-01-10 01:39:59 +00006
david_williamse04a7782009-10-14 05:06:49 +00007 <!-- main -->
8 <target
david_williams9e5f0a92007-08-29 00:09:02 +00009 name="build"
tle904471a2011-12-19 20:07:16 +000010 depends="init, preBuild"
david_williams9e5f0a92007-08-29 00:09:02 +000011 if="build_distro_target_exists">
david_williamsef62fc42011-03-18 02:33:39 +000012
13 <!-- remove eclipse builder at start of every major build, so it will be reinstalled -->
14
david_williams14cadd12011-03-23 06:43:39 +000015 <delete
16 failonerror="true"
17 quiet="true"
18 dir="${eclipse.builder.base.install.dir}"/>
david_williamsef62fc42011-03-18 02:33:39 +000019
david_williams9e5f0a92007-08-29 00:09:02 +000020 <property
21 name="buildfile"
david_williamse04a7782009-10-14 05:06:49 +000022 value="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000023 <echo
david_williams70e7c7f2008-01-08 04:02:12 +000024 level="info"
david_williamse04a7782009-10-14 05:06:49 +000025 message="buildfile: ${buildfile}"/>
26 <!-- build -->
david_williams2398e362011-03-05 02:45:39 +000027 <ant antfile="${buildfile}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000028 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000029 <target
30 name="site"
31 depends="init"
32 if="site_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000033 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"></ant>
david_williams9e5f0a92007-08-29 00:09:02 +000034 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000035 <target
36 name="test"
david_williams51bc3bd2010-08-24 03:32:43 +000037 depends="init,markIfNoTests"
david_williams9e5f0a92007-08-29 00:09:02 +000038 if="tests_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000039 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml">
david_williams9e5f0a92007-08-29 00:09:02 +000040 <property
41 name="testRoot"
david_williamse04a7782009-10-14 05:06:49 +000042 value="${env.PROJECT_TESTS}/${projectname}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000043 <property
44 name="dependencyTargets"
david_williamse04a7782009-10-14 05:06:49 +000045 value="${wtp.builder.home}/scripts/dependency/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000046 <property
47 name="local.cache.dir"
david_williamse04a7782009-10-14 05:06:49 +000048 value="${env.LOCAL_PREREQS_CACHE}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000049 </ant>
50 </target>
david_williams9c32af12010-09-26 04:46:26 +000051 <target
52 name="package"
53 depends="init"
54 if="package_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000055 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml">
david_williams8994edf2010-09-26 03:49:34 +000056
david_williams9c32af12010-09-26 04:46:26 +000057 </ant>
58 </target>
david_williams7e568c72010-09-12 09:04:15 +000059 <target
60 name="markIfNoTests"
61 unless="tests_distro_target_exists">
62
63 <echo
david_williams99658fe2010-09-17 14:21:00 +000064 message="This build for ${build.distribution} (${projectname}) provided no unit tests"
david_williams7e568c72010-09-12 09:04:15 +000065 file="${buildDirectory}/${buildLabel}/noTestsProvided.txt"/>
66
67 </target>
david_williams9e7f5842011-03-06 03:32:03 +000068
69 <!-- we dont' use 'upload' any longer ... TODO: remove? -->
david_williams9e5f0a92007-08-29 00:09:02 +000070 <target
71 name="upload"
72 depends="init"
73 if="upload_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000074 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000075 </target>
david_williams51bc3bd2010-08-24 03:32:43 +000076
david_williamsb641ce32008-07-01 03:36:40 +000077 <!--
david_williamse04a7782009-10-14 05:06:49 +000078 init: 1) set buildBranch property 2) call label.xml to create
79 label.properties file in <BUILD HOME>/projects/<project>/workdir
80 3) check for existence of build.xml file for each of the build,
81 test, upload, site distribution locations and set properties
david_williamsb641ce32008-07-01 03:36:40 +000082 -->
david_williams14cadd12011-03-23 06:43:39 +000083 <target
84 name="init"
85 unless="buildInitialized">
86
87
88 <!-- = = = standard properties pattern = = = -->
89 <!--
90 Note to be cross-platform, "environment variables" are only
91 appropriate for some variables, e.g. ones we set, since
92 properties are case sensitive, even if the environment variables
93 on your operating system are not, e.g. it will be ${env.Path}
94 not ${env.PATH} on Windows
95 -->
96 <property environment="env"/>
97 <!--
98 Let users override standard properties, if desired. If
99 directory, file, or some properties do not exist, then standard
100 properties will be used.
101 -->
102 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
103 <property
104 name="keyCfgFile"
105 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
106 <echo
107 level="debug"
108 message="keyCfgFile: ${keyCfgFile}"/>
109 <property file="${keyCfgFile}"/>
110
111 <!-- TODO: I don't think this is loaded here. Wrong basedir? -->
112 <property file="${ant.project.name}.properties"/>
113
114
115 <!-- = = = end standard properties pattern = = = -->
116 <fail
117 unless="build.distribution"
118 message="build.distribution must be specified"/>
119 <echo message="build.distribution: ${build.distribution}"/>
120
121
david_williams9e5f0a92007-08-29 00:09:02 +0000122 <dirname
123 file="${ant.file}"
david_williamse04a7782009-10-14 05:06:49 +0000124 property="wtp.builder.home"/>
david_williams9e7f5842011-03-06 03:32:03 +0000125
126
david_williamse04a7782009-10-14 05:06:49 +0000127 <!-- if not set above, assume R3.2.0 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000128 <!-- this happens, for example, when using a "tempTest" branch -->
129 <property
130 name="buildBranch"
david_williamse04a7782009-10-14 05:06:49 +0000131 value="R3.2.0"/>
david_williams2398e362011-03-05 02:45:39 +0000132 <touch file="${user.home}/.cvspass"/>
david_williamse04a7782009-10-14 05:06:49 +0000133 <!--
134 strip trailing blanks. Seems either Eclipse, or CVS make it
135 hard to not have trailing spaces
136 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000137 <replaceregexp
138 flags="gm"
139 file="${wtp.builder.home}/build.properties"
140 match=" *$"
david_williamse04a7782009-10-14 05:06:49 +0000141 replace=""/>
david_williams2398e362011-03-05 02:45:39 +0000142 <property file="${wtp.builder.home}/build.properties"/>
david_williamsb641ce32008-07-01 03:36:40 +0000143
david_williams1ae20302010-09-11 01:34:56 +0000144 <!-- create label.properties file (if doesn't exist)-->
david_williams2398e362011-03-05 02:45:39 +0000145 <ant antfile="${wtp.builder.home}/scripts/build/label.xml"/>
146 <property file="${buildDirectory}/label.properties"/>
david_williams1e71b282008-03-10 10:12:40 +0000147 <echo
148 level="info"
david_williams1ae20302010-09-11 01:34:56 +0000149 message="label file: ${buildDirectory}/label.properties"/>
150
david_williams7e568c72010-09-12 09:04:15 +0000151
152
153 <property
david_williams95d46522008-01-09 23:59:12 +0000154 name="build.distribution"
david_williamse04a7782009-10-14 05:06:49 +0000155 value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000156 <available
david_williams3830fa62008-01-10 01:39:59 +0000157 file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000158 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000159 property="build_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000160 <available
david_williams3830fa62008-01-10 01:39:59 +0000161 file="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000162 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000163 property="site_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000164 <available
david_williams3830fa62008-01-10 01:39:59 +0000165 file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000166 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000167 property="tests_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000168 <available
david_williams3830fa62008-01-10 01:39:59 +0000169 file="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000170 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000171 property="upload_distro_target_exists"/>
david_williams2398e362011-03-05 02:45:39 +0000172 <available
173 file="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml"
174 type="file"
david_williams9e7f5842011-03-06 03:32:03 +0000175 property="package_distro_target_exists"/>
david_williamse04a7782009-10-14 05:06:49 +0000176 <!--
177 fetch the HEAD stream of all projects if build type
178 specified as N
179 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000180 <condition
181 property="fetchTag"
Carl Anderson3cf43402012-08-15 12:27:17 -0400182 value="CVS=HEAD,GIT=origin/master">
david_williams9e5f0a92007-08-29 00:09:02 +0000183 <equals
184 arg1="${buildType}"
david_williamse04a7782009-10-14 05:06:49 +0000185 arg2="N"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000186 </condition>
david_williams14cadd12011-03-23 06:43:39 +0000187
188 <property
189 name="buildInitialized"
190 value="true"/>
191
david_williams9e5f0a92007-08-29 00:09:02 +0000192 </target>
tle904471a2011-12-19 20:07:16 +0000193 <!--
194 Steps to do before running a build.
195 -->
196 <target name="preBuild">
197 <!-- Verify that cvs is installed before starting a build. -->
198 <ant antfile="${wtp.builder.home}/scripts/build/checkSystemPrereq.xml">
199 <property
200 name="commandName"
201 value="cvs"/>
202 <property
203 name="arguments"
204 value="--version"/>
205 </ant>
206
207 <!-- Verify that grep is installed. -->
208 <ant antfile="${wtp.builder.home}/scripts/build/checkSystemPrereq.xml">
209 <property
210 name="commandName"
211 value="grep"/>
212 <property
213 name="arguments"
214 value="--version"/>
215 </ant>
216
217 <echo message="All build system prereqs passed"/>
218 </target>
david_williams70e7c7f2008-01-08 04:02:12 +0000219</project>