Am 07.01.11 15:22, schrieb Mathias Kalb:
> Hi,
>
> I used the Sync task to copy dependencies to a lib folder like the
> example 15.17.
>
> task syncTomcatLib(type: Sync) {
>   from configurations.tomcatLib
>   into "tomcat/lib"
> }
>
> The folder contains also some XML files which are deleted by the sync
> task.
The Sync task syncs a folder with the files defined in the sync task.
This means, that unless you add the xml files to your syncTomcatLib
task, the xml files in tomcat/lib are always deleted.
>
> How can I avoid the deletion of the XML files?
Where do these xml files come from? As mentioned, you could add the
source of the xml files to your sync task. I think, that's the cleanest
solution.
> tried "include" and "exclude" but it doesn't help.
The properties 'includes' and 'excludes' of Sync
(http://gradle.org/0.9.1/docs/dsl/org.gradle.api.tasks.Sync.html#org.gradle.api.tasks.Sync:excludes)
do only work as filters for the source files, not for the target directory.

As a workaround you can add the already existing xml files in the folder
to your sync spec:
-------------
task syncTomcatLib(type: Sync) {
  from configurations.tomcatLib
  into "tomcat/lib"
  from ("tomcat/lib"){
      includes ['**/*.xml']
  }
}
-------------

regards,
René

-- 
------------------------------------
Rene Groeschke

[email protected]
http://www.breskeby.com
http://twitter.com/breskeby
------------------------------------


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to