We want to loop through directory structure in ant without using foreach . Is there any elegant way to do the same ?
相关问题
- slurm: use a control node also for computing
- How to read a string array in appSettings.json?
- Visual Studio 2015 : SQL Data Source : Unable to r
- Tomcat keeps logging what he wants
- How can I have my ant task pass or fail based on t
相关文章
- Passing command line arguments to Java via ant bui
- How to use relative line numbering universally in
- ANT - Could not load a dependent class com/jcraft/
- On scala project - Getting error GC overhead limit
- Debugging with Eclipse CDT and GDB: can't find
- Log4j2 using {} against using %d or %s
- Virtual Box limit Bandwith on network [closed]
- Automake Variables to tidy up Makefile.am
Short answer: Not really. There are ways around this, but I prefer the ant-contrib
<for/>
task for clarity and simplicity. With the<local/>
task, you can now localize values of variables. Before, you sometimes had to use ant-contrib's<var/>
task to reset the values, so you could loop through them over and over.It's clean, simple, and easy to understand. The big issue many people have with Ant Contrib is that not everyone may have it installed in their
$ANT_HOME/lib
directory. Far enough. So, if you use ant-contrib, put it as part of your project.I'll put the ant-contrib jar in
${basedir}/antlib/antcontrib
and then put this in my program:Now, when someone checks out my project, they have ant-contrib already installed (since it's inside my project) and accessible (since I point my
<taskdef>
task at the location of ant-contrib.jar in my project).The apply task can iterate over a set of directories or files
I personally like the groovy ANT task
The installation of the task jar is easily automated:
Finally if you're iterating thru other build files, the subant task is very useful: