LoginSignup
1
0

More than 5 years have passed since last update.

Gradleでファイルをリネーム(移動)する。

Last updated at Posted at 2018-09-19

検索するとcopyタスクのrenameを使う方法が出てきますが、単一のファイルをリネームするだけなら、antのmoveタスクを使うのが一番簡単かと。

// test.xmlをtest.xml.tmpにリネーム(上書き許可)
ant.move file: 'test.xml', tofile: 'test.xml.tmp', overwrite: true

// test.xmlをtest.xml.tmpにリネームしてtmpディレクトリに移動(上書き禁止)
ant.move file: 'test.xml', tofile: 'tmp/test.xml.tmp', overwrite: false

参考
https://ant.apache.org/manual/Tasks/move.html

1
0
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
1
0