簡體   English   中英

使用ant根據jar屬性編輯文件

[英]Edit file based on jar property using ant

我對使用螞蟻很陌生。 僅當我的flag條件為1時,我才想構建一個jar文件並編輯文件

現在我有一些代碼:

<target name = "create_jar">
    <script language="javascript">
    ...
        create_jar.setProperty("flag", flag);//where flag is some boolean value
    </script>

    //if "${flag}" = 1
       //then:
        <replaceregexp ...></replaceregexp>

    //else continue as usual
    ...

如果有人可以幫助我弄清楚if flag = 1語句應該包含什么內容,將不勝感激。

簡而言之,我的replaceregexp可以正常工作,而我的script可以為我帶來正確的價值

編輯運行的apant ant版本1.9.2

因此,在進行更多搜索之后,似乎要使用:

<project name="create_jar" xmlns:if="ant:if" xmlns:unless="ant:unless">
...
...
    <replace... if:true="${flag}">
    <replace... unless:true="${flag}">
...

當使用ant> 1.9.1時

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM