ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "sam.hendley" <sam.hend...@summus.com>
Subject Copying multiple source trees without loops
Date Thu, 08 Feb 2007 00:46:59 GMT

I have been hacking at this problem for about an hour and I have to believe
that there must just be something basic I am missing. I am rewriting our
build scripts to be more maintainable, useful and faster. I am trying to
avoid using antcontrib this time as all the loops and antcalls I had were
killing the performance of the script. Anyways here is the situation, I have
the source for different builds spread out over a few source directories
which I then collect in temporary directory before compiling. Lets say they
look like this: 
<pre>
app\
	shared\  main source tree
	custom1\ custom source tree1
	custom2\ custom source tree2
	devices\ holds the device specific source files
		device1\
		device2\
</pre>
Each directory contains contains a full package directory heirarchy so when
theyre all copied to the same place the packages will all line up. In my old
build system I did it like this:
<pre>
<target name="GetOneTree">
	<echo message="Checking ${base}/${dir} for ${includesList} minus
${excludesList} to ${outputDir}"
	/>
	<copy todir="${outputDir}" overwrite="true">
		<fileset dir="${base}/${dir}"
		         includes="${includesList}"
		         excludes="${excludesList}"
		/>
	</copy>
</target>
<target name="GetSources" if="src.outOfDate">
	<delete failonerror="false">
		<fileset dir="${temp.dir}/src" />
	</delete>
	<var name="includesList" value="${target.src.includesList}" />
	<var name="excludesList" value="${target.src.excludesList}" />
	<var name="outputDir" value="${src.tempDir}" />
	<foreach list="${target.src.dirList}"
	         target="GetOneTree"
	         param="dir"
	         inheritall="true"
	/>
</target>
</pre>

Where target.src.includesList would equal a list of the source directories I
would want to run through for that build. 
Example: target.src.includesList=src/,custom1/,devices/device1/

I feel like it should be possible to do something with patternset, mappers
and copy but I have had no luck in figuring it out yet. Anyone have any
ideas? Thanks.
-- 
View this message in context: http://www.nabble.com/Copying-multiple-source-trees-without-loops-tf3190728.html#a8857626
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message