I have two projects, each with its own ant build file.
What should I do so that, when I build project B, it will first build project A using project A's antfile?
I have two projects, each with its own ant build file.
What should I do so that, when I build project B, it will first build project A using project A's antfile?
You can achieve this by using the ant task, which runs ant on an external buildfile.
Example:
<ant antfile="../otherproject/build.xml" target="compile"/>
Properties
By default all current properties are passed to the invoked ant build, this can be disabled by setting inheritAll="false"
, if you want the other build to behave natively.
Properties that are need can be passed by nested tags:
<ant inheritAll="false" antfile="../otherproject/build.xml" target="compile">
<property name="my.property" value="myValue"/>
</ant>