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

CopySpec eachFile does not visit child specs added with "with"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 2.0-rc-1

      Description

      When using "with" to add a child CopySpec to a Copy task, the eachFile visitor does not visit the files in the child spec. Here is a simple example:

      build.gradle
      task one(type: Copy) {
          from 'src'
          into 'target'
      }
      
      task two(type: Copy) {
          with one
          into 'newtarget'
          eachFile { println("two: $it.name") }
      }
      

      Where the `src` directory has some arbitrary files in it. I would expect to see the output lines beginning with `two`, but instead I get:

      $ gradle two
      :two
      
      BUILD SUCCESSFUL
      

        Attachments

          Activity

            People

            Assignee:
            Pez Perryn Fowler
            Reporter:
            mrm Michael Meisel
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: