Inside a gradle Task object you can say something like:
According to the gradle specification on the Task class its property “ant” is of type “AntBuilder”.
However the gradle specifiaction on “Antbuilder” does not mention a method called “taskdef”. Why then can I say “ant.taskdef”?
For the specification on AntBuilder see: https://docs.gradle.org/current/javadoc/org/gradle/api/AntBuilder.html#AntBuilder()