Not too bad... this is what I ended up with:

task projectJavaDocs << {

configurations.projectJavaDocs.resolvedConfiguration.resolvedArtifacts.each{
    artifact ->
        copy {
            into new File( buildWebsiteDir, "javadoc/" + artifact.name )
            from( zipTree(artifact.file) )
        }
    }
}

I appreciate any improvements... as it seemed like a bit of a long way to go to get the artifacts. If I tried:
configurations.projectJavaDocs.artifacts.each{}
...then it was empty.

I tried a few things to get the projectJavaDocs configuration to resolve for the projectJavaDocs task in a less manual way without luck.

-Paul

Paul Speed wrote:
I feel like I'm missing something obvious, here, so forgive me...

I'm trying to define a dependency on a bunch of javadoc.jar files...

configurations {
    projectJavaDocs { transitive=false }
}

dependencies {
    projectJavaDocs "org.mystuff:core:${version}:javadoc"
    projectJavaDocs "org.mystuff:util:${version}:javadoc"
    ...
}

And what I'd like to do is then expand all of those jars into jar-specific sub-directories.

I can do one jar but I can't figure out the right incantations to do multiple. Here is what I use to do just one:

task projectJavaDocs(type: Copy) {
    into new File( buildWebsiteDir, "javadoc" );
    from( zipTree(configurations.projectJavaDocs.singleFile) )
}

And maybe to reach my ultimate goal, I'm simply barking up the wrong tree... as I need to 'repath' those files into sub-directories. I know I can mess with the paths in an eachFile closure but I'm not sure I can access the jar file name from there to redirect the files into a sub-directory.

Is there an easy way to do this? Should there be? Or should I really be using a copy {} per jar? (Which is what I'm going to do to get it working for now.)

-Paul


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

   http://xircles.codehaus.org/manage_email




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

   http://xircles.codehaus.org/manage_email


Reply via email to