blob: ac6fcdc8e960bd2d747e55b6475a16b771314bfc [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 = = = -->
7 <!--
david_williams403beae2007-12-09 02:10:40 +00008 Note to be cross-platform, "environment variables" are only appropriate for
david_williams1cff0e92006-11-23 00:40:29 +00009 some variables, e.g. ones we set, since properties are case sensitive, even if
10 the environment variables on your operating system are not, e.g. it will
11 be ${env.Path} not ${env.PATH} on Windows -->
david_williamsb641ce32008-07-01 03:36:40 +000012 <property environment="env" />
david_williams403beae2007-12-09 02:10:40 +000013
david_williams9e5f0a92007-08-29 00:09:02 +000014 <!--
david_williams403beae2007-12-09 02:10:40 +000015 Let users override standard properties, if desired.
16 If directory, file, or some properties do not exist,
17 then standard properties will be used.
18 -->
david_williamsb641ce32008-07-01 03:36:40 +000019 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
20
david_williams9e5f0a92007-08-29 00:09:02 +000021 <property
david_williamsb641ce32008-07-01 03:36:40 +000022 name="keyCfgFile"
23 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg" />
david_williamsd1184892008-07-07 02:45:47 +000024 <echo
david_williamsf700dc42008-07-07 03:22:47 +000025 level="debug"
david_williamsd1184892008-07-07 02:45:47 +000026 message="keyCfgFile: ${keyCfgFile}" />
david_williamsb641ce32008-07-01 03:36:40 +000027 <property file="${keyCfgFile}" />
david_williamsa3f5cf22008-01-11 06:22:38 +000028
david_williamsb641ce32008-07-01 03:36:40 +000029 <property file="${ant.project.name}.properties" />
david_williams4b3c8042007-03-19 01:06:50 +000030
david_williams9e5f0a92007-08-29 00:09:02 +000031 <!-- = = = end standard properties pattern = = = -->
david_williams70e7c7f2008-01-08 04:02:12 +000032
david_williamsb641ce32008-07-01 03:36:40 +000033 <fail
34 unless="build.distribution"
david_williamsacbfd412009-07-21 01:25:27 +000035 message="build.distribution must be specified" />
david_williams3830fa62008-01-10 01:39:59 +000036 <echo message="build.distribution: ${build.distribution}" />
37
david_williams1e71b282008-03-10 10:12:40 +000038 <!-- main -->
david_williams3830fa62008-01-10 01:39:59 +000039 <target
david_williams9e5f0a92007-08-29 00:09:02 +000040 name="build"
41 depends="init"
42 if="build_distro_target_exists">
43 <property
44 name="buildfile"
david_williams1e71b282008-03-10 10:12:40 +000045 value="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml" />
david_williams9e5f0a92007-08-29 00:09:02 +000046 <echo
david_williams70e7c7f2008-01-08 04:02:12 +000047 level="info"
david_williams9e5f0a92007-08-29 00:09:02 +000048 message="buildfile: ${buildfile}" />
david_williams1e71b282008-03-10 10:12:40 +000049 <!-- build -->
david_williamsb641ce32008-07-01 03:36:40 +000050 <ant antfile="${buildfile}" />
david_williams9e5f0a92007-08-29 00:09:02 +000051 </target>
david_williams1e71b282008-03-10 10:12:40 +000052
david_williams9e5f0a92007-08-29 00:09:02 +000053 <target
54 name="site"
55 depends="init"
56 if="site_distro_target_exists">
david_williamsb641ce32008-07-01 03:36:40 +000057 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"></ant>
david_williams9e5f0a92007-08-29 00:09:02 +000058 </target>
david_williams1e71b282008-03-10 10:12:40 +000059
david_williams9e5f0a92007-08-29 00:09:02 +000060 <target
61 name="test"
62 depends="init"
63 if="tests_distro_target_exists">
david_williamsb641ce32008-07-01 03:36:40 +000064 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml">
david_williams9e5f0a92007-08-29 00:09:02 +000065 <property
66 name="testRoot"
david_williams0d0bb392008-01-02 08:58:06 +000067 value="${env.PROJECT_TESTS}/${projectname}" />
david_williams9e5f0a92007-08-29 00:09:02 +000068 <property
69 name="dependencyTargets"
70 value="${wtp.builder.home}/scripts/dependency/build.xml" />
71 <property
72 name="local.cache.dir"
73 value="${env.LOCAL_PREREQS_CACHE}" />
david_williams9e5f0a92007-08-29 00:09:02 +000074 </ant>
75 </target>
david_williams1e71b282008-03-10 10:12:40 +000076
david_williams9e5f0a92007-08-29 00:09:02 +000077 <target
78 name="upload"
79 depends="init"
80 if="upload_distro_target_exists">
david_williamsb641ce32008-07-01 03:36:40 +000081 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml" />
david_williams9e5f0a92007-08-29 00:09:02 +000082 </target>
david_williams1e71b282008-03-10 10:12:40 +000083
david_williams9e5f0a92007-08-29 00:09:02 +000084 <target
85 name="copyArtifacts"
86 depends="init">
david_williamsb641ce32008-07-01 03:36:40 +000087 <mkdir dir="${localStampedArtifactsDirectory}" />
88 <mkdir dir="${localStampedArtifactsDirectory}/${buildLabel}" />
david_williams9e5f0a92007-08-29 00:09:02 +000089 <copy
90 todir="${localStampedArtifactsDirectory}/${buildLabel}"
david_williamsb641ce32008-07-01 03:36:40 +000091 overwrite="true"
92 >
93 <fileset dir="${buildDirectory}/${buildLabel}" />
david_williams9e5f0a92007-08-29 00:09:02 +000094 </copy>
95 </target>
david_williamsb641ce32008-07-01 03:36:40 +000096
97 <!--
98 init:
99 1) set buildBranch property
100 2) call label.xml to create label.properties file in <BUILD HOME>/projects/<project>/workdir
101 3) check for existence of build.xml file for each of the build, test, upload, site distribution locations and set properties
102 -->
103 <target name="init">
david_williams9e5f0a92007-08-29 00:09:02 +0000104 <dirname
105 file="${ant.file}"
106 property="wtp.builder.home" />
107 <condition
108 property="buildBranch"
109 value="R3.0">
110 <equals
111 arg1="${mapVersionTag}"
112 arg2="HEAD" />
113 </condition>
114 <condition
115 property="buildBranch"
116 value="R0.7">
117 <equals
118 arg1="${mapVersionTag}"
119 arg2="R0_7_maintenance" />
120 </condition>
121 <condition
122 property="buildBranch"
123 value="R1.0">
124 <equals
125 arg1="${mapVersionTag}"
126 arg2="R1_0_maintenance" />
127 </condition>
128 <condition
129 property="buildBranch"
130 value="R1.5">
131 <equals
132 arg1="${mapVersionTag}"
133 arg2="R1_5_maintenance" />
134 </condition>
david_williams403beae2007-12-09 02:10:40 +0000135 <condition
136 property="buildBranch"
david_williams6706cfb2008-03-08 06:57:25 +0000137 value="R1.5.5">
david_williams403beae2007-12-09 02:10:40 +0000138 <equals
139 arg1="${mapVersionTag}"
140 arg2="R1_5_5_patches" />
david_williams79799372007-09-20 15:24:00 +0000141 </condition>
david_williams9e5f0a92007-08-29 00:09:02 +0000142 <condition
143 property="buildBranch"
144 value="R2.0">
145 <equals
146 arg1="${mapVersionTag}"
147 arg2="R2_0_maintenance" />
148 </condition>
david_williams26f3a5f2008-03-07 22:56:23 +0000149 <condition
150 property="buildBranch"
david_williams6706cfb2008-03-08 06:57:25 +0000151 value="R2.0.2">
david_williams26f3a5f2008-03-07 22:56:23 +0000152 <equals
153 arg1="${mapVersionTag}"
154 arg2="R2_0_2_patches" />
155 </condition>
david_williams9e5f0a92007-08-29 00:09:02 +0000156 <!-- if not set above, assume R3.0 -->
157 <!-- this happens, for example, when using a "tempTest" branch -->
158 <property
159 name="buildBranch"
160 value="R3.0" />
david_williamsb641ce32008-07-01 03:36:40 +0000161 <touch file="${user.home}/.cvspass" />
ndai0aef0962005-09-14 17:36:08 +0000162
david_williams9e5f0a92007-08-29 00:09:02 +0000163 <!-- strip trailing blanks. Seems either Eclipse, or CVS make it hard to not have trailing spaces -->
164 <replaceregexp
165 flags="gm"
166 file="${wtp.builder.home}/build.properties"
167 match=" *$"
168 replace="" />
david_williamsb641ce32008-07-01 03:36:40 +0000169 <property file="${wtp.builder.home}/build.properties" />
170
171 <!-- creating label.properties file -->
172 <ant antfile="${wtp.builder.home}/scripts/build/label.xml" />
173 <property file="${buildDirectory}/label.properties" />
david_williams1e71b282008-03-10 10:12:40 +0000174 <echo
175 level="info"
176 message="label: ${buildDirectory}/label.properties" />
david_williamsb641ce32008-07-01 03:36:40 +0000177
david_williams9e5f0a92007-08-29 00:09:02 +0000178 <property
david_williams95d46522008-01-09 23:59:12 +0000179 name="build.distribution"
david_williams3830fa62008-01-10 01:39:59 +0000180 value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}" />
david_williams9e5f0a92007-08-29 00:09:02 +0000181 <available
david_williams3830fa62008-01-10 01:39:59 +0000182 file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000183 type="file"
184 property="build_distro_target_exists" />
david_williams9e5f0a92007-08-29 00:09:02 +0000185 <available
david_williams3830fa62008-01-10 01:39:59 +0000186 file="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000187 type="file"
188 property="site_distro_target_exists" />
david_williams9e5f0a92007-08-29 00:09:02 +0000189 <available
david_williams3830fa62008-01-10 01:39:59 +0000190 file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000191 type="file"
192 property="tests_distro_target_exists" />
david_williams9e5f0a92007-08-29 00:09:02 +0000193 <available
david_williams3830fa62008-01-10 01:39:59 +0000194 file="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000195 type="file"
196 property="upload_distro_target_exists" />
ndai0aef0962005-09-14 17:36:08 +0000197
david_williams9e5f0a92007-08-29 00:09:02 +0000198 <!--fetch the HEAD stream of all projects if build type specified as N-->
199 <condition
200 property="fetchTag"
201 value="HEAD">
202 <equals
203 arg1="${buildType}"
204 arg2="N" />
205 </condition>
david_williamsb641ce32008-07-01 03:36:40 +0000206
david_williams9e5f0a92007-08-29 00:09:02 +0000207 </target>
david_williams70e7c7f2008-01-08 04:02:12 +0000208</project>