I'm currently using ant to build Android projects but it simply doesn't cut it for larger projects and maintaining different deliverables is becoming a pain.
Two alternatives I'm looking at are Facebook's Buck (http://facebook.github.io/buck/) and Gradle that Google is backing with Android studio (http://tools.android.com/tech-docs/new-build-system/user-guide).
Besides trying them out and reading up on their coverage I would like to ask you fine Stackoverflow people for your recommendations. Preferably if you've used either tool for a while, with bonus points for Buck since it didn't get that much coverage.
Important points are
I'm open to other alternatives as well. What do you suggest and why?
Android Studio uses Gradle, an advanced build toolkit, to automate and manage the build process, while allowing you to define flexible custom build configurations. Each build configuration can define its own set of code and resources, while reusing the parts common to all versions of your app.
Gradle is one type of build tool that builds the source code of the program. So it's an important part of Android Studio, and needs to be installed before starting developing your application. We do not have to install it separately, because the Android Studio does it for us, when we make our first project.
Buck is a declarative build system developed & used by Facebook. According to their documentation it encourages the creation of small, reusable modules consisting of code and resources, and supports a variety of languages on many platforms.
As I put front and center in the Buck documentation: "Buck is a build system for Android that encourages the creation of small, reusable modules consisting of code and resources."
By design, Buck encourages you to create small modules so that you can easily compose a new app out of your existing building blocks. This means that maintaining multiple deliverables is straightforward: it eliminates boilerplate without requiring you to organize your repository into a predefined structure. You can also create ad-hoc build steps to suit your needs with Buck via macros and genrules. (A more formalized extension system is in the works.)
We also care a lot about speed, particularly the speed of incremental builds. Because Buck has a strong concept of dependencies, we can often avoid rebuilding intermediate artifacts. Other build systems also try to do this (like Ant), but frequently sacrifice correctness, as a result. We don't.
We recognize that IDE support is important. Certainly Google's collaboration with Gradle gives them a leg up there. However, Buck has a command to generate an IntelliJ project from the dependency graph defined in Buck build files, and we have broken ground on our own IntelliJ plugin, so this is something that we also care deeply about.
Finally, bear in mind that Buck is used to build Facebook, Facebook Messenger, and Instagram for Android. Buck is not going away. Further, the code for all three apps (and reduced versions of the apps, for even faster development cycles) lives in one Git repository at Facebook, so those of us working on Buck internally are sensitive to the needs of large codebases that support multiple deliverables.
Long-term, the new Gradle build system will be the standard, and it looks very good. However, it looks like it's not quite ready for use in non-trival projects yet. For instance, it looks like it doesn't support apklib dependencies yet.
This is understandable, and reflected in the fact that the current version is 0.3 I'm looking forward to seeing it evolve.
For a project that needs to be build today, I'd use Maven. Actually, I'm in the process of moving a client's build from Eclipse-only to Maven right now, so that they can have a repeatable build process, good dependency management, and CI. The new Gradle build looks like it will be more flexible, but right now Maven handles apklibs. Since Gradle can use Maven dependencies, I'm expecting that we'll be able to move from Maven to Gradle easily in the future.
I don't know anything about Buck. However, that in itself is a red flag. I'd hesitate to use a build system that few people know anything about. That doesn't mean that it's not good - it may be great. But using it now is probably a gamble.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With