Can I find and import files into an Ant buildfile at run time?

Posted by Mnementh on Stack Overflow See other posts from Stack Overflow or by Mnementh
Published on 2008-11-12T23:55:02Z Indexed on 2011/01/09 14:53 UTC
Read the original article Hit count: 264

Filed under:
|
|
|

I want to create an Ant buildfile, that includes some files as a sort of plugin.

So if I want to activate a feature in a project - say pmd-checking - I copy a pmd.xml in a directory and the build.xml get on the start the idea, that pmd.xml exists and imports it, so that new targets can be available to the build.

But the 'import' task can only be used as a top-level task, so I have no idea how to relize this functionality. Is this possible with Ant and if so, how can I do it?

EDIT: I would prefer a solution, that allows new targets to show up in the listing presented by ant -p.

© Stack Overflow or respective owner

Related posts about Xml

Related posts about plugins