I am developing a Android library, and I am looking for guidance on how to speed up the mechanics of developing the library for use in an application.
In my production workflow, I publish the aar
library to a private maven repository. This aar
library is retrieved through gradle by multiple applications. This works fine for production.
I am looking for a good development workflow to use development versions of the library. These are the options I have identified, none of which I find entirely satisfactory:
- Publishing each development library version to the private maven repository. Continually publishing development versions of the library to the maven repository and retrieving them to run once in a test application is very cumbersome because this requires either using a new version for every development version or wiping the local gradle cache when reusing the same version.
- Copying the source of the library into the source of the project, described in the accepted answer. This seems to defeat the purpose of having a library.
- Switching the application to use a local file version of the
aar
library. Importing theaar
library introduces changes to the build files of the application that need to be reverted when going back to the production use of the maven repository.
Is there a way I can insert my development versions of the aar
library into the local gradle cache so they can be retrieved locally, while maintaining the same application build configuration present in the production version? Or is there a simpler workflow for library development?