blob: 21ae9129aae6673390b737dd9660ee9a19f0b821 [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
56 name="doBuildPhase"
57 unless="skipCleanBuild">
david_williams39c5f652008-01-02 07:08:39 +000058 <antcall
59 target="doCleanBuild" />
david_williams70831b52007-10-05 03:27:45 +000060
david_williams320c0332008-01-05 05:55:44 +000061 <!-- and create preliminary download site files -->
david_williams39c5f652008-01-02 07:08:39 +000062 <ant
63 antfile="${builder}"
64 target="site" />
david_williams320c0332008-01-05 05:55:44 +000065 <!-- upload what we have so far -->
david_williams39c5f652008-01-02 07:08:39 +000066 <ant
67 antfile="${builder}"
68 target="upload" />
david_williams39c5f652008-01-02 07:08:39 +000069 </target>
70 <target
71 name="doCleanBuild"
72 unless="skipCleanBuild">
73 <!-- clean previous build -->
74 <antcall
75 target="clean" />
david_williams39c5f652008-01-02 07:08:39 +000076 <!-- check out fresh set of appropriate files for the builder -->
77 <ant
78 antfile="checkout.xml" />
david_williams39c5f652008-01-02 07:08:39 +000079 <!-- build and create preliminary download site files -->
80 <ant
81 antfile="${builder}"
82 target="build" />
83 </target>
david_williams320c0332008-01-05 05:55:44 +000084
85 <!-- test phase runs tests, creates test summary files, and uploads results -->
david_williams39c5f652008-01-02 07:08:39 +000086 <target
87 name="doTestPhase"
88 unless="skipUnitTests">
david_williams39c5f652008-01-02 07:08:39 +000089 <ant
90 antfile="${builder}"
91 target="test" />
92 <ant
93 antfile="${builder}"
94 target="site" />
david_williams39c5f652008-01-02 07:08:39 +000095 <ant
96 antfile="${builder}"
97 target="upload" />
98 </target>
david_williams320c0332008-01-05 05:55:44 +000099
100 <!-- clean task -->
david_williams39c5f652008-01-02 07:08:39 +0000101 <target
102 name="clean"
103 depends="check.clean"
104 if="doClean">
105 <delete
david_williams320c0332008-01-05 05:55:44 +0000106 dir="${env.PROJECT_PROJECTS}/${projectname}"
david_williams39c5f652008-01-02 07:08:39 +0000107 failonerror="false" />
108 <delete
david_williams320c0332008-01-05 05:55:44 +0000109 dir="${env.PROJECT_TESTS}/${projectname}"
110 failonerror="false" />
111 <delete
112 dir="${env.ANT_WORKING}"
david_williams39c5f652008-01-02 07:08:39 +0000113 failonerror="false" />
114 </target>
115
david_williams320c0332008-01-05 05:55:44 +0000116 <!-- if build.clean if true, or does not exist, set doClean to true -->
david_williams39c5f652008-01-02 07:08:39 +0000117 <target
118 name="check.clean">
119 <condition
120 property="doClean">
121 <or>
122 <not>
123 <isset
124 property="build.clean" />
125 </not>
126 <equals
127 arg1="${build.clean}"
128 arg2="true" />
129 </or>
130 </condition>
131 </target>
david_williams320c0332008-01-05 05:55:44 +0000132
david_williams39c5f652008-01-02 07:08:39 +0000133</project>