Follow these steps to to get started with PAnt:
* Now the prep work is done and you can begin developing your build logic in python. The easiest way to do it is to create a python module and start creating targets and tasks, for example:
from pant.pant import ant, target @target(depends=ptarget1) def ptarget2(): """Python project ptarget2""" ant.echo("echo ptarget2")
* See this post for more information about creating targets in PAnt.
* Add “pimport” task to your build.xml:
* You can also create targets using PAnt APIs as opposed to decorators, as explained here. If that’s how you chose to do it, invoke the code that creates the targets using “jython” task:
* In Ant you can’t create a target from inside another target, so both “pimport” and “jython” have to be defined outside the “target” XML tag.
* You can run targets defined in python same way you run a regular Ant target: ant YOUR TARGET
. PAnt doesn’t use a special shell scripts to run; you simply execute your “bootstrapping” build.xml using regular “ant” batch/shell script.
That’s it, the rest of it is simply writing your build logic in python using Ant tasks as documented here.