File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes automatically echo project name for each task Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "automatically echo project name for each task" Watch "automatically echo project name for each task" New topic
Author

automatically echo project name for each task

Jim Atharris
Greenhorn

Joined: Jan 07, 2008
Posts: 28
Hello,

We have a toplevel build.xml that essentially calls other projects' build.xml files. And this works just fine. However for each target that ant automatically prints out, I can't tell which project's build.xml it came from. Below I have the following (sample) build.xml for each project. This produces output like:



I like the output that the echo statement does; however, it is unmaintainable/error-prone to have to put the echo statement in each task.

Is there an easier way? Any help would be appreciated.

We're using Ant version: 1.8.1

Thanks,
Jim

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5812
    
    7

I used a naming convention for targets whereby each target was prefixed with some letters to identify the xml file. For example, in the global included xml file all targets started with "g_". But having the option to have Ant print something like "[targetx in foo.xml]" seems like a worthwhile enhancement to Ant.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: automatically echo project name for each task
 
Similar Threads
Jikes in Ant
How to get package name for a directory?
Help: Modern compiler is not available.
Loops in Ant
tasks as subroutines