blob: ca18eebd39fa83b910c39d4630af61c8ec0cd145 [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_williams7e568c72010-09-12 09:04:15 +000083 <target
84 name="markIfNoTests"
85 unless="tests_distro_target_exists">
86
87 <echo
david_williams99658fe2010-09-17 14:21:00 +000088 message="This build for ${build.distribution} (${projectname}) provided no unit tests"
david_williams7e568c72010-09-12 09:04:15 +000089 file="${buildDirectory}/${buildLabel}/noTestsProvided.txt"/>
90
91 </target>
david_williams51bc3bd2010-08-24 03:32:43 +000092
93 <!-- we dont' use 'upload' any longer ... TODO: remove? -->
david_williams9e5f0a92007-08-29 00:09:02 +000094 <target
95 name="upload"
96 depends="init"
97 if="upload_distro_target_exists">
david_williamse04a7782009-10-14 05:06:49 +000098 <ant
99 antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000100 </target>
david_williams51bc3bd2010-08-24 03:32:43 +0000101
david_williamsb641ce32008-07-01 03:36:40 +0000102 <!--
david_williamse04a7782009-10-14 05:06:49 +0000103 init: 1) set buildBranch property 2) call label.xml to create
104 label.properties file in <BUILD HOME>/projects/<project>/workdir
105 3) check for existence of build.xml file for each of the build,
106 test, upload, site distribution locations and set properties
david_williamsb641ce32008-07-01 03:36:40 +0000107 -->
david_williamse04a7782009-10-14 05:06:49 +0000108 <target
109 name="init">
david_williams9e5f0a92007-08-29 00:09:02 +0000110 <dirname
111 file="${ant.file}"
david_williamse04a7782009-10-14 05:06:49 +0000112 property="wtp.builder.home"/>
113
david_williams92d59912010-06-07 16:07:48 +0000114
david_williamse04a7782009-10-14 05:06:49 +0000115 <!-- if not set above, assume R3.2.0 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000116 <!-- this happens, for example, when using a "tempTest" branch -->
117 <property
118 name="buildBranch"
david_williamse04a7782009-10-14 05:06:49 +0000119 value="R3.2.0"/>
120 <touch
121 file="${user.home}/.cvspass"/>
122 <!--
123 strip trailing blanks. Seems either Eclipse, or CVS make it
124 hard to not have trailing spaces
125 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000126 <replaceregexp
127 flags="gm"
128 file="${wtp.builder.home}/build.properties"
129 match=" *$"
david_williamse04a7782009-10-14 05:06:49 +0000130 replace=""/>
131 <property
132 file="${wtp.builder.home}/build.properties"/>
david_williamsb641ce32008-07-01 03:36:40 +0000133
david_williams1ae20302010-09-11 01:34:56 +0000134 <!-- create label.properties file (if doesn't exist)-->
david_williamse04a7782009-10-14 05:06:49 +0000135 <ant
136 antfile="${wtp.builder.home}/scripts/build/label.xml"/>
137 <property
138 file="${buildDirectory}/label.properties"/>
david_williams1e71b282008-03-10 10:12:40 +0000139 <echo
140 level="info"
david_williams1ae20302010-09-11 01:34:56 +0000141 message="label file: ${buildDirectory}/label.properties"/>
142
david_williams7e568c72010-09-12 09:04:15 +0000143
144
145 <property
david_williams95d46522008-01-09 23:59:12 +0000146 name="build.distribution"
david_williamse04a7782009-10-14 05:06:49 +0000147 value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000148 <available
david_williams3830fa62008-01-10 01:39:59 +0000149 file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000150 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000151 property="build_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000152 <available
david_williams3830fa62008-01-10 01:39:59 +0000153 file="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000154 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000155 property="site_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000156 <available
david_williams3830fa62008-01-10 01:39:59 +0000157 file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000158 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000159 property="tests_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}.upload/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000162 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000163 property="upload_distro_target_exists"/>
164 <!--
165 fetch the HEAD stream of all projects if build type
166 specified as N
167 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000168 <condition
169 property="fetchTag"
170 value="HEAD">
171 <equals
172 arg1="${buildType}"
david_williamse04a7782009-10-14 05:06:49 +0000173 arg2="N"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000174 </condition>
david_williams9e5f0a92007-08-29 00:09:02 +0000175 </target>
david_williams70e7c7f2008-01-08 04:02:12 +0000176</project>