Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 84757 invoked by uid 500); 16 May 2001 13:25:36 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 84691 invoked from network); 16 May 2001 13:25:32 -0000 Message-ID: <355ACE33C543D7489C3A286647574F8207CEAF@slider.cactus.ca> From: philippe.lavoie@cactus.ca To: ant-user@jakarta.apache.org Subject: Defining function target Date: Wed, 16 May 2001 09:25:24 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Hi, I have the same rules that has to be applied on each directory (I'm generating docs from stylebook) I have one that checks if anything changed in that directory since the last time and another that does the work which is to replace some string (change the DTD location) and then and generate a book. What I would like is something like bool CheckBook(dir,outputdir); bool GenerateBook(dir,outputdir,replace_from,replace_to); foreach directory starting from xdocs CheckBook(directory,"html/"+directory) GenerateBook(directory,"html/"+directory, "[../]*DTD" , "/DTD") {note that [../]* is a regexp, not sure to what level ant has that, seems to be only the path stuff that has some level of regexp} The directory structure looks like xdocs xdocs/DTD xdocs/root xdocs/root/design xdocs/projects xdocs/projects/timesheet xdocs/projects/sinbad xdocs/groups xdocs/groups/alpha xdocs/groups/beta each directory has a bunch of xml files that together will form a book in html, i.e. see how Cocoon does it's documentation for an example of how to use stylebook for only a single directory. I tried all the variations of antcall to be able to do something like the above. It never worked, I could set a parameter, but it was not setting it globally. I ended up creating a build.xml file in each directory which generates the book for the current directory and then calls the build.xml in all the child directories based on the manual editing I do on each build.xml file. It doesn't seem clean to me, is there another way ? Anyway, the way I have things setup right now, I would almos gain by using something like Makefile.am which contains the directory dependant information and have another tool the generates the build.xml files for each subdirectory. Phil PS If I'm not clear enough, let me know :)