blob: a749940c6fea5b94a74acc02af2c26b8fdca15ed [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 <!-- load standard properties for production environment -->
20 <property file="${env.STANDARD_PROPERTIES_DIR}/${ant.project.name}.properties" />
21 <!-- = = = end standard properties pattern = = = -->
david_williams42f9b242006-11-27 18:45:14 +000022
david_williams70831b52007-10-05 03:27:45 +000023
24 <!--
david_williams42f9b242006-11-27 18:45:14 +000025 If not set yet, by "caller", then we set checkoutprojectname here.
26 Normally this is literally the project name from CruiseControl, but
27 if running "standalone", we make this simplifying assumption.
28 -->
david_williams70831b52007-10-05 03:27:45 +000029 <property name="build.distribution" value="wtp" />
30 <property name="buildBranch" value="R3.0" />
31 <property name="buildType" value="I" />
32 <property name="checkoutprojectname" value="${build.distribution}-${buildBranch}-${buildType}" />
david_williams42f9b242006-11-27 18:45:14 +000033
david_williams70831b52007-10-05 03:27:45 +000034 <target name="Build">
david_williams42f9b242006-11-27 18:45:14 +000035
david_williams70831b52007-10-05 03:27:45 +000036 <!-- set main builder file name, based on distribution, buildBranch and build type -->
37 <property name="wtpBuilder" value="${env.BUILD_HOME}/build-node/checkout/${checkoutprojectname}/releng.wtpbuilder/build.xml" />
38
39 <antcall target="doCleanBuild" />
40
41 <!-- and create preliminary download site files -->
42 <ant antfile="${wtpBuilder}" target="site" />
43 <!-- upload what we have so far -->
44 <ant antfile="${wtpBuilder}" target="upload" />
45
46 <antcall target="doTestPhase" />
david_williams42f9b242006-11-27 18:45:14 +000047
48
david_williams93882182007-09-28 19:38:20 +000049 </target>
david_williams42f9b242006-11-27 18:45:14 +000050
david_williams70831b52007-10-05 03:27:45 +000051 <target name="doCleanBuild" unless="skipCleanBuild">
52 <!-- clean previous build -->
53 <antcall target="clean" />
54
55 <!-- check out fresh set of appropriate files -->
56 <!-- this is to make sure maps and builders are correct, but also to
57 make sure the cruisecontrol triggered "diffs" are accurate next
58 time around -->
59 <ant antfile="checkout.xml">
60 <property name="checkoutprojectname" value="${checkoutprojectname}" />
61 </ant>
62 <!-- build -->
63 <ant antfile="${wtpBuilder}" target="build" />
64
65 </target>
66
67 <target name="doTestPhase" unless="skipUnitTests">
68 <!-- test and create test summary files -->
69 <ant antfile="${wtpBuilder}" target="test" />
70
71 <ant antfile="${wtpBuilder}" target="site" />
72 <!-- upload what we have so far -->
73 <ant antfile="${wtpBuilder}" target="upload" />
74 </target>
75
76 <target name="clean" depends="check.clean" if="doClean">
77 <delete dir="${env.BUILD_HOME}/projects/${checkoutprojectname}" failonerror="false" />
78 <delete dir="${env.BUILD_HOME}/tests/${checkoutprojectname}" failonerror="false" />
79 </target>
david_williams42f9b242006-11-27 18:45:14 +000080
81
david_williams70831b52007-10-05 03:27:45 +000082 <target name="check.clean">
83 <condition property="doClean">
84 <equals arg1="${build.clean}" arg2="true" />
85 </condition>
86 </target>
david_williams42f9b242006-11-27 18:45:14 +000087
88
89</project>