Referencing compile classpath from Ant

I have an Ant task that refers to Gradle compile dependencies like this: $configurations.compileClasspath.asPath

The problem is that if I add a sub-project dependency to the compile classpath (i.e. project(':my-lib') ) Ant does not see it. Adding the dependency also somehow interfere with Ant’s ability to see classes from the project itself which are referred using $sourceSets.main.output.classesDir
How it can be solved?

Apparently changing dependency from jar to project changes tasks execution order.
Adding in the Ant task dependsOn(‘compileJava’) solved the problem.

1 Like