On 09/08/2011, at 12:28 AM, Ruediger Schobbert wrote:

> So in case anybody is interested I finally solved this issue:
> 
> What I was missing was another upload task. At least I didn't find a way of 
> doing a combined upload.
> 
> So my solution looks like this:
> -------------------------------
> configurations {
>    gwt
> }
> 
> jar {
>    exclude '**/*.gwt.xml'
> }
> 
> task jargwt(type: Jar) {
>    from sourceSets.main.allJava
>    baseName = "$project.name-gwt"
> }
> 
> artifacts {
>    archives jar  // this is probably not necessary as the java plugin already 
> adds this?
>    gwt      jargwt
> }
> 
> task 'uploadGwt'(type:Upload) {
>    repositories {
>        add uploadArchives.repositories.iterator().next()
>    }
>    configuration = configurations.gwt
> }
> 
> project.uploadArchives.dependsOn 'uploadGwt'

You should be able to reduce the above to…

configurations {
   gwt
   all.extendsFrom archives, gwt
}

jar {
   exclude '**/*.gwt.xml'
}

task jargwt(type: Jar) {
   from sourceSets.main.allJava
   baseName = "$project.name-gwt"
}

artifacts {
   gwt      jargwt
}

uploadAll {
        // what you have in uploadArchives here
}


There is an implicit upload rule for each configuration, and by creating a new 
configuration that extends the two you want to combine you can do it in one 
operation.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


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

    http://xircles.codehaus.org/manage_email


Reply via email to