blob: 8464635bbf4e75fd2041022239af8db6795627e2 [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_williams2398e362011-03-05 02:45:39 +000014 <property environment="env"/>
david_williamse04a7782009-10-14 05:06:49 +000015 <!--
16 Let users override standard properties, if desired. If
17 directory, file, or some properties do not exist, then standard
18 properties will be used.
19 -->
david_williams2398e362011-03-05 02:45:39 +000020 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
david_williams9e5f0a92007-08-29 00:09:02 +000021 <property
david_williamsb641ce32008-07-01 03:36:40 +000022 name="keyCfgFile"
david_williamse04a7782009-10-14 05:06:49 +000023 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG}/maps/build.cfg"/>
24 <echo
25 level="debug"
26 message="keyCfgFile: ${keyCfgFile}"/>
david_williams2398e362011-03-05 02:45:39 +000027 <property file="${keyCfgFile}"/>
david_williams9e7f5842011-03-06 03:32:03 +000028
29 <!-- TODO: I don't think this is loaded here. Wrong basedir? -->
david_williams2398e362011-03-05 02:45:39 +000030 <property file="${ant.project.name}.properties"/>
david_williams9e7f5842011-03-06 03:32:03 +000031
32
33 <!-- = = = end standard properties pattern = = = -->
david_williamsb641ce32008-07-01 03:36:40 +000034 <fail
35 unless="build.distribution"
david_williamse04a7782009-10-14 05:06:49 +000036 message="build.distribution must be specified"/>
david_williams2398e362011-03-05 02:45:39 +000037 <echo message="build.distribution: ${build.distribution}"/>
david_williams3830fa62008-01-10 01:39:59 +000038
david_williamse04a7782009-10-14 05:06:49 +000039 <!-- main -->
40 <target
david_williams9e5f0a92007-08-29 00:09:02 +000041 name="build"
42 depends="init"
43 if="build_distro_target_exists">
44 <property
45 name="buildfile"
david_williamse04a7782009-10-14 05:06:49 +000046 value="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000047 <echo
david_williams70e7c7f2008-01-08 04:02:12 +000048 level="info"
david_williamse04a7782009-10-14 05:06:49 +000049 message="buildfile: ${buildfile}"/>
50 <!-- build -->
david_williams2398e362011-03-05 02:45:39 +000051 <ant antfile="${buildfile}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000052 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000053 <target
54 name="site"
55 depends="init"
56 if="site_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000057 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"></ant>
david_williams9e5f0a92007-08-29 00:09:02 +000058 </target>
david_williams9e5f0a92007-08-29 00:09:02 +000059 <target
60 name="test"
david_williams51bc3bd2010-08-24 03:32:43 +000061 depends="init,markIfNoTests"
david_williams9e5f0a92007-08-29 00:09:02 +000062 if="tests_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000063 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml">
david_williams9e5f0a92007-08-29 00:09:02 +000064 <property
65 name="testRoot"
david_williamse04a7782009-10-14 05:06:49 +000066 value="${env.PROJECT_TESTS}/${projectname}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000067 <property
68 name="dependencyTargets"
david_williamse04a7782009-10-14 05:06:49 +000069 value="${wtp.builder.home}/scripts/dependency/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000070 <property
71 name="local.cache.dir"
david_williamse04a7782009-10-14 05:06:49 +000072 value="${env.LOCAL_PREREQS_CACHE}"/>
david_williams9e5f0a92007-08-29 00:09:02 +000073 </ant>
74 </target>
david_williams9c32af12010-09-26 04:46:26 +000075 <target
76 name="package"
77 depends="init"
78 if="package_distro_target_exists">
david_williams2398e362011-03-05 02:45:39 +000079 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml">
david_williams8994edf2010-09-26 03:49:34 +000080
david_williams9c32af12010-09-26 04:46:26 +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_williams9e7f5842011-03-06 03:32:03 +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_williams2398e362011-03-05 02:45:39 +000098 <ant antfile="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"/>
david_williams9e5f0a92007-08-29 00:09:02 +000099 </target>
david_williams51bc3bd2010-08-24 03:32:43 +0000100
david_williamsb641ce32008-07-01 03:36:40 +0000101 <!--
david_williamse04a7782009-10-14 05:06:49 +0000102 init: 1) set buildBranch property 2) call label.xml to create
103 label.properties file in <BUILD HOME>/projects/<project>/workdir
104 3) check for existence of build.xml file for each of the build,
105 test, upload, site distribution locations and set properties
david_williamsb641ce32008-07-01 03:36:40 +0000106 -->
david_williams2398e362011-03-05 02:45:39 +0000107 <target name="init">
david_williams9e5f0a92007-08-29 00:09:02 +0000108 <dirname
109 file="${ant.file}"
david_williamse04a7782009-10-14 05:06:49 +0000110 property="wtp.builder.home"/>
david_williams9e7f5842011-03-06 03:32:03 +0000111
112
david_williamse04a7782009-10-14 05:06:49 +0000113 <!-- if not set above, assume R3.2.0 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000114 <!-- this happens, for example, when using a "tempTest" branch -->
115 <property
116 name="buildBranch"
david_williamse04a7782009-10-14 05:06:49 +0000117 value="R3.2.0"/>
david_williams2398e362011-03-05 02:45:39 +0000118 <touch file="${user.home}/.cvspass"/>
david_williamse04a7782009-10-14 05:06:49 +0000119 <!--
120 strip trailing blanks. Seems either Eclipse, or CVS make it
121 hard to not have trailing spaces
122 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000123 <replaceregexp
124 flags="gm"
125 file="${wtp.builder.home}/build.properties"
126 match=" *$"
david_williamse04a7782009-10-14 05:06:49 +0000127 replace=""/>
david_williams2398e362011-03-05 02:45:39 +0000128 <property file="${wtp.builder.home}/build.properties"/>
david_williamsb641ce32008-07-01 03:36:40 +0000129
david_williams1ae20302010-09-11 01:34:56 +0000130 <!-- create label.properties file (if doesn't exist)-->
david_williams2398e362011-03-05 02:45:39 +0000131 <ant antfile="${wtp.builder.home}/scripts/build/label.xml"/>
132 <property file="${buildDirectory}/label.properties"/>
david_williams1e71b282008-03-10 10:12:40 +0000133 <echo
134 level="info"
david_williams1ae20302010-09-11 01:34:56 +0000135 message="label file: ${buildDirectory}/label.properties"/>
136
david_williams7e568c72010-09-12 09:04:15 +0000137
138
139 <property
david_williams95d46522008-01-09 23:59:12 +0000140 name="build.distribution"
david_williamse04a7782009-10-14 05:06:49 +0000141 value="${wtp.builder.home}/distribution/${wtp.builder.home}/distribution/${build.distribution}"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000142 <available
david_williams3830fa62008-01-10 01:39:59 +0000143 file="${wtp.builder.home}/distribution/${build.distribution}.build/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000144 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000145 property="build_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000146 <available
david_williams3830fa62008-01-10 01:39:59 +0000147 file="${wtp.builder.home}/distribution/${build.distribution}.site/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000148 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000149 property="site_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000150 <available
david_williams3830fa62008-01-10 01:39:59 +0000151 file="${wtp.builder.home}/distribution/${build.distribution}.tests/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000152 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000153 property="tests_distro_target_exists"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000154 <available
david_williams3830fa62008-01-10 01:39:59 +0000155 file="${wtp.builder.home}/distribution/${build.distribution}.upload/build.xml"
david_williams403beae2007-12-09 02:10:40 +0000156 type="file"
david_williamse04a7782009-10-14 05:06:49 +0000157 property="upload_distro_target_exists"/>
david_williams2398e362011-03-05 02:45:39 +0000158 <available
159 file="${wtp.builder.home}/distribution/${build.distribution}.package/build.xml"
160 type="file"
david_williams9e7f5842011-03-06 03:32:03 +0000161 property="package_distro_target_exists"/>
david_williamse04a7782009-10-14 05:06:49 +0000162 <!--
163 fetch the HEAD stream of all projects if build type
164 specified as N
165 -->
david_williams9e5f0a92007-08-29 00:09:02 +0000166 <condition
167 property="fetchTag"
168 value="HEAD">
169 <equals
170 arg1="${buildType}"
david_williamse04a7782009-10-14 05:06:49 +0000171 arg2="N"/>
david_williams9e5f0a92007-08-29 00:09:02 +0000172 </condition>
david_williams9e5f0a92007-08-29 00:09:02 +0000173 </target>
david_williams70e7c7f2008-01-08 04:02:12 +0000174</project>