[GRADLE-183] Dependency Layer Refactoring Created: 20/Aug/08  Updated: 04/Jan/13  Resolved: 07/Apr/09

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 0.6

Type: Improvement
Reporter: Hans Dockter Assignee: Hans Dockter
Resolution: Fixed Votes: 0

Issue Links:
Related
Related to GRADLE-271 Linking tasks with dependency configu... Resolved
dependent
dependent on GRADLE-171 Introduce Configuration object to our... Resolved

 Description   

As discussed in: http://www.nabble.com/dependency-layer-refactoring-to18725442.html



 Comments   
Comment by Jon Cox [ 22/Jan/09 ]

I had to re-read the docs several times before I finally got what was going on here (more or less).
As far as I can tell, it works like this:

Gradle dependencies are grouped into "dependency configurations".
Gradle tasks are linked to these "dependency configurations".

Many of these dependency configurations have the same name as the task they're typically linked to,
but because a dependency configuration can be linked to multiple tasks, this isn't always the case.

By default, Gradle gives you the following set of "dependency configurations":

  • default
  • libs
  • compile
  • runtime
  • testRuntime
  • testCompile
  • dists
  • master

For example, the 'compile' configuration comes already linked to the 'compile' task,
and the 'testRuntime' configuration is linked to the 'test' task. Internally, Gradle
links configurations with tasks via the 'linkConfWithTask' API. You can use this
API within a build.gradle file by hand if you want to (thought it's seldom necessary):

dependencies
{
     linkConfWithTask( yourConfigName,   yourTaskName)
}

Some of the pre-built dependency configurations provided by the Java (or Groovy)
plugin are actually extensions of others. For example, the 'testRuntime' configuration
extends both the 'runtime' and 'testCompile' configurations.

Comment by Hans Dockter [ 25/Jan/09 ]

How Gradle 0.5 links tasks with configurations is ugly and unintuitive. In my working copy there is now a much nicer and more powerful mechanism (as discussed on the mailing list recently). I hope to submit this within the next days.

Generated at Wed Jun 30 11:23:47 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.