Is there a way to export a variable in gradle, so that other projects that import the project as a dependency may access it?
For my particular case, I have an Android project that makes use of AppCompat. I currently have the AppCompat version as a variable in gradle.properties
, but AppCompat has multiple components, and I only add the ones I need. For anyone else using my library and needing the other AppCompat components, it is best that they add it with the same version. As of now, they have to specify the version themselves and make sure it's the same. It would be better if they have a way of accessing the version I'm using as a variable so it is always in sync.
I'm hoping there is a better solution than to say host a raw gradle file on github that will add the variables as extensions, but as of now that seems like the most viable option.