Reputation: 4389
I am trying to cleany reference a library (android library project, not jar) in the gradle script of my android app but I encounter some difficulties :
The automatic Android Studio import script created this structure :
--- Main module
--- library1
--- library2
It compiles correctly but library1 & 2 are copies of the original libraries codebases. I would like to be able to refer to these library as relative paths in my build, something along compile '../library1' but I can't find any documentation on this kind of script where you don't have a common root.
Any pointer would be much appreciated.
Upvotes: 1
Views: 131
Reputation: 1712
in your Main module, add settings.gradle for setting up the path of libraries:
include 'library1' include 'library2' project(':library1').projectDir = new File('../library1') project(':library2').projectDir = new File('../library2')
and include them in your build.gradle of Main module
dependencies { compile project(':library1') compile project(':library2') }
Upvotes: 2