<project name="Build specific targets and properties" default="noDefault">

	<!-- ===================================================================== -->
	<!-- Run a given ${target} on all elements being built -->
	<!-- Add one <ant> task for each top level element being built. -->
	<!-- ===================================================================== -->
	<target name="allElements">
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.core" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.dstore" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.ftp" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.local" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.ssh" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.telnet" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.sdk" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.useractions" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.remotecdt" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.wince" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.examples" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.tests" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.tm.discovery" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.tm.terminal.sdk" />
		</ant>
		<ant antfile="${genericTargets}" target="${target}">
			<property name="type" value="feature" />
			<property name="id" value="org.eclipse.rse.terminals" />
		</ant>
	</target>

	<!-- ===================================================================== -->
	<!-- Targets to assemble the built elements for particular configurations  -->
	<!-- These generally call the generated assemble scripts (named in         -->
	<!-- ${assembleScriptName}) but may also add pre and post processing       -->
	<!-- Add one target for each root element and each configuration           -->
	<!-- ===================================================================== -->

	<target name="assemble.org.eclipse.rse.core">
		<property name="archiveName" value="RSE-runtime-core-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.dstore">
		<property name="archiveName" value="RSE-runtime-dstore-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.ftp">
		<property name="archiveName" value="RSE-runtime-ftp-${buildId}.zip"/>
		<property name="copyOrbit" value="true"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.local">
		<property name="archiveName" value="RSE-runtime-local-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.ssh">
		<property name="archiveName" value="RSE-runtime-ssh-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.telnet">
		<property name="archiveName" value="RSE-runtime-telnet-${buildId}.zip"/>
		<property name="copyOrbit" value="true"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.sdk">
		<property name="archiveName" value="RSE-SDK-${buildId}.zip"/>
		<property name="copyOrbit" value="true"/>
		<property name="copyOrbitSrc" value="true"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.useractions">
		<property name="archiveName" value="RSE-useractions-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.examples">
		<property name="archiveName" value="RSE-examples-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.remotecdt">
		<property name="archiveName" value="RSE-remotecdt-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.wince">
		<property name="archiveName" value="RSE-wince-incubation-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.tests">
		<property name="archiveName" value="RSE-tests-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.tm.discovery">
		<property name="archiveName" value="TM-discovery-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.tm.terminal.sdk">
		<property name="archiveName" value="TM-terminal-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="assemble.org.eclipse.rse.terminals">
		<property name="archiveName" value="RSE-terminals-${buildId}.zip"/>
		<ant antfile="${assembleScriptName}" dir="${buildDirectory}"/>
		<antcall target="unpackUpdateJarsForPackaging" />
	</target>

	<target name="unpackUpdateJarsForPackaging" depends="myInit">
		<property name="tmpsite" value="${buildDirectory}/tmpsite" />
		<mkdir dir="${tmpsite}/new/eclipse/features" />
		<mkdir dir="${tmpsite}/new/eclipse/plugins" />
		<exec executable="unzip" dir="${buildDirectory}/${buildLabel}">
			<arg line="-q ${archiveName} -d ${tmpsite}" />
		</exec>
		<property name="orbitDest" value="${tmpsite}/eclipse"/>
		<antcall target="copyOrbitBundlesToUpdateSite"/>
		<copy todir="${buildUpdateSitePath}">
		    <fileset dir="${tmpsite}/eclipse"/>
		</copy>

		<unpackUpdateJars site="${tmpsite}/eclipse" output="${tmpsite}/new/eclipse"/>
		<antcall target="packageLicenseFiles"/>
		<zip destfile="${buildDirectory}/${buildLabel}/${archiveName}"
			basedir="${tmpsite}/new"
	  	/>
		<delete dir="${tmpsite}"/>
	</target>

	<target name="copyOrbitBundlesToUpdateSite" depends="copyOrbit,copyOrbitSrc">
	</target>

	<target name="copyOrbit" if="copyOrbit">
		<copy todir="${orbitDest}/plugins">
			<fileset dir="${buildDirectory}/plugins">
				<include name="org.apache.commons.net_*.jar"/>
				<include name="org.apache.oro_*.jar"/>
			</fileset>
		</copy>
	</target>

	<target name="copyOrbitSrc" if="copyOrbitSrc">
		<copy todir="${orbitDest}/plugins">
			<fileset dir="${buildDirectory}/plugins">
				<include name="org.apache.commons.net.source_*.jar"/>
				<include name="org.apache.oro.source_*.jar"/>
			</fileset>
		</copy>
	</target>

	<target name="packageLicenseFiles">
		<copy file="${builder}/template/epl-v10.html" todir="${tmpsite}/new/eclipse"/>
		<copy file="${builder}/template/notice.html" todir="${tmpsite}/new/eclipse"/>
	</target>

	<!-- ===================================================================== -->
	<!-- Place the map files into the "maps" directory, specify version tags -->
	<!-- ===================================================================== -->
	<target name="getMapFiles">
		<copy todir="${buildDirectory}/maps">
			<fileset dir="${builder}/maps" includes="*.map" />
		</copy>
		<replace dir="${buildDirectory}/maps" token="@tag@" value="${mapVersionTag}">
			<include name="*.map"/>
		</replace>
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do before setup -->
	<!-- ===================================================================== -->
	<target name="preSetup" depends="myInit">
		<echo message="builder = ${builder}"/>
		<echo message="builderDirectory = ${builderDirectory}"/>
		<echo message="buildProperties = ${buildProperties}"/>
		<echo message="customTargets = ${customTargets}"/>
		<echo message="genericTargets = ${genericTargets}"/>
		<echo message="buildId = ${buildId}"/>
		<echo message="buildName = ${buildName}"/>
		<echo message="buildType = ${buildType}"/>
		<echo message="buildLabel = ${buildLabel}"/>
		<echo message="tstamp = ${mydstamp}-${mytstamp} of ${dateLong}"/>
		<echo message="archivePrefix = ${archivePrefix}"/>
		<echo message="collectingFolder = ${collectingFolder}"/>
	</target>

	<target name="myInit">
		<tstamp>
			<format property="dateLong" pattern="MMM d, yyyy"/>
		</tstamp>
		<property name="messagefile" value="message.in"/>
		<property name="xxmailto" value="dsdp-tm-cvs-commit@eclipse.org"/>
		<property name="mailto" value="martin.oberhuber@windriver.com"/>
		<property name="remotedir" value="moberhuber@dev.eclipse.org:downloads-tm/downloads/drops"/>
		<condition property="doNBuild">
		    <equals arg1="${fetchTag}" arg2="HEAD"/>
		</condition>
		<condition property="doUpload">
			<equals arg1="${publishDirectory}" arg2=""/>
		</condition>
		<condition property="doCopy">
			<not><equals arg1="${publishDirectory}" arg2=""/></not>
		</condition>
		<condition property="dropDir" value="${buildType}-${buildId}-${mydstamp}${mytstamp}" else="${buildId}">
			<or>
				<equals arg1="${buildType}" arg2="S"/>
				<equals arg1="${buildType}" arg2="R"/>
				<and>
					<equals arg1="${buildType}" arg2="M"/>
					<not><matches pattern="M[0-9-]*" string="${buildId}"/></not>
				</and>
			</or>
		</condition>
		<property name="buildUpdateSitePath" value="${packageDirectory}/${dropDir}/updates"/>
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after setup but before starting the build proper -->
	<!-- ===================================================================== -->
	<target name="postSetup">
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do before fetching the build elements -->
	<!-- ===================================================================== -->
	<target name="preFetchOrbitBundles" depends="myInit" if="doNBuild">
		<!-- fetch Orbit stuff first in order to ensure we get      -->
		<!-- the latest released version even in case of an N-build -->
		<!--
		<ant antfile="${genericTargets}" target="fetchElement">
			<property name="type" value="plugin" />
			<property name="id" value="org.apache.commons.net" />
		</ant>
		-->
		<mkdir dir="${buildDirectory}/plugins"/>
		<eclipse.fetch
			elements="plugin@org.apache.oro"
			buildDirectory="${buildDirectory}"
			directory="${buildDirectory}/directory.txt"
			fetchTag=""
			configInfo="*,*,*"
			baseLocation="${baseLocation}"
		/>
		<!-- Run generated fetch script -->
		<ant antfile="${buildDirectory}/fetch_org.apache.oro.xml">
			<property name="featureOnly" value="true"/>
			<property name="featureAndPlugins" value="true"/>
		</ant>
		<eclipse.fetch
			elements="plugin@org.apache.commons.net"
			buildDirectory="${buildDirectory}"
			directory="${buildDirectory}/directory.txt"
			fetchTag=""
			configInfo="*,*,*"
			baseLocation="${baseLocation}"
		/>
		<!-- Run generated fetch script -->
		<ant antfile="${buildDirectory}/fetch_org.apache.commons.net.xml">
			<property name="featureOnly" value="true"/>
			<property name="featureAndPlugins" value="true"/>
		</ant>
	</target>

	<target name="preFetchOrbitSource" depends="myInit">
		<!-- fetch Orbit stuff since I'm not sure how to get sources -->
		<mkdir dir="${buildDirectory}/plugins"/>
		<eclipse.fetch
			elements="plugin@org.apache.oro.source"
			buildDirectory="${buildDirectory}"
			directory="${buildDirectory}/directory.txt"
			fetchTag=""
			configInfo="*,*,*"
			baseLocation="${baseLocation}"
		/>
		<!-- Run generated fetch script -->
		<ant antfile="${buildDirectory}/fetch_org.apache.oro.source.xml">
			<property name="featureOnly" value="true"/>
			<property name="featureAndPlugins" value="true"/>
		</ant>
		<eclipse.fetch
			elements="plugin@org.apache.commons.net.source"
			buildDirectory="${buildDirectory}"
			directory="${buildDirectory}/directory.txt"
			fetchTag=""
			configInfo="*,*,*"
			baseLocation="${baseLocation}"
		/>
		<!-- Run generated fetch script -->
		<ant antfile="${buildDirectory}/fetch_org.apache.commons.net.source.xml">
			<property name="featureOnly" value="true"/>
			<property name="featureAndPlugins" value="true"/>
		</ant>
	</target>

	<target name="preFetch" depends="preFetchOrbitBundles,preFetchOrbitSource">
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after fetching the build elements -->
	<!-- ===================================================================== -->
	<target name="postFetch">
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do before generating the build scripts. -->
	<!-- ===================================================================== -->
	<target name="preGenerate">
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after generating the build scripts. -->
	<!-- ===================================================================== -->
	<target name="postGenerate">
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do before running the build.xmls for the elements being built. -->
	<!-- ===================================================================== -->
	<target name="preProcess">
		<condition property="buildIdForMappings" value="${buildId} (${mydstamp}-${mytstamp})" else="${buildId}">
			<or>
				<equals arg1="${buildType}" arg2="S"/>
				<equals arg1="${buildType}" arg2="R"/>
			</or>
		</condition>
		<replace dir="${buildDirectory}/plugins" value="${buildIdForMappings}" token="@build@">
			<include name="**/about.mappings" />
		</replace>
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after running the build.xmls for the elements being built. -->
	<!-- ===================================================================== -->
	<target name="postProcess">
		<antcall target="allElements">
			<param name="target" value="gatherLogs" />
		</antcall>
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do before running assemble. -->
	<!-- ===================================================================== -->
	<target name="preAssemble">
		<antcall target="serverruntime" />
		<antcall target="hideServerStuff" />
		<antcall target="allElements">
			<param name="target" value="gatherSources" />
		</antcall>
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after  running assemble. -->
	<!-- ===================================================================== -->
	<target name="postAssemble">
		<antcall target="revealServerStuff" />
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do before running package. -->
	<!-- ===================================================================== -->
	<target name="prePackage">
		<echo message="builder - all - customTargets.xml - prePackage"/>
		<!-- TODO? -->
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after  running package. -->
	<!-- ===================================================================== -->
	<target name="postPackage">
		<echo message="builder - all - customTargets.xml - postPackage"/>
		<!-- TODO? -->
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do after the build is done. -->
	<!-- ===================================================================== -->
	<target name="postBuild" depends="myInit">
		<mkdir dir="${packageDirectory}/${dropDir}" />
		<move todir="${packageDirectory}/${dropDir}">
			<fileset dir="${buildDirectory}/${buildLabel}" includes="RSE-*.zip,TM-*.zip"/>
		</move>
		<move todir="${packageDirectory}/${dropDir}">
			<fileset dir="${buildDirectory}/${buildLabel}" includes="rseserver-*"/>
		</move>
		<copy todir="${packageDirectory}/${dropDir}" file="${buildDirectory}/directory.txt"/>
		<!-- Create and analyze the compilelog.txt file -->
		<concat destfile="${packageDirectory}/${dropDir}/compilelog.txt">
			<fileset dir="${buildDirectory}/plugins" includes="**/*.bin.log"/>
		</concat>
		<loadfile property="compileLog" srcFile="${packageDirectory}/${dropDir}/compilelog.txt"/>
		<condition property="hasErrors">
			<contains string="${compileLog}" substring=" ERROR"/>
		</condition>
		<!-- Create the index.php file -->
		<copy todir="${packageDirectory}/${dropDir}">
			<fileset dir="${builder}/template/" includes="*.php,*.gif,package.count"/>
		</copy>
		<condition property="buildTypeLong" value="Private"><equals arg1="${buildType}" arg2="P"/></condition>
		<condition property="buildTypeLong" value="Nightly"><equals arg1="${buildType}" arg2="N"/></condition>
		<condition property="buildTypeLong" value="Integration"><equals arg1="${buildType}" arg2="I"/></condition>
		<condition property="buildTypeLong" value="Stable"><equals arg1="${buildType}" arg2="S"/></condition>
		<condition property="buildTypeLong" value="Release"><equals arg1="${buildType}" arg2="R"/></condition>
		<condition property="buildTypeLong" value="Maintenance"><equals arg1="${buildType}" arg2="M"/></condition>
		<replace file="${packageDirectory}/${dropDir}/index.php">
			<replacefilter token="@buildTypeLong@" value="${buildTypeLong}"/>
			<replacefilter token="@dateLong@" value="${dateLong}"/>
			<replacefilter token="@dropDir@" value="${dropDir}"/>
			<replacefilter token="@buildId@" value="${buildId}"/>
		</replace>
		<replace file="${packageDirectory}/${dropDir}/buildNotes.php">
			<replacefilter token="@dateLong@" value="${dateLong}"/>
			<replacefilter token="@buildId@" value="${buildId}"/>
		</replace>
		<antcall target="publish"/>
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do to test the build results -->
	<!-- ===================================================================== -->
	<target name="test">
	</target>

	<!-- ===================================================================== -->
	<!-- Steps to do to publish the build results -->
	<!-- ===================================================================== -->
	<target name="publish" if="doPublish">
		<antcall target="publishCopy"/>
		<antcall target="publishUpload"/>
		<antcall target="mail"/>
	</target>

	<target name="publishCopy" depends="myInit" if="doCopy" unless="hasErrors">
		<mkdir dir="${publishDirectory}/${dropDir}" />
		<copy todir="${publishDirectory}/${dropDir}">
			<fileset dir="${packageDirectory}/${dropDir}" includes="*.zip,*.tar,*.php,*.txt,*.gif,package.count" />
		</copy>
	</target>

	<target name="publishUpload" depends="myInit" if="doUpload" unless="hasErrors">
		<exec dir="${packageDirectory}" executable="scp">
			<arg line="-r ${dropDir} ${remotedir}"/>
		</exec>
	</target>

	<target name="mail" depends="myInit">
		<antcall target="mailPass"/>
		<antcall target="mailFail"/>
	</target>
	
	<target name="mailPass" unless="hasErrors">
		<copy file="${builder}/${messagefile}" tofile="${buildDirectory}/message.txt" overwrite="true"/>
		<replace file="${buildDirectory}/message.txt">
			<replacefilter token="@dropDir@" value="${dropDir}"/>
		</replace>
		<mail subject="RSE Build ${buildId} completed"
 			tolist="${mailto}" from="martin.oberhuber@windriver.com">
			<message src="${buildDirectory}/message.txt"/>
		</mail>
	</target>

	<target name="mailFail" if="hasErrors">
		<mail subject="RSE Build ${buildId} failed"
			tolist="${mailto}" from="martin.oberhuber@windriver.com">
			<message src="${packageDirectory}/${dropDir}/compilelog.txt"/>
		</mail>
	</target>

	<!-- ===================================================================== -->
	<!-- Default target                                                        -->
	<!-- ===================================================================== -->
	<target name="noDefault">
		<echo message="You must specify a target when invoking this file" />
	</target>

	<!-- =====================================================================
	     Specialized targets to build the server runtime.           
	     ===================================================================== -->

	<target name="serverruntime">

		<property name="working" value="${buildDirectory}/${buildLabel}/rseserver"/>
		<mkdir dir="${working}" />
		<mkdir dir="${working}/jars" />

		<copy todir="${working}">
			<fileset dir="${buildDirectory}/plugins/org.eclipse.rse.services.dstore/serverruntime" includes="**" />
		</copy>

		<copy todir="${working}/jars">
			<fileset dir="${buildDirectory}/plugins/org.eclipse.dstore.core" includes="dstore_core.jar" />
			<fileset dir="${buildDirectory}/plugins/org.eclipse.dstore.extra" includes="dstore_extra_server.jar" />
			<fileset dir="${buildDirectory}/plugins/org.eclipse.rse.services" includes="clientserver.jar" />
			<fileset dir="${buildDirectory}/plugins/org.eclipse.rse.services.dstore" includes="dstore_miners.jar" />
		</copy>

		<antcall target="rseserver-os-tar">
			<param name="os" value="unix"/>
			<param name="eol" value="lf"/>
		</antcall>
		<antcall target="rseserver-os-tar">
			<param name="os" value="macosx"/>
			<param name="eol" value="lf"/>
		</antcall>
		<antcall target="rseserver-os-tar">
			<param name="os" value="linux"/>
			<param name="eol" value="lf"/>
		</antcall>
		<antcall target="rseserver-os-zip">
			<param name="os" value="windows"/>
			<param name="eol" value="crlf"/>
		</antcall>

		<delete dir="${working}" />

	</target>

	<target name="rseserver-os-tar" depends="rseserver-os-collect">
		<tar destfile="${buildDirectory}/${buildLabel}/rseserver-${buildId}-${os}.tar">
			<tarfileset dir="${working}/collector" mode="755" includes="*.pl,*.sh" />
			<tarfileset dir="${working}/collector" mode="644" excludes="*.pl,*.sh" />
		</tar>
		<delete dir="${working}/collector" />
	</target>
	<target name="rseserver-os-zip" depends="rseserver-os-collect">
		<zip destfile="${buildDirectory}/${buildLabel}/rseserver-${buildId}-${os}.zip" basedir="${working}/collector" includes="*"/>
		<delete dir="${working}/collector" />
	</target>

	<target name="rseserver-os-collect">
		<mkdir dir="${working}/collector" />
		<copy todir="${working}/collector">
			<fileset dir="${working}/scripts/${os}" includes="*"/>
			<fileset dir="${working}/data" includes="*"/>
		</copy>
		<replace file="${working}/collector/build.dat">
			<replacefilter token="@build@" value="${buildId}"/>
			<replacefilter token="@version@" value="${mapVersionTag}"/>
		</replace>
		<fixcrlf srcdir="${working}/collector" eol="${eol}" eof="asis" includes="*"/>
		<copy todir="${working}/collector">
			<fileset dir="${working}/jars" includes="*"/>
			<fileset dir="${builder}/template" includes="notice.html,epl-v10.html" />
		</copy>
	</target>

	<!-- =====================================================================
	     Specialized targets hide/reveal the server stuff so it doesn't get packaged
	     in the client.          
	     ===================================================================== -->

	<target name="hideServerStuff">
		<mkdir dir="${buildDirectory}/hidden"/>
		<move todir="${buildDirectory}/hidden">
			<fileset dir="${buildDirectory}/plugins">
				<include name="**/clientserver.jar"/>
				<include name="**/dstore_core.jar"/>
				<include name="**/dstore_extra_server.jar"/>
				<include name="**/dstore_miners.jar"/>
				<include name="**/clientserversrc.zip"/>
				<include name="**/dstore_coresrc.zip"/>
				<include name="**/dstore_extra_serversrc.zip"/>
				<include name="**/dstore_minerssrc.zip"/>
			</fileset>
		</move>
	</target>

	<target name="revealServerStuff">
		<move todir="${buildDirectory}/plugins">
			<fileset dir="${buildDirectory}/hidden" includes="**" />
		</move>
		<delete dir="${buildDirectory}/hidden"/>
	</target>

	<!-- ===================================================================== -->
	<!-- Zip the docs                                                          -->
	<!-- ===================================================================== -->
	<target name="zipDoc">
		<zip destfile="${buildDirectory}\plugins\${docPluginID}\doc.zip" filesonly="false" defaultexcludes="true">
			<fileset dir="${buildDirectory}\plugins\${docPluginID}" defaultexcludes="true">
				<include name="**/*.gif" />
				<include name="**/*.html" />
				<include name="**/*.htm" />
				<include name="**/*.GIF" />
				<include name="**/*.HTML" />
				<include name="**/*.HTM" />
				<include name="**/*.css" />
			</fileset>
		</zip>
	</target>
	
</project>
