Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 ant build.xml 中,我想根据 ant 本身是否在启用详细的情况下运行来影响子进程的详细标志。是否有一个变量集来确定这一点?或者,我可以以某种方式解析原始 Ant 命令行以检查是否-v通过?
-v
该属性sun.java.command包含命令行选项
sun.java.command
<project > <echo message="${sun.java.command}" /> <condition property="verbose.is.set"> <contains string="${sun.java.command}" substring="-v" /> </condition> <echo message="${verbose.is.set}" /> </project>