4 ms·
Are you doing something really specific with the build tool? What testing tools do you use? Do you use the NDK? Gradle covers the 80% use case really well. Eve
by krschultz 12y ago
Are you doing something really specific with the build tool? What testing tools do you use? Do you use the NDK?
Gradle covers the 80% use case really well. Everyone new to Android should use Studio + Gradle, no question. Dependencies are a breeze, the integration between Gradle & Studio is wonderful, the syntax is super simple, and the plugin handles most things by default pretty well. There are several things like build variants & package name interpolation that were impossible with Ant, difficult with Maven, and are trivial with Gradle.
The intermediate level stuff is more of a mixed bag. Some tests work well with Gradle, others (like Robolectric) are more of a pain. The NDK support isn't worked out yet. Some of the more fringe plugins like code coverage and formatting aren't plugged in yet. Here you will probably have to understand a bit about Gradle, but the tools team is making progress fixing the issues. What was a problem 2 months ago just works out of the box today with no Gradle specific knowledge.
For advanced things like writing your own plugins, then you have to know the respective build system. I don't know Maven well enough to write my own plugins. I have written a couple Gradle plugins. I have one that uploads APKs at the end of the build to various distribution APIs, one for secure signing, and one for bumping the versions whenever I want to. It was pretty straightforward to figure out.
- evanspa 12y agoNo, I wouldn't say I'm doing anything specific. No on NDK. It's simply that Eclipse/Maven serve me well (I'm even able to create/run Android unit tests with the android-maven-plugin). In short, so far my entire workflow is well-served by Eclipse/Maven. I'd concede that Studio/Gradle is the future, and that Gradle is more powerful than Maven; my "issues" are purely emotional :) With all that there is to learn and explore in this world, I don't want to have to spend time on another Java build tool when I already know 2 good ones (Ant and Maven).
- dlubarov 12y agoTotally understand the sentiment, but given Gradle's rising popularity, it will probably be difficult for us Java (and especially Android) devs to avoid it. Might as well give in and pick it up now.
- emsy 12y agoIt already works for simple builds. It's a bit harder if you have many MK files for various libraries. I migrated my Cocos2d-X game to Gradle a while ago and I could only solve the problem through a gradle exec task. Still, the build is already much saner than the Maven version. I just wish they would give the NDK more attention, because the problem exists for well over a year.