ITコンサルの日常

ITコンサル会社に勤務する普通のITエンジニアの日常です。

2006-03-10から1日間の記事一覧

Antでファイルやディレクトリのありなしを判断して処理を分ける

これは標準タスクだけで出来ます。こんな感じ。 <project name = "test" default = "main"> <target name = "main"> <available property = "file.exists" file = "C:\hoge.txt"/> <echo message = "${file.exists}"/> </target> </project>もしC:\hoge.txtが存在していれば、file.existsという変数の中にtrueがセットされ、存在していなければ何もセットされません。 こ…

Antでコンパイルエラーをハンドリングする

なんだか標準のタスクだけだと出来ないっぽいんですが、なにかやり方があるのでしょうか? ちなみに、スクリプトタグを使って、try〜catchを使ってみたところ、それっぽいことは出来ました。 <project name="squares" default="main" basedir="."> <target name="main" depends = "compile"> <antcall target = "test"/> </target> <target name="compile"> <script language="beanshell"> </target></project>