blob: e523f2411de17631434600369050b8005bb284e5 [file] [log] [blame]
david_williams7888d502007-06-29 06:26:51 +00001<project
2 name="checkout"
3 default="checkout"
4 basedir=".">
david_williams800adca2008-06-30 22:52:33 +00005
david_williams1e71b282008-03-10 10:12:40 +00006
david_williams800adca2008-06-30 22:52:33 +00007 <!-- main -->
8 <target
david_williams7888d502007-06-29 06:26:51 +00009 name="checkout"
david_williams14cadd12011-03-23 06:43:39 +000010 depends="init, getBuilderVersion"
david_williamsf7354602008-01-08 04:28:04 +000011 if="projectname">
david_williams14cadd12011-03-23 06:43:39 +000012
13 <echo message="Version tag for ${env.RELENG}: ${mapVersionTag}"/>
14
david_williams42f9b242006-11-27 18:45:14 +000015 </target>
david_williamsa7f68be2007-06-20 02:17:13 +000016 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000017 The order of execution of these three worker targets is
18 critical, check.clean, initBuilders, and then getbuilder.
david_williams42f9b242006-11-27 18:45:14 +000019 -->
david_williams7888d502007-06-29 06:26:51 +000020 <target
david_williams14cadd12011-03-23 06:43:39 +000021 name="getBuilderVersion"
david_williams8c1e1f02011-03-18 02:21:31 +000022 depends="init,check.clean,initBuilders"
david_williams7888d502007-06-29 06:26:51 +000023 if="doClean">
david_williamsc2f548c2008-07-21 04:06:47 +000024 <!--
25 This is a special property file, that contains (only) the
david_williams39c5f652008-01-02 07:08:39 +000026 value of builderVersion. Then, that version of the builder
david_williamsc2f548c2008-07-21 04:06:47 +000027 is fetched to control the rest of the build
28 -->
david_williams1e234162011-02-27 01:41:15 +000029 <property file="${codir}/${env.RELENG}/maps/build.cfg"/>
david_williams800adca2008-06-30 22:52:33 +000030 <fail
31 unless="builderVersion"
david_williamsc2f548c2008-07-21 04:06:47 +000032 message="Could not get builderVersion. Probably could not checkout build.cfg"/>
david_williams800adca2008-06-30 22:52:33 +000033 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000034 Get a new version of the wtpbuild project from CVS, version
35 comes from build.cfg map file
david_williams800adca2008-06-30 22:52:33 +000036 -->
david_williams1e234162011-02-27 01:41:15 +000037 <echo message="Version tag for ${env.RELENG_BUILDER} is: ${builderVersion}"/>
david_williams7888d502007-06-29 06:26:51 +000038 <cvs
david_williams13d378c2007-08-22 04:04:54 +000039 reallyquiet="${env.CVS_REALLY_QUIET}"
david_williams7888d502007-06-29 06:26:51 +000040 cvsRoot="${mapCvsRoot}"
david_williams2e0afe02008-01-02 04:11:40 +000041 package="${env.RELENG_BUILDER}"
david_williams7888d502007-06-29 06:26:51 +000042 dest="${codir}"
david_williamsc2f548c2008-07-21 04:06:47 +000043 tag="${builderVersion}"/>
david_williams42f9b242006-11-27 18:45:14 +000044 </target>
david_williams1e71b282008-03-10 10:12:40 +000045 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000046 set doClean property checkout.build.clean is set in
47 checkout.properties from the project properties directory
david_williams800adca2008-06-30 22:52:33 +000048 -->
david_williams8c1e1f02011-03-18 02:21:31 +000049 <target name="check.clean"
50 depends="init">
david_williams1e234162011-02-27 01:41:15 +000051 <echo message="checkout.builder.clean: ${checkout.builder.clean}"/>
52 <condition property="doClean">
david_williams7888d502007-06-29 06:26:51 +000053 <equals
david_williamseceb39b2008-01-02 04:21:44 +000054 arg1="${checkout.builder.clean}"
david_williams7888d502007-06-29 06:26:51 +000055 arg2="true"
56 trim="true"
david_williamsc2f548c2008-07-21 04:06:47 +000057 casesensitive="false"/>
david_williams42f9b242006-11-27 18:45:14 +000058 </condition>
59 </target>
david_williams1e71b282008-03-10 10:12:40 +000060 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000061 checkout releng from from CVS. We do this only to get the
62 build.cfg file which names the version of the wtpbuilder to get.
63 CVS src: webtools.map/releng/maps files dest: <BUILD
64 HOME>/projectBuilders/<project>/webtools.maps/releng/maps
david_williams800adca2008-06-30 22:52:33 +000065 -->
david_williams7888d502007-06-29 06:26:51 +000066 <target
67 name="initBuilders"
david_williams8c1e1f02011-03-18 02:21:31 +000068 depends="init,check.clean"
david_williams7888d502007-06-29 06:26:51 +000069 if="doClean">
david_williams1e234162011-02-27 01:41:15 +000070
71 <!-- Note: it is important to remove 'codir', which is <projectBuidlers>/<project> so it
72 will have a fresh date/time once created during checkout ... or else it can be prematurely
73 cleaned up, in the middle of a build -->
74 <delete
75 dir="${codir}"
76 failonerror="false"/>
77 <mkdir dir="${codir}"/>
david_williams14cadd12011-03-23 06:43:39 +000078
david_williams7888d502007-06-29 06:26:51 +000079 <cvs
david_williamsdf04efd2011-03-09 07:08:18 +000080 reallyquiet="${env.CVS_REALLY_QUIET}"
david_williams7888d502007-06-29 06:26:51 +000081 cvsRoot="${mapCvsRoot}"
david_williamsa5570522007-11-16 23:12:47 +000082 package="${env.RELENG}"
david_williams7888d502007-06-29 06:26:51 +000083 dest="${codir}"
david_williamsc2f548c2008-07-21 04:06:47 +000084 tag="${mapVersionTag}"/>
david_williams42f9b242006-11-27 18:45:14 +000085 </target>
david_williams8c1e1f02011-03-18 02:21:31 +000086
87 <target name="init" unless="checkout.initialized">
88 <!--
89 Standard properties pattern. Note: to be cross-platform,
90 "environment variables" are only appropriate for some variables,
91 e.g. ones we set, since properties are case sensitive, even if
92 the environment variables on your operating system are not, e.g.
93 it will be ${env.Path} not ${env.PATH} on Windows
94 -->
95 <property environment="env"/>
96 <!--
97 Let users override standard properties, if desired. If
98 directory, file, or some properties do not exist, then standard
99 properties will be used.
100 -->
101 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
102 <fail
103 unless="projectname"
104 message="a projectname is required"/>
105
106 <!-- if not otherwise set, the following are good default values -->
107 <property
108 name="checkout.builder.clean"
109 value="true"/>
110 <property
111 name="mapVersionTag"
112 value="HEAD"/>
113 <property
114 name="cvsProtocol"
david_williams1da96d62011-06-28 04:20:08 +0000115 value="${env.BUILD_CVS_READ_PROTOCOL}"/>
david_williams8c1e1f02011-03-18 02:21:31 +0000116 <property
117 name="cvsUser"
david_williams1da96d62011-06-28 04:20:08 +0000118 value="${env.BUILD_CVS_READ_USER}"/>
david_williams8c1e1f02011-03-18 02:21:31 +0000119 <property
120 name="cvsServer"
121 value="${env.BUILD_CVS_SERVER}"/>
122 <property
123 name="cvsRoot"
124 value="${env.BUILD_CVS_ROOT}"/>
125
126 <!-- end required defaults-if-not-set -->
127
128
129 <!-- standard computed properties. Should not have to be changed. -->
130 <property
131 name="mapCvsRoot"
132 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}"/>
133 <property
134 name="codir"
135 value="${env.PROJECT_BUILDERS}/${projectname}"/>
136 <echo message="projectname: ${projectname}"/>
137
138 <property name="checkout.initialized" value="true"/>
139
140 </target>
david_williams39c5f652008-01-02 07:08:39 +0000141</project>