在ANT中是否有可能具有相同的目标,这取决于该目标中的条件,取决于不同目标的集合。
示例:
<target name=my_target depends="target2,target3,target4" if="my_property1">
和
<target name=my_target depends="target2,target5,target6" if="my_property2">
其中“target2”评估属性my_property1或my_property2。
这样的事情是可能的,还是有另一种方法根据条件分配给同一目标不同的“依赖”?
感谢。
答案 0 :(得分:1)
您不能拥有重复的目标。我不清楚你的目标是什么... target2对你的属性做了什么?要复制您可以设置的行为
<target name="my_target" depends="target2,target3,target4,target5,target6">
然后在target1-6上设置if
和/或unless
,例如
<target name="target2">
(始终运行target2)
<target name="target3" if="my_property1">
<target name="target4" if="my_property1">
<target name="target5" if="my_property2">
<target name="target6" if="my_property2">