Skip to content


Ant で標準出力を一括削除する

実行時は少しでもオーバーヘッドを無くしたいので、デバッグ用の標準出力を削除してからコンパイルしたい。
Ant で実現するには、正規表現を使ってさっくりと削除することが出来る。

<replaceregexp replace=”" flags=”gm”>
    <fileset dir=”./tmp”>
        <include name=”**/*.java” />
    </fileset>
    <regexp pattern=”System.out.print(.|\n)+;” />
</replaceregexp>

<replaceregexp replace=”" flags=”gm”>
    <fileset dir=”./tmp”>
        <include name=”**/*.java” />
    </fileset>
    <regexp pattern=”[\w]+\.printStackTrace\(\);” />
</replaceregexp>

この投稿にタグはありません。

関連する投稿

Posted in Java, プログラミング.


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.