blob: 2f5e89bad458aa9ea0e025d3fd60ef722c52b869 [file] [log] [blame]
david_williams39c5f652008-01-02 07:08:39 +00001<project
2 name="cc_project_build"
3 default="Build"
4 basedir=".">
david_williams42f9b242006-11-27 18:45:14 +00005
david_williams70831b52007-10-05 03:27:45 +00006
david_williams39c5f652008-01-02 07:08:39 +00007 <!-- = = = standard properties pattern = = = -->
8 <!--
9 Note to be cross-platform, "environment variables" are only appropriate for
david_williams42f9b242006-11-27 18:45:14 +000010 some variables, e.g. ones we set, since properties are case sensitive, even if
11 the environment variables on your operating system are not, e.g. it will
12 be ${env.Path} not ${env.PATH} on Windows -->
david_williams39c5f652008-01-02 07:08:39 +000013 <property
14 environment="env" />
david_williams70831b52007-10-05 03:27:45 +000015
david_williams39c5f652008-01-02 07:08:39 +000016 <!--
17 Let users override standard properties, if desired.
18 If directory, file, or some properties do not exist,
19 then standard properties will be used.
david_williams42f9b242006-11-27 18:45:14 +000020 -->
david_williams39c5f652008-01-02 07:08:39 +000021 <property
22 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000023
david_williams39c5f652008-01-02 07:08:39 +000024 <!-- = = = end standard properties pattern = = = -->
david_williams42f9b242006-11-27 18:45:14 +000025
david_williams39c5f652008-01-02 07:08:39 +000026 <!-- if not otherwise set, build clean -->
27 <property
28 name="build.clean"
29 value="true" />
david_williams70831b52007-10-05 03:27:45 +000030
david_williams39c5f652008-01-02 07:08:39 +000031 <!--
32 If not set yet, by "caller", then we set checkoutprojectname here.
33 Normally this is literally the project name from CruiseControl, but
34 if running "standalone", we make this simplifying assumption.
david_williams42f9b242006-11-27 18:45:14 +000035 -->
david_williams39c5f652008-01-02 07:08:39 +000036 <property
37 name="checkoutprojectname"
38 value="${projectname}" />
david_williams42f9b242006-11-27 18:45:14 +000039
david_williams39c5f652008-01-02 07:08:39 +000040 <!-- if not otherwise set, the following are good default values -->
41 <property
42 name="mapVersionTag"
43 value="HEAD" />
44 <target
45 name="Build">
david_williams42f9b242006-11-27 18:45:14 +000046
david_williams39c5f652008-01-02 07:08:39 +000047 <!-- set main builder file name, based on distribution, buildBranch and build type -->
48 <property
49 name="builder"
50 value="${env.PROJECT_BUILDERS}/${checkoutprojectname}/${env.RELENG_BUILDER}/build.xml" />
51 <antcall
52 target="doCleanBuild" />
david_williams70831b52007-10-05 03:27:45 +000053
david_williams39c5f652008-01-02 07:08:39 +000054 <!-- and create preliminary download site files -->
55 <ant
56 antfile="${builder}"
57 target="site" />
58 <!-- upload what we have so far -->
59 <ant
60 antfile="${builder}"
61 target="upload" />
62 <antcall
63 target="doTestPhase" />
64 </target>
65 <target
66 name="doCleanBuild"
67 unless="skipCleanBuild">
68 <!-- clean previous build -->
69 <antcall
70 target="clean" />
david_williams42f9b242006-11-27 18:45:14 +000071
72
david_williams42f9b242006-11-27 18:45:14 +000073
74
david_williams39c5f652008-01-02 07:08:39 +000075 <!-- check out fresh set of appropriate files for the builder -->
76 <ant
77 antfile="checkout.xml" />
78
79 <!-- build and create preliminary download site files -->
80 <ant
81 antfile="${builder}"
82 target="build" />
83 </target>
84 <target
85 name="doTestPhase"
86 unless="skipUnitTests">
87 <!-- test and create test summary files -->
88 <ant
89 antfile="${builder}"
90 target="test" />
91 <ant
92 antfile="${builder}"
93 target="site" />
94 <!-- upload what we have so far -->
95 <ant
96 antfile="${builder}"
97 target="upload" />
98 </target>
99 <target
100 name="clean"
101 depends="check.clean"
102 if="doClean">
103 <delete
104 dir="${env.PROJECT_PROJECTS}/${checkoutprojectname}"
105 failonerror="false" />
106 <delete
107 dir="${env.PROJECT_TESTS}/${checkoutprojectname}"
108 failonerror="false" />
109 </target>
110
111 <!-- if build.clean does not exist, set doClean to true -->
112 <target
113 name="check.clean">
114 <condition
115 property="doClean">
116 <or>
117 <not>
118 <isset
119 property="build.clean" />
120 </not>
121 <equals
122 arg1="${build.clean}"
123 arg2="true" />
124 </or>
125 </condition>
126 </target>
127</project>