Checking for project dependencies in a multi-project build

In a multi-project build is there a way to test if one project has a dependency on another project? The scenario is that the parent build file sets up general configuration and tasks but some of the behaviour is driven by specific project dependencies which are set in the child build file. I have tried something like

project.configurations.compile.dependencies.contains(project(’:projA’))

but that always returns false.

Of course it’s possible, but a simpler solution is to put both the adding of the project dependency and the necessary configuration that goes along with it into a separate build script (say ‘gradle/foo.gradle’) and apply it with ‘apply from: “gradle/foo.gradle”’.

Your suggestion is just right. Thanks.

Your suggestion works just fine. Thanks.