Integrating legacy ant build's jar task with my new under construction gradle build

How do I integrate a legacy ant build system’s jar into my under construction gradle build system such that the jar built by ant depends on the jar built by gradle and is built when ‘gradle jar’ is run?

For instance, I have added this task to build the jar from the ant jar task:

task antBuild(type:Exec,dependsOn:'jar') {
 environment['PATH'] = environment['PATH']+":/usr/local/bin"
 commandLine 'ant'

I had to do it like this, please accept it as is.

Now, notice the ant build needs the jar from Gradle… but I also want ‘antBuild’ to run when executing ‘gradle jar’.

Is this possible?