blob: 4115ff0a90d89ad3838500fbae1c2e7b24493adb [file] [log] [blame]
david_williamsd957bc32006-11-20 00:07:15 +00001<project
david_williams42f9b242006-11-27 18:45:14 +00002 name="label"
david_williamsd957bc32006-11-20 00:07:15 +00003 default="label"
4 basedir=".">
ndaib8cedc82005-09-13 18:00:32 +00005
david_williams42f9b242006-11-27 18:45:14 +00006 <!-- = = = standard properties pattern = = = -->
7 <!--
david_williams9e5f0a92007-08-29 00:09:02 +00008 Note to be cross-platform, "environment variables" are only appropriate for
david_williamsd957bc32006-11-20 00:07:15 +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 -->
12 <property environment="env" />
david_williams9e5f0a92007-08-29 00:09:02 +000013
david_williams42f9b242006-11-27 18:45:14 +000014 <!--
david_williams9e5f0a92007-08-29 00:09:02 +000015 Let users override standard properties, if desired.
16 If directory, file, or some properties do not exist,
17 then standard properties will be used.
18 -->
19 <property
20 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000021
22 <!-- load standard properties for production environment -->
david_williams9e5f0a92007-08-29 00:09:02 +000023 <property
24 file="${env.STANDARD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williams42f9b242006-11-27 18:45:14 +000025 <!-- = = = end standard properties pattern = = = -->
26
david_williams2a01c5a2005-11-07 14:27:16 +000027
28 <!-- Capture the computer name in a cross-platform manner -->
david_williamsd957bc32006-11-20 00:07:15 +000029 <property
30 name="env.COMPUTERNAME"
31 value="${env.HOSTNAME}" />
david_williams2a01c5a2005-11-07 14:27:16 +000032
33
david_williamsd957bc32006-11-20 00:07:15 +000034 <target name="label">
35 <available
36 file="${buildDirectory}/label.properties"
37 property="label.properties.exists" />
38 <antcall target="create.label.properties" />
ndaib8cedc82005-09-13 18:00:32 +000039 </target>
40
david_williamsd957bc32006-11-20 00:07:15 +000041 <target
42 name="create.label.properties"
43 unless="label.properties.exists">
44 <mkdir dir="${buildDirectory}" />
45 <tstamp>
46 <format
47 property="date"
48 pattern="yyyyMMdd"
49 timezone="UTC" />
50 </tstamp>
51 <tstamp>
52 <format
53 property="time"
54 pattern="HHmm"
55 timezone="UTC" />
56 </tstamp>
david_williams9e5f0a92007-08-29 00:09:02 +000057
58 <echo message="cctimestamp: ${cctimestamp}" />
59 <echo message="datetime: ${date}${time} " />
60 <condition
61 property="timestamp"
62 value="${cctimestamp}"
63 else="${date}${time}">
64 <isset property="cctimestamp" />
65 </condition>
66 <echo message="timestamp: ${timestamp}" />
67
david_williamsd957bc32006-11-20 00:07:15 +000068 <property
69 name="buildType"
70 value="I" />
71 <property
72 name="buildId"
73 value="${buildType}${timestamp}" />
ndaib8cedc82005-09-13 18:00:32 +000074
david_williamsd957bc32006-11-20 00:07:15 +000075 <!--this naming convention used by php scripts on download server-->
76 <property
77 name="buildLabel"
78 value="${buildType}-${buildId}-${timestamp}" />
ndaib8cedc82005-09-13 18:00:32 +000079
david_williamsd957bc32006-11-20 00:07:15 +000080 <!--store the build label information in a file-->
81 <echo
82 file="${buildDirectory}/label.properties"
83 append="true">
84 buildType=${buildType}
85 </echo>
86 <echo
87 file="${buildDirectory}/label.properties"
88 append="true">
89 buildId=${buildId}
90 </echo>
91 <echo
92 file="${buildDirectory}/label.properties"
93 append="true">
94 timestamp=${timestamp}
95 </echo>
96 <echo
97 file="${buildDirectory}/label.properties"
98 append="true">
99 buildLabel=${buildLabel}
100 </echo>
david_williams0a7857a2007-09-22 06:41:24 +0000101 <echo
102 file="${buildDirectory}/label.properties"
103 append="true">
104 buildBranch=${buildBranch}
105 </echo>
david_williamsd957bc32006-11-20 00:07:15 +0000106 <echo
107 file="${buildDirectory}/buildmachineinfo.properties"
108 append="true">
109 buildComputer="${env.COMPUTERNAME}" buildOS="${env.OS}"
110 </echo>
david_williams2a01c5a2005-11-07 14:27:16 +0000111
112 </target>
ndaib8cedc82005-09-13 18:00:32 +0000113
114</project>