我想编写一个取决于在另一个宏定义中设置的属性的宏定义,例如这个,它不起作用......(宏定义不支持依赖和除非属性)无论如何要这样做?
<project name="mac">
<property name="antlr.version" value="3.2"/>
<macrodef name="check">
<attribute name="dest"/>
<attribute name="name"/>
<attribute name="version"/>
<sequential>
<available file="@{dest}/@{name}-@{version}.jar" property="@{name}-exists"/>
</sequential>
</macrodef>
<macrodef name="pull" depends="check" unless="@{name}-exists">
<attribute name="url"/>
<attribute name="dest"/>
<attribute name="name"/>
<attribute name="version"/>
<sequential>
<get src="@{url}" dest="@{dest}/@{name}-@{version}" verbose="true" ignoreerrors="true" unless="@{name}-exists"/>
</sequential>
</macrodef>
<target name="pullall">
<pull url="http://repo1.maven.org/maven2/org/antlr/antlr/${antlr.version}/antlr-${antlr.version}.jar" dest="." name="antlr" version="${antlr.version}"/>
</target>