Apache Ant Argument Processor
Ant Argument Processor is a command line processor plugging. It is used to call third party plug-in before or after the build file is parsed.
Third party arguments also may have custom command line argument which modify Ant behavior.
It calls each time whenever Ant process an argument. Ant?s arguments always takes precedence over to ArgumentProcessor arguments.
We can call it at any moment of process and at different-different phases as well to perform various behavior at each phase.
It can be called just after every argument is passed, just before the project is configured and just after as well.
Ant provides an interface ArgumentProcessor which is located inside org.apache.tools.ant package. It contains various methods which are given below.
Ant ArgumentProcessor Methods
How to register it's own ArgumentProcessor
To register own ArgumentProcessor, it requires couple of steps which are given below.
First, it must implement ArgumentProcessor interface located into org.apache.ant.ArgumentProcessor.
To declare ArgumentProcessor, create a file META-INF/services/org.apache.tools.ant.ArgumentProcessor which contains only one line the fully qualified name of the class of the implementation.
This file which implements ArgumentProcessor and the file in which it is declared both together should be found in Ant's classpath.