Project foo defines some ant tasks that are used in root project. For composite build:
setting.gradle
includeBuild '../foo'
build.gradle
configurations {
foo
}
dependencies {
foo fileTree(dir : '../foo/build/libs', include: ['*.jar'])
}
ant.taskdef(name: 'foo',
classname: 'mypackage.Foo',
classpath: configurations.foo.asPath)
The jar of included project foo should be built before evaluating the root project so that the jar will be available in the ant taskdef classpath. How?
but task dependency is in the execution phase, like
task run {
dependsOn gradle.includedBuild('../foo').task(':jar')
}
The jar will be available only after the task is executed, too late.