Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant file that depends on another ant file

Tags:

ant

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?

like image 762
Erel Segal-Halevi Avatar asked Mar 01 '12 10:03

Erel Segal-Halevi


1 Answers

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>
like image 88
oers Avatar answered Oct 13 '22 23:10

oers