This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Q Changing directories and list of directories in variable

Rasheed Muhammad
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to replace a develpoment and deployment system using make with ant. I have a hirecrchical package structure of source files which contained a make file at each level and the rules I had defined would recursively traverse each level, use the makefile present there and make the given targets. Now I am trying to replace each makefile at each level with a build.xml file. These files defines some variables like package_dir, subpackages (a list of subdirs), or at inner levels a variable source_files (list of .java files to be compiled). What I want to do here is that When I run any target from top level I would like to get the list of directories in a variable and go into every directory recursively using cd command and execute the ant task using that level build.xml file. There are 2 things which i'm not able to do. 1- Get the list of directories or files exists in a particular directory into a variable. 2- Iterate the directories in the variable and go inside the directory and execte the ant task using that level build.xml file. Has anybody done a similar thing with ant? I will appreciate all feedback.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic