Is this behavior correct?
The code below works but without explicitly specifying the variable (jars), the nested into is applied to the copy task instance instead of the copySpec instance above it (into(‘jars’)) and the files are copied to temporaryDir instead of the directory under that. This happens with gradle 1.12 and 2.2.
repositories {
mavenCentral()
}
configurations {
jars
}
dependencies {
jars 'junit:junit:4.11'
}
task copyJars(type: Copy) {
into ('jars') { jars ->
configurations.jars.each { jarFile ->
jars.into (jarFile.name - '.jar') {
from(zipTree(jarFile))
}
}
}
into temporaryDir
}