Exec Task v project.exec difference in behaviour

Is this difference between Exec Task and project.exec expected behaviour in Gradle 1.6 or a bug?

// Works fine
task exec1 ( type : Exec ) {
  executable 'prog1'
  ignoreExitValue true
}
  // Fails to compile, complaining about ignoreExitValue
task exec2 << {
  exec {
    executable 'prog1'
    ignoreExitValue true
  }
}

As far as I understood project.exec had the same semantics as the Exec Task.

It’s ‘ignoreExitValue = true’. For tasks it’s oftentimes possible to omit the ‘=’.

PS: Please always provide the exact error message and stack trace.

@Peter,

Is there a technical limitation to why the interface cannot be consistent?

Task classes are generically enhanced at runtime (via code generation) for several reasons. There is no such mechanism for methods.

This can be fixed, I raised GRADLE-2813 for this.

This is fixed in 1.7.