Upload task improvement: auto-fill dependsOn() with configuration information?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Upload task improvement: auto-fill dependsOn() with configuration information?

sdevijver
Hey,

Right now there is a redundancy in the typical configuration of the Upload task:

task moduleJar(type: Jar) {
destinationDir = file('build/jar_for_module')
}
artifacts {
archives moduleJar
}
task uploadArchives(type: Upload) {
dependsOn moduleJar
configuration = configurations.archives
repositories {
  flatDir(dirs: dist_dir)
}
}

There's the "archives moduleJar" call and the redundant "dependsOn moduleJar" call. Since the Upload task also requires the Configuration object, is it possible to automatically feed the dependsOn() method?

Thanks

Steven

Reply | Threaded
Open this post in threaded view
|

Re: Upload task improvement: auto-fill dependsOn() with configuration information?

hans_d
Administrator
<base href="x-msg://262/">
On Oct 16, 2009, at 11:11 AM, Steven Devijver wrote:

Hey,

Right now there is a redundancy in the typical configuration of the Upload task:

task moduleJar(type: Jar) {
destinationDir = file('build/jar_for_module')
}
artifacts {
archives moduleJar
} 
task uploadArchives(type: Upload) {
dependsOn moduleJar
configuration = configurations.archives
repositories {
   flatDir(dirs: dist_dir)
}
}

There's the "archives moduleJar" call and the redundant "dependsOn moduleJar" call. Since the Upload task also requires the Configuration object, is it possible to automatically feed the dependsOn() method?

This is the same issue as with the buildDependencies. This should work automatically (and for most of our tasks it does). There is a bug in the Upload task that this does not happen. 

The basic mechanism is that every input property (or getter) that is annotated with the @InputFile(s) property is autowired. We have forgotten to annotate the configuration property in the Upload task. Could you file a Jira?

- Hans

--
Hans Dockter
Gradle Project Manager


Reply | Threaded
Open this post in threaded view
|

Re: Upload task improvement: auto-fill dependsOn() with configuration information?

Adam Murdoch-2
In reply to this post by sdevijver


Steven Devijver wrote:
Hey,

Right now there is a redundancy in the typical configuration of the Upload task:

task moduleJar(type: Jar) {
destinationDir = file('build/jar_for_module')
}
artifacts {
archives moduleJar
}
task uploadArchives(type: Upload) {
dependsOn moduleJar
configuration = configurations.archives
repositories {
  flatDir(dirs: dist_dir)
}
}

There's the "archives moduleJar" call and the redundant "dependsOn moduleJar" call. Since the Upload task also requires the Configuration object, is it possible to automatically feed the dependsOn() method?


A good idea. This is done in trunk: http://jira.codehaus.org/browse/GRADLE-709


-- 
Adam Murdoch
Gradle Developer
http://www.gradle.org
Reply | Threaded
Open this post in threaded view
|

Re: Upload task improvement: auto-fill dependsOn() with configuration information?

hans_d
Administrator
In reply to this post by hans_d

On Oct 18, 2009, at 12:29 PM, Hans Dockter wrote:


On Oct 16, 2009, at 11:11 AM, Steven Devijver wrote:

Hey,

Right now there is a redundancy in the typical configuration of the Upload task:

task moduleJar(type: Jar) {
destinationDir = file('build/jar_for_module')
}
artifacts {
archives moduleJar
} 
task uploadArchives(type: Upload) {
dependsOn moduleJar
configuration = configurations.archives
repositories {
   flatDir(dirs: dist_dir)
}
}

There's the "archives moduleJar" call and the redundant "dependsOn moduleJar" call. Since the Upload task also requires the Configuration object, is it possible to automatically feed the dependsOn() method?

This is the same issue as with the buildDependencies. This should work automatically (and for most of our tasks it does). There is a bug in the Upload task that this does not happen. 

The basic mechanism is that every input property (or getter) that is annotated with the @InputFile(s) property is autowired. We have forgotten to annotate the configuration property in the Upload task. Could you file a Jira?

I have written this email in the plan and it got send with a delay. Adam was faster filed a Jira and fixed it already.

- Hans

--
Hans Dockter
Gradle Project Manager