Ant中的Echo目标描述

unj*_*nj2 12 java ant

<target name="compile" description="Compile the File">
        <echo>Compile the File </echo>
        <mkdir dir="${compilation-dir}" />
        <javac srcdir="." classpath="another2" destdir="${compilation-dir}" />
    </target>
Run Code Online (Sandbox Code Playgroud)

我想回应目标的描述.除了复制之外,还有更好的方法吗?

Jar*_*sen 3

我想这不是一个完美的解决方案,但至少可以避免重复的描述。

<property name="testing.desc" value="this is the desc" />

<target name="testing" description="${testing.desc}">
    <echo message="${testing.desc}" />
</target>
Run Code Online (Sandbox Code Playgroud)

  • 如果我这样做,该属性不会通过 -projecthelp 扩展..(ant 1.8.2) (2认同)