grails - How to use ant.resourcelist in groovy-script/gradle -


i have task - remove files list, stored in file. want use groovy script. in ant have no problem using following target:

<delete failonerror="false" verbose="true">         <resourcelist >             <file file="/path/to/file"/>         </resourcelist> </delete> 

but in groovy script causing error:

ant.delete(         failonerror: "false",         verbose: "true",         ant.resourcelist(                 ant.file(                     file: "/path/to/file"                 )         ) ) 

error:

the <resourcelist> type doesn't support nested text data ("/path/to/file"). 

how configure groovy skipt remove files list located in file? in advance.

you're using wrong syntax, has (here using groovy task) :

<project>  <taskdef name="groovy" classname="org.codehaus.groovy.ant.groovy"/>  <groovy>   ant.delete(failonerror: false, verbose: true) {    resourcelist {     file(file: '/path/to/file')    }   } </groovy>  </project> 

-- edit after comment --
when using groovy file have use :

def ant = new antbuilder()  ant.delete(failonerror: false, verbose: true) {   resourcelist {    file(file: '/path/to/file')   }  } 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -