Ant : Process the files in the subfolder using tasks

后端 未结 1 1869
无人及你
无人及你 2021-01-28 13:21

I have a folder structure as follows

+ [BASE]
+++ [DIR 1]
++++++ File.zip
+++ [DIR 2]
++++++ File.zip
....

I have a build.xml in BASE. I need t

相关标签:
1条回答
  • 2021-01-28 14:16

    You could try an embedded groovy script. Something like this:

    <target name="unzip">
        <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="build.path"/>
    
        <fileset id="zips" dir="." includes="**/*.zip"/>
    
        <groovy>
            project.references.zips.each { fileResource ->
                def file = new File(fileResource.toString())
    
                ant.unzip(src:file, dest:file.parent)
            }
        </groovy>
    </target>
    
    0 讨论(0)
提交回复
热议问题