I am building an Android Library project using Android Studio. The type of the module is 'com.android.library' in gradle.build file. This module has a number of dependencies:
dependencies {
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp:2.3.0'
}
The module builds result in a .aar file. I want the user of the .aar file to be notified/warned about .aar dependencies so his project doesn't successfully builds till these dependencies are set inside his project. Is there a way to do this?
I want the user of the .aar file to be notified/warned about .aar dependencies so his project doesn't successfully builds till these dependencies are set inside his project.
Well, to some extent, that would happen automatically, as their compile would fail.
If you distribute this AAR as an artifact in a repository, the repository metadata (e.g., POM file for a Maven repo) can contain information about these dependencies. Many build systems (Gradle, Maven, etc.) will use that to automatically download those dependencies as needed when the developer uses your artifact.
If you elect to distribute this AAR by other means (e.g., a QR code the size of a small mountain), you will need to tell developers that they need to include these dependencies through documentation of some sort.
Anticipating a follow-up question...
I should be able to publish a .aar closed source artifact through a Maven repo ?
Sure. While Maven Central and JCenter are tailored for open source, you can certainly have your own repo. It's just a directory with certain contents. For example, I have my own repo for my open source libraries, and while my libraries are open source, there is nothing about the repo that would require the repositories to hold open source code.