Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fumokmm/426521 to your computer and use it in GitHub Desktop.
Save fumokmm/426521 to your computer and use it in GitHub Desktop.
連続でフォルダにコピーする。
<?xml version="1.0" ?>
<project name="ant-with-groovy" default="test">
<taskdef name="groovy"
classname="org.codehaus.groovy.ant.Groovy"
classpath="groovy-all-1.7.2.jar" /> <!-- groovy-all-*.jar を指定 -->
<target name="test">
<groovy><![CDATA[
// 例:古いディレクトリから新しいディレクトリにコピー
def dirMap = [
'old1' : 'new1',
'old2' : 'new2'
]
dirMap.each { from, to ->
ant.copy(todir: to) {
fileset dir: from
}
}
]]></groovy>
</target>
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment