Hmmm, looks like a bug. Can you file a jira ticket?

Since the gradle build is groovy the workaround for this problem is
very easy - you can normalize the path yourself :)

Cheers!

On Tue, Jun 14, 2011 at 11:37 AM, Ric Klaren <[email protected]> wrote:
> Hi,
>
> At our company we're currently pretty far in switching to gradle. Really
> liking the ease and brevity with wich you can do things compared to maven
> (16668 lines with maven vs 3991 lines with gradle and nearly the same
> functionality).
>
> In preparation of completing the switch we did some more testing and ran
> into an unexpected issue with the use of zipTree. For our distribution we
> fold a number of zips (eclipse virgo distribution and yajsw) into one new
> zip while relocating files on the fly, and also include our own artifacts.
> This works all like a charm.
>
> Our task looks like this (stripped down):
>
> task dist(type: Zip, dependsOn: cleanDist) {
>     description = "Build distribution ZIP"
>
>     // make dist depend on the jar files of the sub projects
>     subprojects {
>         dependsOn(it.jar)
>     }
>
>     def virgoFileTree = zipTree(configurations.server.getSingleFile())
>     def wrapperFileTree =
> zipTree(configurations.serviceWrapper.getSingleFile())
>
>     // docs
>     def virgoDocPath = 'docs/virgo-' + virgo_version
>     virgoFileTree.matching({include "**/docs/**/*"}).each {
>         newPath = it.path.substring(it.path.indexOf('/docs/') + 5,
> it.path.lastIndexOf('/'))
>         from(it) { into (virgoDocPath + newPath) }
>     }
>    ....
> }
>
> The issue we now run into is that the include in the matching part works,
> but the indexOf's fail due to it.path using slashes on unix and backslashes
> on windows. I had expected things to be normalized to slashes. As I more or
> less expected going on
> http://gradle.org/current/docs/javadoc/org/gradle/api/file/FileTreeElement.html#getPath%28%29.
>
> So while I explore different approaches to the renaming, I ask the question
> should the above work cross platform?
>
> Thanks,
>
> Ric
>
> PS using milestone 3
>
>



-- 
Szczepan Faber
Principal engineer@gradleware
Lead@mockito

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

    http://xircles.codehaus.org/manage_email


Reply via email to