blob: 1e15ae1f795beda4f7aa06ceb6d98fa72482d924 [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_williams9e5f0a92007-08-29 00:09:02 +00006 <!-- = = = standard properties pattern = = = -->
david_williamse04a7782009-10-14 05:06:49 +00007 <!--
8 Note to be cross-platform, "environment variables" are only
9 appropriate for some variables, e.g. ones we set, since
10 properties are case sensitive, even if the environment variables
11 on your operating system are not, e.g. it will be ${env.Path}
12 not ${env.PATH} on Windows
david_williams403beae2007-12-09 02:10:40 +000013 -->
david_williamse04a7782009-10-14 05:06:49 +000014 <property
15 environment="env"/>
16 <!--
17 Let users override standard properties, if desired. If
18 directory, file, or some properties do not exist, then standard
19 properties will be used.
20 -->
21 <property
22 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
david_williams9e5f0a92007-08-29 00:09:02 +000023 <property
david_williamsb641ce32008-07-01 03:36:40 +000024 name="keyCfgFile"
david_williamse04a7782009-10-14 05:06:49 +000025 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
26 <echo
27 level="debug"
28 message="keyCfgFile: ${keyCfgFile}"/>
29 <property
30 file="${keyCfgFile}"/>
david_williams92d59912010-06-07 16:07:48 +000031
32 <!-- TODO: I don't think this is loaded here. Wrong basedir? -->
david_williamse04a7782009-10-14 05:06:49 +000033 <property
34 file="${ant.project.name}.properties"/>
david_williams92d59912010-06-07 16:07:48 +000035
36
37 <!-- = = = end standard properties pattern = = = -->
david_williamsb641ce32008-07-01 03:36:40 +000038 <fail
39 unless="build.distribution"
david_williamse04a7782009-10-14 05:06:49 +000040 message="build.distribution must be specified"/>
41 <echo
42 message="build.distribution: ${build.distribution}"/>
david_williams3830fa62008-01-10 01:39:59 +000043
david_williamse04a7782009-10-14 05:06:49 +000044 <!-- main -->
45 <target
david_williams9e5f0a92007-08-29 00:09:02 +000046 name="build"
47 depends="init"
48 if="build_distro_target_exists">
49 <property
50 name="buildfile"
david_williamse04a7782009-10-14 05:06:49 +000051 value="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000052 <echo
david_williams70e7c7f2008-01-08 04:02:12 +000053 level="info"
david_williamse04a7782009-10-14 05:06:49 +000054 message="buildfile: ${buildfile}"/>
55 <!-- build -->
56 <ant
57 antfile="${buildfile}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000058 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000059 <target
60 name="site"
61 depends="init"
62 if="site_distro_target_exists">
david_williamse04a7782009-10-14 05:06:49 +000063 <ant
64 antfile="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"></ant>
david_williams9e5f0a92007-08-29 00:09:02 +000065 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000066 <target
67 name="test"
david_williams51bc3bd2010-08-24 03:32:43 +000068 depends="init,markIfNoTests"
david_williams9e5f0a92007-08-29 00:09:02 +000069 if="tests_distro_target_exists">
david_williamse04a7782009-10-14 05:06:49 +000070 <ant
71 antfile="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml">
david_williams9e5f0a92007-08-29 00:09:02 +000072 <property
73 name="testRoot"
david_williamse04a7782009-10-14 05:06:49 +000074 value="${env.PROJECT_TESTS}/${projectname}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000075 <property
76 name="dependencyTargets"
david_williamse04a7782009-10-14 05:06:49 +000077 value="${wtp.builder.home}/scripts/dependency/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000078 <property
79 name="local.cache.dir"
david_williamse04a7782009-10-14 05:06:49 +000080 value="${env.LOCAL_PREREQS_CACHE}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000081 </ant>
82 </target>
david_williams9c32af12010-09-26 04:46:26 +000083 <target
84 name="package"
85 depends="init"
86 if="package_distro_target_exists">
87 <ant
88 antfile="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml">
david_williams8994edf2010-09-26 03:49:34 +000089
david_williams9c32af12010-09-26 04:46:26 +000090 </ant>
91 </target>
david_williams7e568c72010-09-12 09:04:15 +000092 <target
93 name="markIfNoTests"
94 unless="tests_distro_target_exists">
95
96 <echo
david_williams99658fe2010-09-17 14:21:00 +000097 message="This build for ${build.distribution} (${projectname}) provided no unit tests"
david_williams7e568c72010-09-12 09:04:15 +000098 file="${buildDirectory}/${buildLabel}/noTestsProvided.txt"/>
99
100 </target>
david_williams51bc3bd2010-08-24 03:32:43 +0000101
102 <!-- we dont' use 'upload' any longer ... TODO: remove? -->
david_williams9e5f0a92007-08-29 00:09:02 +0000103 <target
104 name="upload"
105 depends="init"
106 if="upload_distro_target_exists">
david_williamse04a7782009-10-14 05:06:49 +0000107 <ant
108 antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000109 </target>
david_williams51bc3bd2010-08-24 03:32:43 +0000110
david_williamsb641ce32008-07-01 03:36:40 +0000111 <!--
david_williamse04a7782009-10-14 05:06:49 +0000112 init: 1) set buildBranch property 2) call label.xml to create
113 label.properties file in <BUILD HOME>/projects/<project>/workdir
114 3) check for existence of build.xml file for each of the build,
115 test, upload, site distribution locations and set properties
david_williamsb641ce32008-07-01 03:36:40 +0000116 -->
david_williamse04a7782009-10-14 05:06:49 +0000117 <target
118 name="init">
david_williams9e5f0a92007-08-29 00:09:02 +0000119 <dirname
120 file="${ant.file}"
david_williamse04a7782009-10-14 05:06:49 +0000121 property="wtp.builder.home"/>
122
david_williams92d59912010-06-07 16:07:48 +0000123
david_williamse04a7782009-10-14 05:06:49 +0000124 <!-- if not set above, assume R3.2.0 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000125 <!-- this happens, for example, when using a "tempTest" branch -->
126 <property
127 name="buildBranch"
david_williamse04a7782009-10-14 05:06:49 +0000128 value="R3.2.0"/>
129 <touch
130 file="${user.home}/.cvspass"/>
131 <!--
132 strip trailing blanks. Seems either Eclipse, or CVS make it
133 hard to not have trailing spaces
134 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000135 <replaceregexp
136 flags="gm"
137 file="${wtp.builder.home}/build.properties"
138 match=" *$"
david_williamse04a7782009-10-14 05:06:49 +0000139 replace=""/>
140 <property
141 file="${wtp.builder.home}/build.properties"/>
david_williamsb641ce32008-07-01 03:36:40 +0000142
david_williams1ae20302010-09-11 01:34:56 +0000143 <!-- create label.properties file (if doesn't exist)-->
david_williamse04a7782009-10-14 05:06:49 +0000144 <ant
145 antfile="${wtp.builder.home}/scripts/build/label.xml"/>
146 <property
147 file="${buildDirectory}/label.properties"/>
david_williams1e71b282008-03-10 10:12:40 +0000148 <echo
149 level="info"
david_williams1ae20302010-09-11 01:34:56 +0000150 message="label file: ${buildDirectory}/label.properties"/>
151
david_williams7e568c72010-09-12 09:04:15 +0000152
153
154 <property
david_williams95d46522008-01-09 23:59:12 +0000155 name="build.distribution"
david_williamse04a7782009-10-14 05:06:49 +0000156 value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000157 <available
david_williams3830fa62008-01-10 01:39:59 +0000158 file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000159 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000160 property="build_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000161 <available
david_williams3830fa62008-01-10 01:39:59 +0000162 file="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000163 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000164 property="site_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000165 <available
david_williams3830fa62008-01-10 01:39:59 +0000166 file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000167 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000168 property="tests_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000169 <available
david_williams3830fa62008-01-10 01:39:59 +0000170 file="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000171 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000172 property="upload_distro_target_exists"/>
david_williams9c32af12010-09-26 04:46:26 +0000173 <available
174 file="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml"
175 type="file"
176 property="package_distro_target_exists"/>
david_williamse04a7782009-10-14 05:06:49 +0000177 <!--
178 fetch the HEAD stream of all projects if build type
179 specified as N
180 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000181 <condition
182 property="fetchTag"
183 value="HEAD">
184 <equals
185 arg1="${buildType}"
david_williamse04a7782009-10-14 05:06:49 +0000186 arg2="N"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000187 </condition>
david_williams9e5f0a92007-08-29 00:09:02 +0000188 </target>
david_williams70e7c7f2008-01-08 04:02:12 +0000189</project>