0
我有一個進程運行多個作業,其中傳遞了不同的-D屬性。有沒有辦法獲得在ant命令行上傳遞的-D屬性列表?螞蟻命令行中的-D屬性列表
我有一個進程運行多個作業,其中傳遞了不同的-D屬性。有沒有辦法獲得在ant命令行上傳遞的-D屬性列表?螞蟻命令行中的-D屬性列表
你可以在命令行上指定的所有屬性
<propertyset id="commandline-properties">
<propertyref builtin="commandline"/>
</propertyset>
,並使用<echoproperties>
向他們展示。 propertyset
還將包含一些與命令行相關的特殊Ant屬性 - ant.file
中的構建文件,ant.file.type
中的構建文件類型以及ant.project.invoked-targets
中命令行調用的目標。例如
$ cat < props.xml
<project>
<echoproperties>
<propertyset>
<propertyref builtin="commandline"/>
</propertyset>
</echoproperties>
</project>
$ ant -f props.xml -Dfoo=bar -Dxyzzy=quoox
Buildfile: /tmp/props.xml
[echoproperties] #Ant properties
[echoproperties] #Fri Sep 16 22:21:51 CEST 2016
[echoproperties] ant.file=/tmp/props.xml
[echoproperties] ant.file.type=file
[echoproperties] ant.project.invoked-targets=
[echoproperties] foo=bar
[echoproperties] xyzzy=quoox
BUILD SUCCESSFUL
Total time: 0 seconds