blob: 8632254d5acf19fa2bf8c783846fbbc914c05494 [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" />
david_williamsa129dc22008-01-02 07:39:51 +000044
david_williams39c5f652008-01-02 07:08:39 +000045 <target
46 name="Build">
david_williams42f9b242006-11-27 18:45:14 +000047
david_williams39c5f652008-01-02 07:08:39 +000048 <!-- set main builder file name, based on distribution, buildBranch and build type -->
49 <property
50 name="builder"
51 value="${env.PROJECT_BUILDERS}/${checkoutprojectname}/${env.RELENG_BUILDER}/build.xml" />
52 <antcall
53 target="doCleanBuild" />
david_williams70831b52007-10-05 03:27:45 +000054
david_williams39c5f652008-01-02 07:08:39 +000055 <!-- and create preliminary download site files -->
56 <ant
57 antfile="${builder}"
58 target="site" />
59 <!-- upload what we have so far -->
60 <ant
61 antfile="${builder}"
62 target="upload" />
63 <antcall
64 target="doTestPhase" />
65 </target>
66 <target
67 name="doCleanBuild"
68 unless="skipCleanBuild">
69 <!-- clean previous build -->
70 <antcall
71 target="clean" />
david_williams42f9b242006-11-27 18:45:14 +000072
73
david_williams42f9b242006-11-27 18:45:14 +000074
75
david_williams39c5f652008-01-02 07:08:39 +000076 <!-- check out fresh set of appropriate files for the builder -->
77 <ant
78 antfile="checkout.xml" />
79
80 <!-- build and create preliminary download site files -->
81 <ant
82 antfile="${builder}"
83 target="build" />
84 </target>
85 <target
86 name="doTestPhase"
87 unless="skipUnitTests">
88 <!-- test and create test summary files -->
89 <ant
90 antfile="${builder}"
91 target="test" />
92 <ant
93 antfile="${builder}"
94 target="site" />
95 <!-- upload what we have so far -->
96 <ant
97 antfile="${builder}"
98 target="upload" />
99 </target>
100 <target
101 name="clean"
102 depends="check.clean"
103 if="doClean">
104 <delete
105 dir="${env.PROJECT_PROJECTS}/${checkoutprojectname}"
106 failonerror="false" />
107 <delete
108 dir="${env.PROJECT_TESTS}/${checkoutprojectname}"
109 failonerror="false" />
110 </target>
111
112 <!-- if build.clean does not exist, set doClean to true -->
113 <target
114 name="check.clean">
115 <condition
116 property="doClean">
117 <or>
118 <not>
119 <isset
120 property="build.clean" />
121 </not>
122 <equals
123 arg1="${build.clean}"
124 arg2="true" />
125 </or>
126 </condition>
127 </target>
128</project>