<echo message="${PROPERTY_NAME}"/>
可以使用echo標記和message參數顯示ant腳本中加載的屬性。
此示例創建一個測試任務。 屬性tmp.prop的值為“This is a test”。 消息將在輸出中寫入屬性的內容。
<project name="MyProject" default="test" basedir=".">
<target name="test">
<!-- Create a property -->
<property name="tmp.prop" value="This is a test"/>
<!-- Show the property -->
<echo message="Content of tmp.prop = ${tmp.prop}"/>
</target>
</project>
$ ant
Buildfile: build.xml
test:
[echo] Content of tmp.prop = This is a test
BUILD SUCCESSFUL
Total time: 0 seconds