blob: e523f2411de17631434600369050b8005bb284e5 [file] [log] [blame]
<project
name="checkout"
default="checkout"
basedir=".">
<!-- main -->
<target
name="checkout"
depends="init, getBuilderVersion"
if="projectname">
<echo message="Version tag for ${env.RELENG}: ${mapVersionTag}"/>
</target>
<!--
The order of execution of these three worker targets is
critical, check.clean, initBuilders, and then getbuilder.
-->
<target
name="getBuilderVersion"
depends="init,check.clean,initBuilders"
if="doClean">
<!--
This is a special property file, that contains (only) the
value of builderVersion. Then, that version of the builder
is fetched to control the rest of the build
-->
<property file="${codir}/${env.RELENG}/maps/build.cfg"/>
<fail
unless="builderVersion"
message="Could not get builderVersion. Probably could not checkout build.cfg"/>
<!--
Get a new version of the wtpbuild project from CVS, version
comes from build.cfg map file
-->
<echo message="Version tag for ${env.RELENG_BUILDER} is: ${builderVersion}"/>
<cvs
reallyquiet="${env.CVS_REALLY_QUIET}"
cvsRoot="${mapCvsRoot}"
package="${env.RELENG_BUILDER}"
dest="${codir}"
tag="${builderVersion}"/>
</target>
<!--
set doClean property checkout.build.clean is set in
checkout.properties from the project properties directory
-->
<target name="check.clean"
depends="init">
<echo message="checkout.builder.clean: ${checkout.builder.clean}"/>
<condition property="doClean">
<equals
arg1="${checkout.builder.clean}"
arg2="true"
trim="true"
casesensitive="false"/>
</condition>
</target>
<!--
checkout releng from from CVS. We do this only to get the
build.cfg file which names the version of the wtpbuilder to get.
CVS src: webtools.map/releng/maps files dest: <BUILD
HOME>/projectBuilders/<project>/webtools.maps/releng/maps
-->
<target
name="initBuilders"
depends="init,check.clean"
if="doClean">
<!-- Note: it is important to remove 'codir', which is <projectBuidlers>/<project> so it
will have a fresh date/time once created during checkout ... or else it can be prematurely
cleaned up, in the middle of a build -->
<delete
dir="${codir}"
failonerror="false"/>
<mkdir dir="${codir}"/>
<cvs
reallyquiet="${env.CVS_REALLY_QUIET}"
cvsRoot="${mapCvsRoot}"
package="${env.RELENG}"
dest="${codir}"
tag="${mapVersionTag}"/>
</target>
<target name="init" unless="checkout.initialized">
<!--
Standard properties pattern. Note: to be cross-platform,
"environment variables" are only appropriate for some variables,
e.g. ones we set, since properties are case sensitive, even if
the environment variables on your operating system are not, e.g.
it will be ${env.Path} not ${env.PATH} on Windows
-->
<property environment="env"/>
<!--
Let users override standard properties, if desired. If
directory, file, or some properties do not exist, then standard
properties will be used.
-->
<property file="${env.LOCAL_BUILD_PROPERTIES_DIR}/${ant.project.name}.properties"/>
<fail
unless="projectname"
message="a projectname is required"/>
<!-- if not otherwise set, the following are good default values -->
<property
name="checkout.builder.clean"
value="true"/>
<property
name="mapVersionTag"
value="HEAD"/>
<property
name="cvsProtocol"
value="${env.BUILD_CVS_READ_PROTOCOL}"/>
<property
name="cvsUser"
value="${env.BUILD_CVS_READ_USER}"/>
<property
name="cvsServer"
value="${env.BUILD_CVS_SERVER}"/>
<property
name="cvsRoot"
value="${env.BUILD_CVS_ROOT}"/>
<!-- end required defaults-if-not-set -->
<!-- standard computed properties. Should not have to be changed. -->
<property
name="mapCvsRoot"
value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}"/>
<property
name="codir"
value="${env.PROJECT_BUILDERS}/${projectname}"/>
<echo message="projectname: ${projectname}"/>
<property name="checkout.initialized" value="true"/>
</target>
</project>