blob: 40b3dd89ec7948ff28295aa846267b01944075b5 [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_williams39c5f652008-01-02 07:08:39 +00006 <!-- = = = standard properties pattern = = = -->
7 <!--
8 Note to be cross-platform, "environment variables" are only appropriate for
david_williams42f9b242006-11-27 18:45:14 +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_williams39c5f652008-01-02 07:08:39 +000012 <property
13 environment="env" />
david_williams70831b52007-10-05 03:27:45 +000014
david_williams39c5f652008-01-02 07:08:39 +000015 <!--
16 Let users override standard properties, if desired.
17 If directory, file, or some properties do not exist,
18 then standard properties will be used.
david_williams42f9b242006-11-27 18:45:14 +000019 -->
david_williams39c5f652008-01-02 07:08:39 +000020 <property
21 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000022
david_williams39c5f652008-01-02 07:08:39 +000023 <!-- = = = end standard properties pattern = = = -->
david_williams42f9b242006-11-27 18:45:14 +000024
david_williams39c5f652008-01-02 07:08:39 +000025 <!-- if not otherwise set, build clean -->
26 <property
27 name="build.clean"
28 value="true" />
david_williams70831b52007-10-05 03:27:45 +000029
david_williams0d90cde2008-01-05 05:59:43 +000030 <!-- set main builder file name, based on distribution, buildBranch and build type -->
31 <property
32 name="builder"
33 value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG_BUILDER}/build.xml" />
34
david_williams39c5f652008-01-02 07:08:39 +000035 <!--
david_williams320c0332008-01-05 05:55:44 +000036 If not set yet, by "caller", then fail fast.
david_williams39c5f652008-01-02 07:08:39 +000037 Normally this is literally the project name from CruiseControl, but
david_williams320c0332008-01-05 05:55:44 +000038 if running "standalone", it would have to be set to something similar
39 to one of the cc_config project name, such as wtp-R3.0-I.
david_williams42f9b242006-11-27 18:45:14 +000040 -->
david_williams320c0332008-01-05 05:55:44 +000041 <fail
42 unless="projectname" />
david_williams42f9b242006-11-27 18:45:14 +000043
david_williams39c5f652008-01-02 07:08:39 +000044 <!-- if not otherwise set, the following are good default values -->
45 <property
46 name="mapVersionTag"
47 value="HEAD" />
48 <target
49 name="Build">
david_williams320c0332008-01-05 05:55:44 +000050 <antcall
51 target="doBuildPhase" />
52 <antcall
53 target="doTestPhase" />
54 </target>
55 <target
david_williamsd2fa7ee2008-02-03 21:32:17 +000056 name="doBuildPhase">
david_williams39c5f652008-01-02 07:08:39 +000057 <antcall
58 target="doCleanBuild" />
david_williams70831b52007-10-05 03:27:45 +000059
david_williams320c0332008-01-05 05:55:44 +000060 <!-- and create preliminary download site files -->
david_williams39c5f652008-01-02 07:08:39 +000061 <ant
62 antfile="${builder}"
63 target="site" />
david_williams320c0332008-01-05 05:55:44 +000064 <!-- upload what we have so far -->
david_williams39c5f652008-01-02 07:08:39 +000065 <ant
66 antfile="${builder}"
67 target="upload" />
david_williams39c5f652008-01-02 07:08:39 +000068 </target>
69 <target
70 name="doCleanBuild"
71 unless="skipCleanBuild">
72 <!-- clean previous build -->
73 <antcall
74 target="clean" />
david_williams39c5f652008-01-02 07:08:39 +000075 <!-- check out fresh set of appropriate files for the builder -->
76 <ant
77 antfile="checkout.xml" />
david_williams39c5f652008-01-02 07:08:39 +000078 <!-- build and create preliminary download site files -->
79 <ant
80 antfile="${builder}"
81 target="build" />
82 </target>
david_williams320c0332008-01-05 05:55:44 +000083
84 <!-- test phase runs tests, creates test summary files, and uploads results -->
david_williams39c5f652008-01-02 07:08:39 +000085 <target
86 name="doTestPhase"
87 unless="skipUnitTests">
david_williamsd84c2202008-01-05 06:45:17 +000088 <delete
89 dir="${env.PROJECT_TESTS}/${projectname}"
90 failonerror="false" />
david_williams39c5f652008-01-02 07:08:39 +000091 <ant
92 antfile="${builder}"
93 target="test" />
94 <ant
95 antfile="${builder}"
96 target="site" />
david_williams39c5f652008-01-02 07:08:39 +000097 <ant
98 antfile="${builder}"
99 target="upload" />
100 </target>
david_williams320c0332008-01-05 05:55:44 +0000101
102 <!-- clean task -->
david_williams39c5f652008-01-02 07:08:39 +0000103 <target
104 name="clean"
105 depends="check.clean"
106 if="doClean">
107 <delete
david_williams320c0332008-01-05 05:55:44 +0000108 dir="${env.PROJECT_PROJECTS}/${projectname}"
david_williams39c5f652008-01-02 07:08:39 +0000109 failonerror="false" />
110 <delete
david_williams320c0332008-01-05 05:55:44 +0000111 dir="${env.PROJECT_TESTS}/${projectname}"
112 failonerror="false" />
david_williams8f7802c2008-01-05 09:09:47 +0000113 <!-- deleting ant working will be complicated, since sometimes same as releng.control -->
114 <!--
david_williams320c0332008-01-05 05:55:44 +0000115 <delete
116 dir="${env.ANT_WORKING}"
david_williams39c5f652008-01-02 07:08:39 +0000117 failonerror="false" />
david_williams8f7802c2008-01-05 09:09:47 +0000118 -->
david_williams39c5f652008-01-02 07:08:39 +0000119 </target>
120
david_williams320c0332008-01-05 05:55:44 +0000121 <!-- if build.clean if true, or does not exist, set doClean to true -->
david_williams39c5f652008-01-02 07:08:39 +0000122 <target
123 name="check.clean">
124 <condition
125 property="doClean">
126 <or>
127 <not>
128 <isset
129 property="build.clean" />
130 </not>
131 <equals
132 arg1="${build.clean}"
133 arg2="true" />
134 </or>
135 </condition>
136 </target>
137</project>