Raz
Raz

Reputation: 499

Add external project dependency in gradle

I am starting to migrate from ANT to Gradle and I have multiple projects which rely on one another. They are not all in the same path, meaning that they are not all under a single project but still they have dependencies with one another.

I read that in Gradle in order to define a dependency between two projects, they need to be under the same root project.

Can I avoid this? how can I give project compile(..) a path which is outside of the current path?

In other words, I don't want to start changing the path of the projects, for now.

Upvotes: 4

Views: 23627

Answers (2)

Raz
Raz

Reputation: 499

Also, i found this while searching for information on including projects/modules that are not in the same path:

https://looksok.wordpress.com/2014/07/12/compile-gradle-project-with-another-project-as-a-dependency/

It explains what Awanish Raj explained above, and more.

Upvotes: 6

Awanish Raj
Awanish Raj

Reputation: 2009

I hope you understand basics of grade file structure in the project.

Refer to my answer here for a solution to getting external library projects to compile into your main project.

Hope it helps! :)

Upvotes: 5

Related Questions