ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daffin, Miles \(IT\)" <>
Subject RE: Copying multiple source trees without loops
Date Thu, 08 Feb 2007 01:19:17 GMT
I think you may be making things too complicated for yourself. 

Why not just compile each tree in situ? If you want you can compile them
into the same dest dir. You could even wrap the javac task in a macro
and just pass the source dir to this as an attribute. Then just invoke
the macro once for each tree. Its neat, fast and simple.


> -----Original Message-----
> From: sam.hendley [] 
> Sent: Thursday 08 February 2007 00:47
> To:
> Subject: Copying multiple source trees without loops
> 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: 
> Sent from the Ant - Users mailing list archive at
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

NOTICE: If received in error, please destroy and notify sender. Sender does not intend to
waive confidentiality or privilege. Use of this email is prohibited when received in error.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message