LoginSignup
3
2

More than 5 years have passed since last update.

ant の必要最低バージョンを調べるタスク

Last updated at Posted at 2013-08-29
  <property name="ant.version.required" value="1.9.2" />
  <target name="ant.version.validate">
    <fail message="ERROR: The running Ant version is too old. Use ${ant.version.required} .">
      <condition>
        <not>
          <antversion property="version.running" atleast="${ant.version.required}" />
        </not>
      </condition>
    </fail>
  </target>
$ ant ant.version.validate

すると、ant のバージョンが 1.9.2 より低かったらエラーになる。

次のようにタスクに ant.version.validate を依存させると、タスクの実行時に必要最低バージョンのチェックを行ってくれる。

<target name="foo" depends="ant.version.validate">
  <foo bar="bar" />
</target>
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2