blob: ac97cd7049603744be51f8c2e0d83617d1b37eb9 [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_williams8f1cae12007-11-17 02:07:46 +000035 <property name="wtpBuilder" value="${env.BUILD_HOME}/projectBuilders/${checkoutprojectname}/${env.RELENGWTPBUILDER}/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
74 <target name="clean" depends="check.clean" if="doClean">
75 <delete dir="${env.BUILD_HOME}/projects/${checkoutprojectname}" failonerror="false" />
76 <delete dir="${env.BUILD_HOME}/tests/${checkoutprojectname}" failonerror="false" />
77 </target>
david_williams42f9b242006-11-27 18:45:14 +000078
david_williamse44e4d22007-12-11 02:11:36 +000079 <!-- if build.clean does not exist, set doClean to true -->
david_williams70831b52007-10-05 03:27:45 +000080 <target name="check.clean">
81 <condition property="doClean">
david_williamse44e4d22007-12-11 02:11:36 +000082 <or>
83 <not>
84 <isset property="build.clean"/>
85 </not>
86 <equals arg1="${build.clean}" arg2="true" />
87 </or>
david_williams70831b52007-10-05 03:27:45 +000088 </condition>
89 </target>
david_williams42f9b242006-11-27 18:45:14 +000090
91
92</project>