Ant文件依赖于其他Ant文件 [英] ant file that depends on another ant file
本文介绍了Ant文件依赖于其他Ant文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个项目,每个项目有自己的Ant构建文件。
I have two projects, each with its own ant build file.
我应该怎么做,这样,当我建立项目B,它将使用项目A的antfile先建项目中的?
What should I do so that, when I build project B, it will first build project A using project A's antfile?
推荐答案
您可以通过使用 ant任务实现这一目标,它运行在一个外部构建文件蚂蚁。
You can achieve this by using the ant task, which runs ant on an external buildfile.
例如:
<ant antfile="../otherproject/build.xml" target="compile"/>
属性结果
默认情况下所有的当前属性被传递到被调用Ant构建,这可以通过设置来禁用 inheritAll =FALSE
,如果你想在其他构建的行为本身。
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>
这篇关于Ant文件依赖于其他Ant文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文