2

Consider the following piece of the build script:

task compile(dependsOn: 'resources') << {
    if (classesDir.isDirectory()) {
        println 'The class directory exists. I can operate'
    }
}

The first thought that popped into my head was that dependsOn: 'resources' is just "named parameter" like we use when we apply plugin: 'java' that is converted to a map afterwards. But It's not true, because

task compile([dependsOn: 'resources']) << {
    //etc
}

doesn't work. Error that was printed:

Could not find method compile() for arguments [{dependsOn=resources}]

but apply ([plugin: 'java']) works fine. So what is that, then?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
St.Antario
  • 26,175
  • 41
  • 130
  • 318
  • reading this question might help http://stackoverflow.com/questions/12326264/how-to-interpret-gradle-dsl – kdabir Jan 12 '15 at 03:58

0 Answers0