Elegant Gradle + Android dependency management (even works for Ant-based projects!)
With Gradle the Java world has finally started to catch up in modern dependency management methodologies. Maven the technology has always worked but frankly, everybody who used that suffered.
The new Gradle support in Android’s build system is promising but unfortunately has a lot of rough edges. I have a lot of troubles getting Android Studio to work smoothly, let alone convert existing Ant-based projects.
However, you don’t need to convert your project if all you want is to download .jar files using Gradle. Just create build.gradle along side your build.xml
:
Now you can invoke a command like
gradle libs
to get the .jar
files copied into libs directory. The rest of your Ant/Eclipse workflow would then just work.