Reputation: 5909
I have an android project in Intellij IDEA using the classical format that I want to port to Android Studio using gradle.
My project consists of multiple modules with dependencies between them:
/root
module1/
module2/
appModule/
module1
and module2
are library modules. appModule
is the actual android app and is currently using both module1
and module2
as dependencies.
How do I achieve this with gradle?
I currently have a gradle file for each module but im having trouble int the appModule/build.gradle
making it refer to the other modules. Im guessing I need a build.gradle
in the root directory?
Upvotes: 1
Views: 92
Reputation: 3698
The root build.gradle
file is optional.
what you need is having a settings.gradle
file in your root project and specify all module and then in your appModule' s build.gradle
file, add:
dependencies {
compile project(':module1')
// others modules goes here...
}
Upvotes: 1