blob: 691477d3740f9a6787ac0c7948777f3e1aa9913e [file] [log] [blame]
<project
name="maptasks"
default="noDefault"
basedir=".">
<!-- = = = 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"/>
<!-- if not otherwise set, assume "yes, do tag map files" ... but, to tag also requires correct write id, etc. -->
<property
name="build.donottagmaps"
value="false"/>
<property
name="cvsServer"
value="${env.BUILD_CVS_SERVER}"/>
<property
name="cvsRoot"
value="${env.BUILD_CVS_ROOT}"/>
<!--
use local for production builds, by default. These means
remote builds _must_ provide a valid value
This needs more work, or messes up "eclipse source" directive. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=337621
-->
<!-- these first two should be changed to "ext" for remote builds by a committer -->
<property
name="rewriteMapsLine"
value=":local:"/>
<property
name="rewriteMapsLineEscaped"
value="\:local\:"/>
<!-- these two unrewrite values should never have to be changed -->
<property
name="unrewriteMapsLine"
value=":pserver:anonymous@dev.eclipse.org:"/>
<property
name="unrewriteMapsLineEscaped"
value="\:pserver\:dev.eclipse.org\:"/>
<!-- https://bugs.eclipse.org/bugs/show_bug.cgi?id=338481
<property
name="unrewriteMapsLineEscaped"
value="\:pserver\:anonymous@dev.eclipse.org\:"/>
-->
<!--
fetchAllMaps is pure convenience. If you are tempted to modify
fetchAllMaps, chances are you should just use more specific
calls to map util in your own code
-->
<target name="fetchAllMaps"
depends="init">
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENG}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
<!--
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGCOMMON}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGSERVERTOOLS}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGJSDT}"/>
<property
name="mapTag"
value="${releng.jsdt-mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGSOURCEEDITING}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGWEBSERVICES}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGJSF}"/>
<property
name="mapTag"
value="${releng.jsf-mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGDALI}"/>
<property
name="mapTag"
value="${releng.dali-mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGJSDT}"/>
<property
name="mapTag"
value="${releng.jsdt-mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGEJBTOOLS}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
<ant
antfile="${wtp.builder.home}/scripts/build/maptasks.xml"
target="maputil">
<property
name="mapcomponent"
value="${env.RELENGJEETOOLS}"/>
<property
name="mapTag"
value="${mapVersionTag}"/>
</ant>
-->
</target>
<target name="maputil">
<!--
remember, for now, the check out and tagging operations are
seperate, since may have already been checked out, but not
tagged
-->
<fail unless="mapcomponent"/>
<fail unless="mapTag"/>
<antcall target="checkOutMaps">
<param
name="cvsPackage"
value="${mapcomponent}"/>
<param
name="versionTagParam"
value="${mapTag}"/>
</antcall>
<antcall target="tagMapFiles">
<param
name="cvsPackage"
value="${mapcomponent}"/>
</antcall>
<antcall target="tagMapFiles">
<param
name="cvsPackage"
value="${mapcomponent}"/>
</antcall>
<antcall target="rewriteMaps">
<param
name="cvsPackage"
value="${mapcomponent}"/>
</antcall>
<antcall target="rewriteMapsHttp">
<param
name="cvsPackage"
value="${mapcomponent}"/>
</antcall>
</target>
<!--
Check out the cvsPackage
-->
<target
name="checkOutMaps"
depends="checkLocal, init"
unless="mapsLocal">
<echo
level="debug"
message="mapCvsRoot: ${mapCvsRoot}"/>
<echo
level="debug"
message="cvsPackage = ${cvsPackage} "/>
<echo
level="debug"
message="versionTagParam: ${versionTagParam}"/>
<!-- if not set, fail. There are no safe assumptions. -->
<fail unless="mapCvsRoot"/>
<fail unless="cvsPackage"/>
<fail unless="versionTagParam"/>
<fail unless="buildDirectory"/>
<exec executable="git">
<arg value="clone"/>
<arg value="git://git.eclipse.org/gitroot/webtools/webtools.maps.git"/>
<arg value="${buildDirectory}/maps/webtools.maps"/>
</exec>
<exec executable="git">
<arg value="checkout"/>
<arg value="${mapVersionTag}"/>
</exec>
<!--
<cvs
cvsRoot="${mapCvsRoot}"
package="${cvsPackage}"
dest="${buildDirectory}/maps"
tag="${versionTagParam}"
reallyquiet="${env.CVS_REALLY_QUIET}"/>
-->
</target>
<!--
Tag Map Files mapCvsRoot
-->
<target
name="tagMapFiles"
depends="checktagMaps, init"
if="tagMaps">
<cvs
cvsRoot="${mapCvsRoot}"
dest="${buildDirectory}/maps/${cvsPackage}"
command="tag v${buildType}${timestamp}"
reallyquiet="${env.CVS_REALLY_QUIET}"/>
</target>
<!--
rewriteMaps tasks changes the "standard" eclipse map protocol,
user, and host name Since this should not be required (or used)
during production builds, and since machine and user specific, a
good place to define the value, rewriteMapsLine, is in
${env.LOCAL_BUILD_PROPERTIES_DIR}/maptasks.properties If
rewriteMapsLine exists, it is assume it is desired to rewrite,
and the value of rewriteMapsLine will be used. It must be a
complete replacement for :pserver:anonymous@dev.eclipse.org:
such as :ext:real-committer-id@dev.eclipse.org:
-->
<target
name="rewriteMaps"
if="rewriteMapsLine">
<echo
level="debug"
message="rewriteMapsLine: ${rewriteMapsLine}"/>
<!-- we have to check for existence, since in some builds, such as maintenance,
we check out all maps, but not all maps have been branched. -->
<available
property="packageExists"
file="${buildDirectory}/maps/${cvsPackage}"/>
<antcall target="rewritePackage"/>
</target>
<target
name="unrewriteMaps"
if="unrewriteMapsLine">
<echo
level="debug"
message="unrewriteMapsLine: ${unrewriteMapsLine}"/>
<!-- we have to check for existence, since in some builds, such as maintenance,
we check out all maps, but not all maps have been branched. -->
<!-- <available
property="packageExists"
file="${buildDirectory}/maps/${cvsPackage}"/> -->
<antcall target="unrewritePackage"/>
</target>
<target
name="rewriteMapsHttp"
if="rewriteHttpLines">
<echo
level="debug"
message="rewriteHttpLines: ${rewriteHttpLines}"/>
<!-- we have to check for existence, since in some builds, such as maintenance,
we check out all maps, but not all maps have been branched. -->
<available
property="packageExists"
file="${buildDirectory}/maps/${cvsPackage}"/>
<antcall target="rewritePackageHttp"/>
</target>
<target
name="rewritePackage"
if="packageExists">
<replace
dir="${buildDirectory}/maps/${cvsPackage}"
token="${unrewriteMapsLine}"
value="${rewriteMapsLine}">
<include name="**/*.map"/>
</replace>
</target>
<target name="unrewritePackage">
<!-- if="packageExists"> -->
<replace
dir="${buildDirectory}/maps/"
token="${rewriteMapsLine}"
value="${unrewriteMapsLine}">
<include name="**/*.map"/>
</replace>
<replace
dir="${buildDirectory}"
token="${rewriteMapsLineEscaped}"
value="${unrewriteMapsLineEscaped}">
<include name="sourceReferences.properties"/>
</replace>
<replace
dir="${buildDirectory}"
token="${rewriteMapsLine}"
value="${unrewriteMapsLine}">
<include name="directory.txt"/>
</replace>
</target>
<target
name="rewritePackageHttp"
if="packageExists">
<replace
dir="${buildDirectory}/maps/${cvsPackage}"
token="http://download.eclipse.org/"
value="${rewriteHttpLines}">
<include name="**/*.map"/>
</replace>
</target>
<!-- to summarize, tag maps files, if WRITE USER is set to something other than 'anonymous' and donottagmaps hasn't been explicitly set to true -->
<target name="checktagMaps">
<condition property="tagMaps">
<and>
<equals
arg1="${build.donottagmaps}"
arg2="false"/>
<isset property="env.BUILD_CVS_WRITE_USER"/>
<not>
<equals
arg1="${env.BUILD_CVS_WRITE_USER}"
arg2="anonymous"/>
</not>
</and>
</condition>
<echo
level="info"
message="build.donottagmaps: ${build.donottagmaps} " />
<echo
level="info"
message="tagMaps: ${tagMaps}"/>
<echo
level="info"
message="BUILD_CVS_WRITE_USER: {env.BUILD_CVS_WRITE_USER}"/>
</target>
<target name="checkLocal">
<condition property="mapsLocal">
<available file="${buildDirectory}/maps/${cvsPackage}"/>
</condition>
<echo
level="debug"
message="mapsLocal: ${mapsLocal}"/>
</target>
<target
name="init"
depends="checktagMaps, initWriteValues"
unless="tagMaps">
<property
name="cvsProtocol"
value="${env.BUILD_CVS_READ_PROTOCOL}"/>
<property
name="cvsUser"
value="${env.BUILD_CVS_READ_USER}"/>
<property
name="mapCvsRoot"
value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}"/>
<echo
level="info"
message="no tag mapCvsRoot: ${mapCvsRoot}"/>
</target>
<target
name="initWriteValues"
if="tagMaps">
<property
name="cvsProtocol"
value="${env.BUILD_CVS_WRITE_PROTOCOL}"/>
<property
name="cvsUser"
value="${env.BUILD_CVS_WRITE_USER}"/>
<property
name="mapCvsRoot"
value=":${cvsProtocol}:${cvsUser}@${cvsServer}:${cvsRoot}"/>
<echo
level="info"
message="taggable mapCvsRoot: ${mapCvsRoot}"/>
</target>
<!--
Default target
-->
<target name="noDefault">
<echo
level="error"
message="You must specify a target when invoking this file"/>
</target>
</project>