blob: 25b60b418ef9bdebea3da0be67f2bed4b20a870c [file] [log] [blame]
david_williams7888d502007-06-29 06:26:51 +00001<project
2 name="checkout"
3 default="checkout"
4 basedir=".">
david_williamsa7f68be2007-06-20 02:17:13 +00005 <!--
david_williamsc2f548c2008-07-21 04:06:47 +00006 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
david_williams7888d502007-06-29 06:26:51 +000011 -->
david_williamsc2f548c2008-07-21 04:06:47 +000012 <property
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 -->
19 <property
20 file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
david_williams800adca2008-06-30 22:52:33 +000021 <fail
22 unless="projectname"
david_williamsc2f548c2008-07-21 04:06:47 +000023 message="a projectname is required"/>
david_williams800adca2008-06-30 22:52:33 +000024
david_williamsf64f0222006-11-28 21:37:13 +000025 <!-- if not otherwise set, the following are good default values -->
david_williams7888d502007-06-29 06:26:51 +000026 <property
david_williamseceb39b2008-01-02 04:21:44 +000027 name="checkout.builder.clean"
david_williamsc2f548c2008-07-21 04:06:47 +000028 value="true"/>
david_williams7888d502007-06-29 06:26:51 +000029 <property
30 name="mapVersionTag"
david_williamsc2f548c2008-07-21 04:06:47 +000031 value="HEAD"/>
david_williams842e4192007-12-09 07:44:35 +000032 <property
33 name="cvsProtocol"
david_williamsc2f548c2008-07-21 04:06:47 +000034 value="${env.BUILD_CVS_WRITE_PROTOCOL}"/>
david_williams842e4192007-12-09 07:44:35 +000035 <property
36 name="cvsUser"
david_williamsc2f548c2008-07-21 04:06:47 +000037 value="${env.BUILD_CVS_WRITE_USER}"/>
david_williams842e4192007-12-09 07:44:35 +000038 <property
39 name="cvsServer"
david_williamsc2f548c2008-07-21 04:06:47 +000040 value="${env.BUILD_CVS_SERVER}"/>
david_williams842e4192007-12-09 07:44:35 +000041 <property
42 name="cvsRoot"
david_williamsc2f548c2008-07-21 04:06:47 +000043 value="${env.BUILD_CVS_ROOT}"/>
david_williams842e4192007-12-09 07:44:35 +000044
45 <!-- end required defaults-if-not-set -->
46
47
david_williams842e4192007-12-09 07:44:35 +000048 <!-- standard computed properties. Should not have to be changed. -->
david_williams7888d502007-06-29 06:26:51 +000049 <property
50 name="mapCvsRoot"
david_williamsc2f548c2008-07-21 04:06:47 +000051 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}"/>
david_williams7888d502007-06-29 06:26:51 +000052 <property
53 name="codir"
david_williamsc2f548c2008-07-21 04:06:47 +000054 value="${env.PROJECT_BUILDERS}/${projectname}"/>
55 <echo
56 message="projectname: ${projectname}"/>
david_williams1e71b282008-03-10 10:12:40 +000057
david_williams800adca2008-06-30 22:52:33 +000058 <!-- main -->
59 <target
david_williams7888d502007-06-29 06:26:51 +000060 name="checkout"
david_williamsf7354602008-01-08 04:28:04 +000061 if="projectname">
david_williams42f9b242006-11-27 18:45:14 +000062 <!-- we always check and init the builder -->
david_williamsc2f548c2008-07-21 04:06:47 +000063 <antcall
64 target="getbuilder"/>
david_williams42f9b242006-11-27 18:45:14 +000065 </target>
david_williamsa7f68be2007-06-20 02:17:13 +000066 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000067 The order of execution of these three worker targets is
68 critical, check.clean, initBuilders, and then getbuilder.
david_williams42f9b242006-11-27 18:45:14 +000069 -->
david_williams7888d502007-06-29 06:26:51 +000070 <target
david_williams39c5f652008-01-02 07:08:39 +000071 name="getbuilder"
david_williams7888d502007-06-29 06:26:51 +000072 depends="check.clean,initBuilders"
73 if="doClean">
david_williamsc2f548c2008-07-21 04:06:47 +000074 <!--
75 This is a special property file, that contains (only) the
david_williams39c5f652008-01-02 07:08:39 +000076 value of builderVersion. Then, that version of the builder
david_williamsc2f548c2008-07-21 04:06:47 +000077 is fetched to control the rest of the build
78 -->
79 <property
80 file="${codir}/${env.RELENG}/maps/build.cfg"/>
david_williams800adca2008-06-30 22:52:33 +000081 <fail
82 unless="builderVersion"
david_williamsc2f548c2008-07-21 04:06:47 +000083 message="Could not get builderVersion. Probably could not checkout build.cfg"/>
david_williams800adca2008-06-30 22:52:33 +000084 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000085 deleting WTP builder project location: <BUILD
86 HOME>/projectBuilders/<project>/webtools.releng/releng.wtpbuilder
david_williams800adca2008-06-30 22:52:33 +000087 -->
88 <delete
david_williams2e0afe02008-01-02 04:11:40 +000089 dir="${codir}/${env.RELENG_BUILDER}"
david_williamsc2f548c2008-07-21 04:06:47 +000090 failonerror="false"/>
david_williams800adca2008-06-30 22:52:33 +000091 <!--
david_williamsc2f548c2008-07-21 04:06:47 +000092 Get a new version of the wtpbuild project from CVS, version
93 comes from build.cfg map file
david_williams800adca2008-06-30 22:52:33 +000094 -->
david_williamsc2f548c2008-07-21 04:06:47 +000095 <echo
96 message="Version tag for ${env.RELENG_BUILDER} is: ${builderVersion}"/>
david_williams7888d502007-06-29 06:26:51 +000097 <cvs
david_williams13d378c2007-08-22 04:04:54 +000098 quiet="${env.CVS_QUIET}"
99 reallyquiet="${env.CVS_REALLY_QUIET}"
david_williams7888d502007-06-29 06:26:51 +0000100 cvsRoot="${mapCvsRoot}"
david_williams2e0afe02008-01-02 04:11:40 +0000101 package="${env.RELENG_BUILDER}"
david_williams7888d502007-06-29 06:26:51 +0000102 dest="${codir}"
david_williamsc2f548c2008-07-21 04:06:47 +0000103 tag="${builderVersion}"/>
david_williams42f9b242006-11-27 18:45:14 +0000104 </target>
david_williams1e71b282008-03-10 10:12:40 +0000105 <!--
david_williamsc2f548c2008-07-21 04:06:47 +0000106 set doClean property checkout.build.clean is set in
107 checkout.properties from the project properties directory
david_williams800adca2008-06-30 22:52:33 +0000108 -->
david_williamsc2f548c2008-07-21 04:06:47 +0000109 <target
110 name="check.clean">
111 <echo
112 message="checkout.builder.clean: ${checkout.builder.clean}"/>
113 <condition
114 property="doClean">
david_williams7888d502007-06-29 06:26:51 +0000115 <equals
david_williamseceb39b2008-01-02 04:21:44 +0000116 arg1="${checkout.builder.clean}"
david_williams7888d502007-06-29 06:26:51 +0000117 arg2="true"
118 trim="true"
david_williamsc2f548c2008-07-21 04:06:47 +0000119 casesensitive="false"/>
david_williams42f9b242006-11-27 18:45:14 +0000120 </condition>
121 </target>
david_williams1e71b282008-03-10 10:12:40 +0000122 <!--
david_williamsc2f548c2008-07-21 04:06:47 +0000123 checkout releng from from CVS. We do this only to get the
124 build.cfg file which names the version of the wtpbuilder to get.
125 CVS src: webtools.map/releng/maps files dest: <BUILD
126 HOME>/projectBuilders/<project>/webtools.maps/releng/maps
david_williams800adca2008-06-30 22:52:33 +0000127 -->
david_williams7888d502007-06-29 06:26:51 +0000128 <target
129 name="initBuilders"
130 depends="check.clean"
131 if="doClean">
david_williamsc2f548c2008-07-21 04:06:47 +0000132 <echo
133 message="Version tag for ${env.RELENG}: ${mapVersionTag}"/>
david_williams7888d502007-06-29 06:26:51 +0000134 <cvs
135 quiet="true"
136 cvsRoot="${mapCvsRoot}"
david_williamsa5570522007-11-16 23:12:47 +0000137 package="${env.RELENG}"
david_williams7888d502007-06-29 06:26:51 +0000138 dest="${codir}"
david_williamsc2f548c2008-07-21 04:06:47 +0000139 tag="${mapVersionTag}"/>
david_williams42f9b242006-11-27 18:45:14 +0000140 </target>
david_williams39c5f652008-01-02 07:08:39 +0000141</project>