blob: 98da6c0c30332d239d7bb70c529531197c7848f1 [file] [log] [blame]
david_williams42f9b242006-11-27 18:45:14 +00001<project name="cc_project_build" default="Build" basedir=".">
2
david_williams70831b52007-10-05 03:27:45 +00003
4 <!-- = = = standard properties pattern = = = -->
5 <!--
david_williams42f9b242006-11-27 18:45:14 +00006 Note to be cross-platform, "environment variables" are only appropriate for
7 some variables, e.g. ones we set, since properties are case sensitive, even if
8 the environment variables on your operating system are not, e.g. it will
9 be ${env.Path} not ${env.PATH} on Windows -->
david_williams70831b52007-10-05 03:27:45 +000010 <property environment="env" />
11
12 <!--
david_williams42f9b242006-11-27 18:45:14 +000013 Let users override standard properties, if desired.
14 If directory, file, or some properties do not exist,
15 then standard properties will be used.
16 -->
david_williams70831b52007-10-05 03:27:45 +000017 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000018
david_williams70831b52007-10-05 03:27:45 +000019 <!-- = = = end standard properties pattern = = = -->
david_williams42f9b242006-11-27 18:45:14 +000020
david_williams70831b52007-10-05 03:27:45 +000021
22 <!--
david_williams42f9b242006-11-27 18:45:14 +000023 If not set yet, by "caller", then we set checkoutprojectname here.
24 Normally this is literally the project name from CruiseControl, but
25 if running "standalone", we make this simplifying assumption.
26 -->
david_williams70831b52007-10-05 03:27:45 +000027 <property name="build.distribution" value="wtp" />
28 <property name="buildBranch" value="R3.0" />
29 <property name="buildType" value="I" />
30 <property name="checkoutprojectname" value="${build.distribution}-${buildBranch}-${buildType}" />
david_williams42f9b242006-11-27 18:45:14 +000031
david_williams70831b52007-10-05 03:27:45 +000032 <target name="Build">
david_williams42f9b242006-11-27 18:45:14 +000033
david_williams70831b52007-10-05 03:27:45 +000034 <!-- set main builder file name, based on distribution, buildBranch and build type -->
david_williams2e0afe02008-01-02 04:11:40 +000035 <property name="wtpBuilder" value="${env.BUILD_HOME}/projectBuilders/${checkoutprojectname}/${env.RELENG_BUILDER}/build.xml" />
david_williams70831b52007-10-05 03:27:45 +000036
37 <antcall target="doCleanBuild" />
38
39 <!-- and create preliminary download site files -->
40 <ant antfile="${wtpBuilder}" target="site" />
41 <!-- upload what we have so far -->
42 <ant antfile="${wtpBuilder}" target="upload" />
43
44 <antcall target="doTestPhase" />
david_williams42f9b242006-11-27 18:45:14 +000045
46
david_williams93882182007-09-28 19:38:20 +000047 </target>
david_williams42f9b242006-11-27 18:45:14 +000048
david_williams70831b52007-10-05 03:27:45 +000049 <target name="doCleanBuild" unless="skipCleanBuild">
50 <!-- clean previous build -->
51 <antcall target="clean" />
52
53 <!-- check out fresh set of appropriate files -->
54 <!-- this is to make sure maps and builders are correct, but also to
55 make sure the cruisecontrol triggered "diffs" are accurate next
56 time around -->
57 <ant antfile="checkout.xml">
58 <property name="checkoutprojectname" value="${checkoutprojectname}" />
59 </ant>
60 <!-- build -->
61 <ant antfile="${wtpBuilder}" target="build" />
62
63 </target>
64
65 <target name="doTestPhase" unless="skipUnitTests">
66 <!-- test and create test summary files -->
67 <ant antfile="${wtpBuilder}" target="test" />
68
69 <ant antfile="${wtpBuilder}" target="site" />
70 <!-- upload what we have so far -->
71 <ant antfile="${wtpBuilder}" target="upload" />
72 </target>
73
david_williams2e0afe02008-01-02 04:11:40 +000074 <!-- TODO: projects and tests should be variables, see build.properties in wtpBuilder -->
david_williams70831b52007-10-05 03:27:45 +000075 <target name="clean" depends="check.clean" if="doClean">
76 <delete dir="${env.BUILD_HOME}/projects/${checkoutprojectname}" failonerror="false" />
77 <delete dir="${env.BUILD_HOME}/tests/${checkoutprojectname}" failonerror="false" />
78 </target>
david_williams42f9b242006-11-27 18:45:14 +000079
david_williamse44e4d22007-12-11 02:11:36 +000080 <!-- if build.clean does not exist, set doClean to true -->
david_williams70831b52007-10-05 03:27:45 +000081 <target name="check.clean">
82 <condition property="doClean">
david_williamse44e4d22007-12-11 02:11:36 +000083 <or>
84 <not>
85 <isset property="build.clean"/>
86 </not>
87 <equals arg1="${build.clean}" arg2="true" />
88 </or>
david_williams70831b52007-10-05 03:27:45 +000089 </condition>
90 </target>
david_williams42f9b242006-11-27 18:45:14 +000091
92
93</project>