gradle Depend on Another Gradle Project


In the case of a multi-project gradle build, you may sometimes need to depend on another project in your build. To accomplish this, you'd enter the following in your project's dependencies:

dependencies {
    compile project(':OtherProject')

Where ':OtherProject' is the gradle path for the project, referenced from the root of the directory structure.

To make ':OtherProject' available in the context of the build.gradle file add this to the corresponding settings.gradle

include ':Dependency'
project(':Dependency').projectDir = new File('/path/to/dependency')

For a more detailed explanation, you can reference Gradle's official documentation here.