Hi there. I need to add a dependency as a .aar fil...
# gradle
u
Hi there. I need to add a dependency as a .aar file. I can do that by importing this file, but then I have this big file in my project and issues with remote git repositories. But that's not really what I want. So the question is: how to add a dependency to that .aar file being located outside the project folder? In the same way that Android SDK is located elsewhere. Any help will be very appreciated!
o
you can use absolute paths with
files(...)
and it will be respected
👍 1
e.g.
implementation(files("/path/to/somewhere"))
I would recommend storing the actual location as a property file hidden from git (like how Android Studio handles the SDK)
u
@octylFractal, you mean like gradle.property?
o
sort of, but another file that isn't checked in, e.g. `local.properties`: https://developer.android.com/studio/build#properties-files
u
So that it would not be pushed by mistake to git repo?
o
yes, since it's local-only configuration
t
or install the aar into mavenLocal and pull it from there. that way proper dependency handling occurs.
u
@trevjones, didn’t use it before. does it take a lot of time?
t
If the aar is one you produce not at all. Just setup maven-publish and run the publish to maven local task. The 3.6beta or maybe 4.0alpha has support built in. And open source plugins for before that