Uploaded image for project: 'Gradle'
  1. Gradle
  2. GRADLE-271

Linking tasks with dependency configurations should not be a part of dependencies (linkConfWithTask)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 0.4
    • Fix Version/s: 0.6

      Description

      The dependency definition should be independent of the tasks.
      Rather some tasks are dependent on a specific dependency configuration, thus this should be defined within the task:

      Instead of
      dependencies

      { addConfiguration("client") linkConfWithTask('client', 'clientCompile') ... }

      createTask('clientCompile', type: Compile)

      { ... }

      it should rather be
      dependencies

      { addConfiguration('client') ... }

      createTask('clientCompile', type: Compile)

      { configurations = [ 'client' ] ... }

      Reasons:

      • currently there is a static dependency from dependencies {...}

        to the tasks (linkConfWithTask), while the execution dependency is in the other direction - bad

      • in future dependencies will/might be read from external files (ivy.xml) - the link to the tasks can't be in the ivy.xml - would there still be a dependencies { linkConfWithTask... }

        ?

      • (!!!) readability - everybody should see on the first glance, what a specific compile or other task does and which configuration it uses.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hans_d Hans Dockter
              Reporter:
              mvlcek Martin Vlcek
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: