0
我可以使用以下Ant語法來檢查是否確切地存在一個文件給定了它的模式或確切名稱(實際上,我不知道任何文件系統允許兩個同名的文件共存)檢查Ant中是否存在「至少一個文件」
<condition property="dependenciesXmlOk">
<resourcecount count="1">
<fileset id="fs" dir="ci" includes="dependencies.xml" />
</resourcecount>
</condition>
<fail message="dependencies.xml not found. Please configure CI server to deploy the dependencies.xml file as an artifact to ci/ folder within this project" unless="dependenciesXmlOk" />
但是,我現在想添加一個新的條件和相關的錯誤信息。如果我的目標目錄中不存在*.jar
文件,則Ant構建必須中斷。複製&粘貼,我得到相同的.zip
(是的,必須有儘可能多的zip和jar文件,但至少有一個擴展名)
我怎麼能在Ant中做到這一點?