If the Ant script contains a target that conflicts with a Gradle task, a simple import will fail. With an optional configuration closure, it is possible to rename the Ant target on import:
Optional Ant tasks
If the Ant script uses optional tasks, these tasks must explicitly be defined, and the implementing libraries must be added as dependencies.
In this example, I am using JUnit 4.8.2 with the Ant-provided junit and junitreport tasks: