On Tue, Mar 16, 2010 at 11:44 PM, Rene Groeschke <[email protected]>wrote:

> Hi there,
>
> I'm actually working on an automatic build for the eclipse-plugin.
>  Therefore I'm wrapping a gradle bin distribution as an osgi bundle. To do
> this automatically in the build script I add the snapshots directory of
> gradle to my repositories:
>
> repositories {
>  // get the latest available gradle snapshot. Are files resolved via
> URLResolver are cacheable?
>  add(new org.apache.ivy.plugins.resolver.URLResolver()) {
>   name = 'gradle-snapshots'
>   addArtifactPattern '
> http://snapshots.dist.codehaus.org/([organization]/)[artifact](-[revision])(-[classifier]).[ext]<http://snapshots.dist.codehaus.org/%28%5Borganization%5D/%29%5Bartifact%5D%28-%5Brevision%5D%29%28-%5Bclassifier%5D%29.%5Bext%5D>
> '
>  }
> }
>
> after that I a gradle distribution to a custom configuration:
>
> add dependencies{
>   workspaceSetup "gradle:gradle:0.9-20100309203241+0100:b...@zip"
> }
>
> the gradle zip contains a directory (named something like
> gradle-0.9-20100309203241+0100). What is the best way to copy the content of
> the directory (I mean the structure under that directory, not the directory
> itselt) to a custom directory? I tried something like the following, but
> this does neither work correctly, nor seems to be very groovy gradle syntax:
>
> configurations.workspaceSetup.files.each { depFile ->
>       def dirName = "${depFile.name.substring(0,
> depFile.name.length()-8)}/"
>       FileTree zipContent =  zipTree("${depFile.absolutePath}")
>              copy {
>           zipContent.visit {node ->
>                   from node
>           }
>           into 'build/tmp/org.codehaus.gradle/'
>       }
>   }
> Any suggestions how to get this working and making this more gradle like?
>

task zipcopy(type: Copy) {
    from(zipTree(depFile)) {
        eachFile { details ->
            details.path =
details.path.substring(details.relativePath.segments[0].length())
        }
    }
    into "build/tmp/org.codehaus.gradle/"
}

- Hans

--
Hans Dockter
Founder, Gradle
http://www.gradle.org, http://twitter.com/gradleorg
CEO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz



>
> 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