I have two Android apps that share a subproject. The build.gradle in the subproject contains a dependency like this:
dependencies {
compile “my.library.dependency:${version}” }
What I’d like is to use this dependency at compile time, but not runtime. This is because the two apps need to link against slightly different versions of the dependency (same API).
The Gradle docs describe dependency configurations like this:
compile The dependencies required to compile the production source of the project.
runtime The dependencies required by the production classes at runtime. By default, also includes the compile time dependencies.
If runtime also includes compile dependencies, does this mean the library is exported from the subproject to the parent projects (and included in my apk)? If so, how do I prevent this? I assume it’s possible because it says “by default”.
Thanks in advance…