blob: 2851fcdaf4ff0e2055f109149e24d50294d5af14 [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_williams70e7c7f2008-01-08 04:02:12 +000012 <property
13 environment="env" />
david_williams403beae2007-12-09 02:10:40 +000014
david_williams9e5f0a92007-08-29 00:09:02 +000015 <!--
david_williams403beae2007-12-09 02:10:40 +000016 Let users override standard properties, if desired.
17 If directory, file, or some properties do not exist,
18 then standard properties will be used.
19 -->
david_williams9e5f0a92007-08-29 00:09:02 +000020 <property
21 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williamsa3f5cf22008-01-11 06:22:38 +000022
23 <property name="keyCfgFile" value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg" />
24 <echo message="keyCfgFile: ${keyCfgFile}" />
25 <property
26 file="${keyCfgFile}" />
27
david_williams70e7c7f2008-01-08 04:02:12 +000028 <property
29 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_williams3830fa62008-01-10 01:39:59 +000033 <fail unless="build.distribution" message="distribution must be specified" />
34 <echo message="build.distribution: ${build.distribution}" />
35
36 <target
david_williams9e5f0a92007-08-29 00:09:02 +000037 name="build"
38 depends="init"
39 if="build_distro_target_exists">
40 <property
41 name="buildfile"
david_williams3830fa62008-01-10 01:39:59 +000042 value="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml" />
david_williams9e5f0a92007-08-29 00:09:02 +000043 <echo
david_williams70e7c7f2008-01-08 04:02:12 +000044 level="info"
david_williams9e5f0a92007-08-29 00:09:02 +000045 message="buildfile: ${buildfile}" />
david_williams70e7c7f2008-01-08 04:02:12 +000046 <ant
47 antfile="${buildfile}" />
david_williams9e5f0a92007-08-29 00:09:02 +000048 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000049 <target
50 name="site"
51 depends="init"
52 if="site_distro_target_exists">
david_williams70e7c7f2008-01-08 04:02:12 +000053 <ant
david_williams3830fa62008-01-10 01:39:59 +000054 antfile="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml">
david_williams9e5f0a92007-08-29 00:09:02 +000055 </ant>
56 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000057 <target
58 name="test"
59 depends="init"
60 if="tests_distro_target_exists">
david_williams70e7c7f2008-01-08 04:02:12 +000061 <ant
david_williams3830fa62008-01-10 01:39:59 +000062 antfile="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml">
david_williams9e5f0a92007-08-29 00:09:02 +000063 <property
64 name="testRoot"
david_williams0d0bb392008-01-02 08:58:06 +000065 value="${env.PROJECT_TESTS}/${projectname}" />
david_williams9e5f0a92007-08-29 00:09:02 +000066 <property
67 name="dependencyTargets"
68 value="${wtp.builder.home}/scripts/dependency/build.xml" />
69 <property
70 name="local.cache.dir"
71 value="${env.LOCAL_PREREQS_CACHE}" />
david_williams9e5f0a92007-08-29 00:09:02 +000072 </ant>
73 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000074 <target
75 name="upload"
76 depends="init"
77 if="upload_distro_target_exists">
david_williams70e7c7f2008-01-08 04:02:12 +000078 <ant
david_williams3830fa62008-01-10 01:39:59 +000079 antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml" />
david_williams9e5f0a92007-08-29 00:09:02 +000080 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000081 <target
82 name="copyArtifacts"
83 depends="init">
david_williams70e7c7f2008-01-08 04:02:12 +000084 <mkdir
85 dir="${localStampedArtifactsDirectory}" />
86 <mkdir
87 dir="${localStampedArtifactsDirectory}/${buildLabel}" />
david_williams9e5f0a92007-08-29 00:09:02 +000088 <copy
89 todir="${localStampedArtifactsDirectory}/${buildLabel}"
90 overwrite="true">
david_williams70e7c7f2008-01-08 04:02:12 +000091 <fileset
92 dir="${buildDirectory}/${buildLabel}" />
david_williams9e5f0a92007-08-29 00:09:02 +000093 </copy>
94 </target>
david_williams70e7c7f2008-01-08 04:02:12 +000095 <target
96 name="init">
david_williams9e5f0a92007-08-29 00:09:02 +000097 <dirname
98 file="${ant.file}"
99 property="wtp.builder.home" />
100 <condition
101 property="buildBranch"
102 value="R3.0">
103 <equals
104 arg1="${mapVersionTag}"
105 arg2="HEAD" />
106 </condition>
107 <condition
108 property="buildBranch"
109 value="R0.7">
110 <equals
111 arg1="${mapVersionTag}"
112 arg2="R0_7_maintenance" />
113 </condition>
114 <condition
115 property="buildBranch"
116 value="R1.0">
117 <equals
118 arg1="${mapVersionTag}"
119 arg2="R1_0_maintenance" />
120 </condition>
121 <condition
122 property="buildBranch"
123 value="R1.5">
124 <equals
125 arg1="${mapVersionTag}"
126 arg2="R1_5_maintenance" />
127 </condition>
david_williams403beae2007-12-09 02:10:40 +0000128 <condition
129 property="buildBranch"
130 value="R1.5">
131 <equals
132 arg1="${mapVersionTag}"
133 arg2="R1_5_5_patches" />
david_williams79799372007-09-20 15:24:00 +0000134 </condition>
david_williams9e5f0a92007-08-29 00:09:02 +0000135 <condition
136 property="buildBranch"
137 value="R2.0">
138 <equals
139 arg1="${mapVersionTag}"
140 arg2="R2_0_maintenance" />
141 </condition>
142 <!-- if not set above, assume R3.0 -->
143 <!-- this happens, for example, when using a "tempTest" branch -->
144 <property
145 name="buildBranch"
146 value="R3.0" />
david_williams70e7c7f2008-01-08 04:02:12 +0000147 <touch
148 file="${user.home}/.cvspass" />
ndai0aef0962005-09-14 17:36:08 +0000149
david_williams9e5f0a92007-08-29 00:09:02 +0000150 <!-- strip trailing blanks. Seems either Eclipse, or CVS make it hard to not have trailing spaces -->
151 <replaceregexp
152 flags="gm"
153 file="${wtp.builder.home}/build.properties"
154 match=" *$"
155 replace="" />
david_williams70e7c7f2008-01-08 04:02:12 +0000156 <property
157 file="${wtp.builder.home}/build.properties" />
158 <ant
159 antfile="${wtp.builder.home}/scripts/build/label.xml" />
160 <property
161 file="${buildDirectory}/label.properties" />
david_williams9e5f0a92007-08-29 00:09:02 +0000162 <property
david_williams95d46522008-01-09 23:59:12 +0000163 name="build.distribution"
david_williams3830fa62008-01-10 01:39:59 +0000164 value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}" />
david_williams9e5f0a92007-08-29 00:09:02 +0000165 <available
david_williams3830fa62008-01-10 01:39:59 +0000166 file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000167 type="file"
168 property="build_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}.site/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000171 type="file"
172 property="site_distro_target_exists" />
david_williams9e5f0a92007-08-29 00:09:02 +0000173 <available
david_williams3830fa62008-01-10 01:39:59 +0000174 file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000175 type="file"
176 property="tests_distro_target_exists" />
david_williams9e5f0a92007-08-29 00:09:02 +0000177 <available
david_williams3830fa62008-01-10 01:39:59 +0000178 file="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000179 type="file"
180 property="upload_distro_target_exists" />
ndai0aef0962005-09-14 17:36:08 +0000181
david_williams9e5f0a92007-08-29 00:09:02 +0000182 <!--fetch the HEAD stream of all projects if build type specified as N-->
183 <condition
184 property="fetchTag"
185 value="HEAD">
186 <equals
187 arg1="${buildType}"
188 arg2="N" />
189 </condition>
david_williams70e7c7f2008-01-08 04:02:12 +0000190 <condition
191 property="tagMaps">
david_williams9e5f0a92007-08-29 00:09:02 +0000192 <equals
193 arg1="${build.trial}"
194 arg2="false" />
195 </condition>
196 </target>
david_williams70e7c7f2008-01-08 04:02:12 +0000197</project>