david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 1 | <project |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 2 | name="label" |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 3 | default="label" |
| 4 | basedir="."> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 5 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 6 | <!-- = = = standard properties pattern = = = --> |
| 7 | <!-- |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 8 | Note to be cross-platform, "environment variables" are only appropriate for |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 9 | 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_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 12 | <property |
| 13 | environment="env" /> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 14 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 15 | <!-- |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 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. |
| 19 | --> |
| 20 | <property |
| 21 | file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" /> |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 22 | |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 23 | <!-- = = = end standard properties pattern = = = --> |
| 24 | |
david_williams | 2a01c5a | 2005-11-07 14:27:16 +0000 | [diff] [blame] | 25 | |
| 26 | <!-- Capture the computer name in a cross-platform manner --> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 27 | <property |
| 28 | name="env.COMPUTERNAME" |
| 29 | value="${env.HOSTNAME}" /> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 30 | <target |
| 31 | name="label"> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 32 | <available |
| 33 | file="${buildDirectory}/label.properties" |
| 34 | property="label.properties.exists" /> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 35 | <antcall |
| 36 | target="create.label.properties" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 37 | </target> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 38 | <target |
| 39 | name="create.label.properties" |
| 40 | unless="label.properties.exists"> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 41 | <mkdir |
| 42 | dir="${buildDirectory}" /> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 43 | <tstamp> |
| 44 | <format |
| 45 | property="date" |
| 46 | pattern="yyyyMMdd" |
| 47 | timezone="UTC" /> |
| 48 | </tstamp> |
| 49 | <tstamp> |
| 50 | <format |
| 51 | property="time" |
| 52 | pattern="HHmm" |
| 53 | timezone="UTC" /> |
| 54 | </tstamp> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 55 | <echo |
| 56 | message="cctimestamp: ${cctimestamp}" /> |
| 57 | <echo |
| 58 | message="datetime: ${date}${time} " /> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 59 | <condition |
| 60 | property="timestamp" |
| 61 | value="${cctimestamp}" |
| 62 | else="${date}${time}"> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 63 | <isset |
| 64 | property="cctimestamp" /> |
david_williams | 9e5f0a9 | 2007-08-29 00:09:02 +0000 | [diff] [blame] | 65 | </condition> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 66 | <echo |
| 67 | message="timestamp: ${timestamp}" /> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 68 | <property |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 69 | name="timestamp" |
| 70 | value="${date}${time}" /> |
| 71 | <fail |
| 72 | unless="buildType" /> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 73 | <property |
| 74 | name="buildId" |
| 75 | value="${buildType}${timestamp}" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 76 | |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 77 | <!--this naming convention used by php scripts on download server--> |
| 78 | <property |
| 79 | name="buildLabel" |
| 80 | value="${buildType}-${buildId}-${timestamp}" /> |
ndai | b8cedc8 | 2005-09-13 18:00:32 +0000 | [diff] [blame] | 81 | |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 82 | <!--store the build label information in a file--> |
david_williams | 8d027fe | 2008-02-13 05:34:37 +0000 | [diff] [blame] | 83 | <!--note the line.separator is required to be immune to the exact formatting --> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 84 | <echo |
| 85 | file="${buildDirectory}/label.properties" |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 86 | append="true"> buildType=${buildType}${line.separator}</echo> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 87 | <echo |
| 88 | file="${buildDirectory}/label.properties" |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 89 | append="true"> buildId=${buildId}${line.separator}</echo> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 90 | <echo |
| 91 | file="${buildDirectory}/label.properties" |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 92 | append="true"> timestamp=${timestamp}${line.separator}</echo> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 93 | <echo |
| 94 | file="${buildDirectory}/label.properties" |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 95 | append="true"> buildLabel=${buildLabel}${line.separator}</echo> |
david_williams | 0a7857a | 2007-09-22 06:41:24 +0000 | [diff] [blame] | 96 | <echo |
| 97 | file="${buildDirectory}/label.properties" |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 98 | append="true"> date=${date}${line.separator}</echo> |
| 99 | <echo |
| 100 | file="${buildDirectory}/label.properties" |
| 101 | append="true"> time=${time}${line.separator}</echo> |
david_williams | d957bc3 | 2006-11-20 00:07:15 +0000 | [diff] [blame] | 102 | <echo |
| 103 | file="${buildDirectory}/buildmachineinfo.properties" |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 104 | append="true"> buildComputer=${env.COMPUTERNAME}${line.separator} |
| 105 | buildOS=${env.OS}${line.separator}</echo> |
| 106 | <echo |
| 107 | file="${buildDirectory}/label.properties" |
| 108 | append="true"> buildBranch=${buildBranch}${line.separator}</echo> |
david_williams | 2a01c5a | 2005-11-07 14:27:16 +0000 | [diff] [blame] | 109 | </target> |
david_williams | beaaf1a | 2008-01-03 01:50:13 +0000 | [diff] [blame] | 110 | </project> |