blob: 21b26493339572169991a1558ba159f05230b5f3 [file] [log] [blame]
david_williams7888d502007-06-29 06:26:51 +00001<project
2 name="checkout"
3 default="checkout"
4 basedir=".">
david_williamsbb0fc612006-05-19 10:28:20 +00005
david_williams800adca2008-06-30 22:52:33 +00006 <!-- = = = standard properties pattern = = =
7
david_williamsa7f68be2007-06-20 02:17:13 +00008 Note to be cross-platform, "environment variables" are only appropriate for
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
david_williams42f9b242006-11-27 18:45:14 +000011 be ${env.Path} not ${env.PATH} on Windows -->
david_williams800adca2008-06-30 22:52:33 +000012 <property environment="env" />
david_williams13d378c2007-08-22 04:04:54 +000013
david_williamsa7f68be2007-06-20 02:17:13 +000014 <!--
15 Let users override standard properties, if desired.
16 If directory, file, or some properties do not exist,
17 then standard properties will be used.
david_williams7888d502007-06-29 06:26:51 +000018 -->
david_williams800adca2008-06-30 22:52:33 +000019 <property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties" />
david_williamsbb0fc612006-05-19 10:28:20 +000020
david_williams42f9b242006-11-27 18:45:14 +000021 <!-- = = = end standard properties pattern = = = -->
22
david_williams800adca2008-06-30 22:52:33 +000023 <fail
24 unless="projectname"
25 message="a projectname is required" />
26
david_williamsf64f0222006-11-28 21:37:13 +000027 <!-- if not otherwise set, the following are good default values -->
david_williams7888d502007-06-29 06:26:51 +000028 <property
david_williamseceb39b2008-01-02 04:21:44 +000029 name="checkout.builder.clean"
david_williams7888d502007-06-29 06:26:51 +000030 value="true" />
31 <property
32 name="mapVersionTag"
33 value="HEAD" />
david_williams842e4192007-12-09 07:44:35 +000034 <property
35 name="cvsProtocol"
david_williams2e0afe02008-01-02 04:11:40 +000036 value="${env.BUILD_CVS_WRITE_PROTOCOL}" />
david_williams842e4192007-12-09 07:44:35 +000037 <property
38 name="cvsUser"
david_williams2e0afe02008-01-02 04:11:40 +000039 value="${env.BUILD_CVS_WRITE_USER}" />
david_williams842e4192007-12-09 07:44:35 +000040 <property
41 name="cvsServer"
david_williams2e0afe02008-01-02 04:11:40 +000042 value="${env.BUILD_CVS_SERVER}" />
david_williams842e4192007-12-09 07:44:35 +000043 <property
44 name="cvsRoot"
david_williams2e0afe02008-01-02 04:11:40 +000045 value="${env.BUILD_CVS_ROOT}" />
david_williams842e4192007-12-09 07:44:35 +000046
47 <!-- end required defaults-if-not-set -->
48
49
david_williams842e4192007-12-09 07:44:35 +000050 <!-- standard computed properties. Should not have to be changed. -->
david_williams7888d502007-06-29 06:26:51 +000051 <property
52 name="mapCvsRoot"
53 value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}" />
david_williams7888d502007-06-29 06:26:51 +000054 <property
55 name="codir"
david_williamsf7354602008-01-08 04:28:04 +000056 value="${env.PROJECT_BUILDERS}/${projectname}" />
david_williams800adca2008-06-30 22:52:33 +000057 <echo message="projectname: ${projectname}" />
david_williams1e71b282008-03-10 10:12:40 +000058
david_williams800adca2008-06-30 22:52:33 +000059 <!-- main -->
60 <target
david_williams7888d502007-06-29 06:26:51 +000061 name="checkout"
david_williamsf7354602008-01-08 04:28:04 +000062 if="projectname">
david_williams42f9b242006-11-27 18:45:14 +000063 <!-- we always check and init the builder -->
david_williams800adca2008-06-30 22:52:33 +000064 <antcall target="getbuilder" />
david_williams42f9b242006-11-27 18:45:14 +000065 </target>
david_williams4432d732008-01-08 04:47:04 +000066
david_williamsa7f68be2007-06-20 02:17:13 +000067
68 <!--
david_williams42f9b242006-11-27 18:45:14 +000069 The order of execution of these three worker targets
david_williamsa7f68be2007-06-20 02:17:13 +000070 is critical, check.clean, initBuilders, and
david_williams39c5f652008-01-02 07:08:39 +000071 then getbuilder.
david_williams42f9b242006-11-27 18:45:14 +000072 -->
david_williams7888d502007-06-29 06:26:51 +000073 <target
david_williams39c5f652008-01-02 07:08:39 +000074 name="getbuilder"
david_williams7888d502007-06-29 06:26:51 +000075 depends="check.clean,initBuilders"
76 if="doClean">
david_williamsa7f68be2007-06-20 02:17:13 +000077 <!-- This is a special property file, that contains (only) the
david_williams39c5f652008-01-02 07:08:39 +000078 value of builderVersion. Then, that version of the builder
david_williams7888d502007-06-29 06:26:51 +000079 is fetched to control the rest of the build -->
david_williams800adca2008-06-30 22:52:33 +000080 <property file="${codir}/${env.RELENG}/maps/build.cfg" />
81 <fail
82 unless="builderVersion"
83 message="Could not get builderVersion. Probably could not checkout build.cfg" />
david_williams1e71b282008-03-10 10:12:40 +000084
david_williams800adca2008-06-30 22:52:33 +000085 <!--
86 deleting WTP builder project
87 location: <BUILD HOME>/projectBuilders/<project>/webtools.releng/releng.wtpbuilder
88 -->
89 <delete
david_williams2e0afe02008-01-02 04:11:40 +000090 dir="${codir}/${env.RELENG_BUILDER}"
david_williams7888d502007-06-29 06:26:51 +000091 failonerror="false" />
david_williams800adca2008-06-30 22:52:33 +000092 <!--
93 Get a new version of the wtpbuild project from CVS, version comes from build.cfg map file
94 -->
95 <echo message="Version tag for ${env.RELENG_BUILDER} is: ${builderVersion}" />
david_williams7888d502007-06-29 06:26:51 +000096 <cvs
david_williams13d378c2007-08-22 04:04:54 +000097 quiet="${env.CVS_QUIET}"
98 reallyquiet="${env.CVS_REALLY_QUIET}"
david_williams7888d502007-06-29 06:26:51 +000099 cvsRoot="${mapCvsRoot}"
david_williams2e0afe02008-01-02 04:11:40 +0000100 package="${env.RELENG_BUILDER}"
david_williams7888d502007-06-29 06:26:51 +0000101 dest="${codir}"
david_williams39c5f652008-01-02 07:08:39 +0000102 tag="${builderVersion}" />
david_williams42f9b242006-11-27 18:45:14 +0000103 </target>
david_williams800adca2008-06-30 22:52:33 +0000104
david_williams1e71b282008-03-10 10:12:40 +0000105 <!--
106 set doClean property
107 checkout.build.clean is set in checkout.properties from the project properties directory
david_williams800adca2008-06-30 22:52:33 +0000108 -->
109 <target name="check.clean">
110 <echo message="checkout.builder.clean: ${checkout.builder.clean}" />
111 <condition property="doClean">
david_williams7888d502007-06-29 06:26:51 +0000112 <equals
david_williamseceb39b2008-01-02 04:21:44 +0000113 arg1="${checkout.builder.clean}"
david_williams7888d502007-06-29 06:26:51 +0000114 arg2="true"
115 trim="true"
116 casesensitive="false" />
david_williams42f9b242006-11-27 18:45:14 +0000117 </condition>
118 </target>
david_williams800adca2008-06-30 22:52:33 +0000119
david_williams1e71b282008-03-10 10:12:40 +0000120 <!--
david_williams800adca2008-06-30 22:52:33 +0000121 checkout releng from from CVS. We do this only to get the build.cfg file
122 which names the version of the wtpbuilder to get.
david_williams1e71b282008-03-10 10:12:40 +0000123 CVS src: webtools.map/releng/maps files
124 dest: <BUILD HOME>/projectBuilders/<project>/webtools.maps/releng/maps
david_williams800adca2008-06-30 22:52:33 +0000125 -->
david_williams7888d502007-06-29 06:26:51 +0000126 <target
127 name="initBuilders"
128 depends="check.clean"
129 if="doClean">
david_williams800adca2008-06-30 22:52:33 +0000130 <echo message="Version tag for ${env.RELENG}: ${mapVersionTag}" />
david_williams7888d502007-06-29 06:26:51 +0000131 <cvs
132 quiet="true"
133 cvsRoot="${mapCvsRoot}"
david_williamsa5570522007-11-16 23:12:47 +0000134 package="${env.RELENG}"
david_williams7888d502007-06-29 06:26:51 +0000135 dest="${codir}"
136 tag="${mapVersionTag}" />
david_williams42f9b242006-11-27 18:45:14 +0000137 </target>
david_williams39c5f652008-01-02 07:08:39 +0000138</project>