david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 1 | <project |
| 2 | name="cc_project_build" |
| 3 | default="Build" |
| 4 | basedir="."> |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 5 | <!-- |
| 6 | Standard properties pattern. Note: to be cross-platform, |
| 7 | "environment variables" are only appropriate for some variables, |
| 8 | e.g. ones we set, since properties are case sensitive, even if |
| 9 | the environment variables on your operating system are not, e.g. |
| 10 | it will be ${env.Path} not ${env.PATH} on Windows |
| 11 | --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 12 | <property |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 13 | environment="env"/> |
| 14 | <!-- |
| 15 | Let users override standard properties, if desired. If |
| 16 | directory, file, or some properties do not exist, then standard |
| 17 | properties will be used. |
| 18 | --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 19 | <property |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 20 | file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 21 | |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 22 | <!-- = = = end standard properties pattern = = = --> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 23 | |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 24 | <!-- if not otherwise set, build clean --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 25 | <property |
| 26 | name="build.clean" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 27 | value="true"/> |
| 28 | <!-- |
| 29 | set main builder file name, based on distribution, buildBranch |
| 30 | and build type |
| 31 | --> |
david_williams | 0d90cde | 2008-01-05 05:59:43 +0000 | [diff] [blame] | 32 | <property |
| 33 | name="builder" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 34 | value="${env.PROJECT_BUILDERS}/${projectname}/${env.RELENG_BUILDER}/build.xml"/> |
| 35 | <!-- |
| 36 | If not set yet, by "caller", then fail fast. Normally this is |
| 37 | literally the project name from CruiseControl, but if running |
| 38 | "standalone", it would have to be set to something similar to |
| 39 | one of the cc_config project name, such as wtp-R3.0-I. |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 40 | --> |
david_williams | 320c033 | 2008-01-05 05:55:44 +0000 | [diff] [blame] | 41 | <fail |
david_williams | 958e583 | 2008-02-13 05:08:44 +0000 | [diff] [blame] | 42 | unless="projectname" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 43 | message="projectname must be set by caller"/> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 44 | |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 45 | <!-- if not otherwise set, the following are good default values --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 46 | <property |
| 47 | name="mapVersionTag" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 48 | value="HEAD"/> |
| 49 | |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 50 | <!-- main --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 51 | <target |
| 52 | name="Build"> |
david_williams | 2c9dcbc | 2010-09-12 03:25:19 +0000 | [diff] [blame] | 53 | <echoproperties/> |
| 54 | |
david_williams | 320c033 | 2008-01-05 05:55:44 +0000 | [diff] [blame] | 55 | <antcall |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 56 | target="doBuildPhase"/> |
david_williams | 320c033 | 2008-01-05 05:55:44 +0000 | [diff] [blame] | 57 | <antcall |
david_williams | 8994edf | 2010-09-26 03:49:34 +0000 | [diff] [blame] | 58 | target="doPackagePhase"/> |
| 59 | <antcall |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 60 | target="doTestPhase"/> |
david_williams | 958e583 | 2008-02-13 05:08:44 +0000 | [diff] [blame] | 61 | <antcall |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 62 | target="checkIfFailedTests"/> |
david_williams | 320c033 | 2008-01-05 05:55:44 +0000 | [diff] [blame] | 63 | </target> |
| 64 | <target |
david_williams | 958e583 | 2008-02-13 05:08:44 +0000 | [diff] [blame] | 65 | name="checkIfFailedTests" |
| 66 | depends="checkFailedFile" |
| 67 | if="failedMessage"> |
david_williams | a0c95f7 | 2008-02-13 05:14:14 +0000 | [diff] [blame] | 68 | <fail |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 69 | message="Build failed due to failing JUnits in the following test plugin(s):${line.separator}${failedMessage}"/> |
david_williams | 958e583 | 2008-02-13 05:08:44 +0000 | [diff] [blame] | 70 | </target> |
david_williams | a0c95f7 | 2008-02-13 05:14:14 +0000 | [diff] [blame] | 71 | <target |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 72 | name="checkFailedFile" |
| 73 | unless="passBuildEvenIfFailedTests"> |
david_williams | a0c95f7 | 2008-02-13 05:14:14 +0000 | [diff] [blame] | 74 | <loadresource |
| 75 | property="failedMessage" |
| 76 | quiet="true" |
| 77 | failonerror="false"> |
| 78 | <file |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 79 | file="${env.PROJECT_PROJECTS}/${projectname}/workdir/junitFailureList.log"/> |
david_williams | a0c95f7 | 2008-02-13 05:14:14 +0000 | [diff] [blame] | 80 | </loadresource> |
| 81 | </target> |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 82 | <!-- |
| 83 | 1) clean build if build.clean s set to true 2) retreive fresh |
| 84 | files from CVS 3) build and upload results |
| 85 | --> |
| 86 | <target |
david_williams | d2fa7ee | 2008-02-03 21:32:17 +0000 | [diff] [blame] | 87 | name="doBuildPhase"> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 88 | <antcall |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 89 | target="doCleanBuild"/> |
david_williams | 70831b5 | 2007-10-05 03:27:45 +0000 | [diff] [blame] | 90 | |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 91 | <!-- Create preliminary download site files --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 92 | <ant |
| 93 | antfile="${builder}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 94 | target="site"/> |
david_williams | dc26991 | 2010-08-22 23:08:44 +0000 | [diff] [blame] | 95 | |
| 96 | <ant |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 97 | antfile="cc_copyArtifacts.xml"/> |
david_williams | dc26991 | 2010-08-22 23:08:44 +0000 | [diff] [blame] | 98 | |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 99 | </target> |
| 100 | <target |
| 101 | name="doCleanBuild" |
| 102 | unless="skipCleanBuild"> |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 103 | <!-- clean previous build --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 104 | <antcall |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 105 | target="clean"/> |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 106 | <!-- check out fresh set of appropriate files for the builder --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 107 | <ant |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 108 | antfile="checkout.xml"/> |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 109 | <!-- build and create preliminary download site files --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 110 | <ant |
| 111 | antfile="${builder}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 112 | target="build"/> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 113 | </target> |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 114 | <!-- |
| 115 | test phase runs tests, creates test summary files, and uploads |
| 116 | results |
| 117 | --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 118 | <target |
| 119 | name="doTestPhase" |
| 120 | unless="skipUnitTests"> |
david_williams | d84c220 | 2008-01-05 06:45:17 +0000 | [diff] [blame] | 121 | <delete |
david_williams | 14cadd1 | 2011-03-23 06:43:39 +0000 | [diff] [blame] | 122 | quiet="true" |
david_williams | d84c220 | 2008-01-05 06:45:17 +0000 | [diff] [blame] | 123 | dir="${env.PROJECT_TESTS}/${projectname}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 124 | failonerror="false"/> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 125 | <ant |
| 126 | antfile="${builder}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 127 | target="test"/> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 128 | <ant |
| 129 | antfile="${builder}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 130 | target="site"/> |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 131 | |
david_williams | 8994edf | 2010-09-26 03:49:34 +0000 | [diff] [blame] | 132 | </target> |
| 133 | <target |
| 134 | name="doPackagePhase"> |
| 135 | <ant |
| 136 | antfile="${builder}" |
| 137 | target="package"/> |
david_williams | 3c47de3 | 2010-10-05 06:34:50 +0000 | [diff] [blame] | 138 | <!-- TODO: we probably don't need to call "site" here ... just adding new zips/repos ... no prep required? --> |
david_williams | c3f8235 | 2010-10-04 16:10:14 +0000 | [diff] [blame] | 139 | <ant |
| 140 | antfile="${builder}" |
| 141 | target="site"/> |
david_williams | 3c47de3 | 2010-10-05 06:34:50 +0000 | [diff] [blame] | 142 | <ant |
| 143 | antfile="cc_copyArtifacts.xml"/> |
david_williams | 8994edf | 2010-09-26 03:49:34 +0000 | [diff] [blame] | 144 | </target> |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 145 | <!-- clean task --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 146 | <target |
| 147 | name="clean" |
| 148 | depends="check.clean" |
| 149 | if="doClean"> |
david_williams | 14cadd1 | 2011-03-23 06:43:39 +0000 | [diff] [blame] | 150 | <delete quiet="true" |
david_williams | 320c033 | 2008-01-05 05:55:44 +0000 | [diff] [blame] | 151 | dir="${env.PROJECT_PROJECTS}/${projectname}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 152 | failonerror="false"/> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 153 | <delete |
david_williams | 14cadd1 | 2011-03-23 06:43:39 +0000 | [diff] [blame] | 154 | quiet="true" |
david_williams | 320c033 | 2008-01-05 05:55:44 +0000 | [diff] [blame] | 155 | dir="${env.PROJECT_TESTS}/${projectname}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 156 | failonerror="false"/> |
david_williams | b6058f5 | 2009-12-27 22:23:15 +0000 | [diff] [blame] | 157 | |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 158 | </target> |
| 159 | |
david_williams | 66ec93d | 2009-11-21 07:06:30 +0000 | [diff] [blame] | 160 | <!-- if build.clean is true, or does not exist, set doClean to true --> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 161 | <target |
| 162 | name="check.clean"> |
| 163 | <condition |
| 164 | property="doClean"> |
| 165 | <or> |
| 166 | <not> |
| 167 | <isset |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 168 | property="build.clean"/> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 169 | </not> |
| 170 | <equals |
| 171 | arg1="${build.clean}" |
david_williams | c2f548c | 2008-07-21 04:06:47 +0000 | [diff] [blame] | 172 | arg2="true"/> |
david_williams | 39c5f65 | 2008-01-02 07:08:39 +0000 | [diff] [blame] | 173 | </or> |
| 174 | </condition> |
| 175 | </target> |
| 176 | </project> |