I'm working on a internal library (let's call it "banana_lib") that will be included in an Android app project. I want to provide this library to a client in the form of an .aar file.
My library depends on another library (let's say Gson). If I can help it, I want to avoid bundling the classes of this dependency into my library ( the "fat jar", "uber jar" approach ).
I know that I could ask the user of my library to include the dependencies in the build.gradle file of the app:
dependencies {
compile 'com.google.code.gson:gson:2.2.4'
compile files('libs/banana_lib.aar')
}
But I don't want to burden the user of the library with including the dependencies of my library in the build.gradle file of the app.
Question: Is there a way to make gradle automatically resolve/include the dependencies of an .aar file? What's the way to do this so that a user of a .aar library has the minimum effort? Do I need to provide a pair of .aar and .pom file? My main goal here would be to reduce the things that a user of this library would have to do. I feel like a library should ideally define all its dependencies, and gradle should just resolve them in the background.
Put in a slightly different way: Is there any way to allow a client/user to include a (internal!)library(which has external dependencies) by just: 1.) adding a .aar file to the build. 2.) including it in the build.gradle.
If there are other solutions that keep the amount of work that the user/includer of the library has to do to a minimum, then that'd be interesting as well :)
Many thanks!