Buck: An Android build tool

10 篇文章 0 订阅

http://facebook.github.io/buck/

Buck: An Android build tool

Buck is a build system for Android that encourages the creation of small, reusable modules consisting of code and resources.

Features

Buck can help you do the following:
  • Speed up your Android builds. Buck builds independent artifacts in parallel to take advantage of multiple cores. Further, it reduces incremental build times by keeping track of unchanged resources so that the minimal set of resources is rebuilt.
  • Introduce ad-hoc build steps for building artifacts that are not supported out-of-the-box using the standard Ant build scripts for Android.
  • Keep the logic for generating build rules in the build system instead of requiring a separate system to generate build files.
  • Generate code-coverage metrics for your unit tests.
  • Generate an IntelliJ project based on your build rules. This makes Buck ideal for both local development builds in an IDE as well as headless builds on a continuous integration machine.
  • Make sense of your build dependencies.
  • Understand what is going on under the hood when building an APK.
Speed is the primary focus for Buck. At Facebook, we found Buck to be more than twice as fast as Ant, and we are continuing to make it even faster.

How Buck Works

Buck has three primary concepts:
  • A build rule is a procedure for producing an output file from a set of input files.
  • A build target is a string identifier for a build rule. It can be thought of as a "URI" within a project using Buck.
  • A build file that defines one or more build rules. In Make, this would be aMakefile, but in Buck, these files are named BUCK. A project using Buck is expected to have many BUCK files.
Every build rule can have zero or more dependencies associated with it, or  deps . These dependencies from a directed graph, which Buck requires to be acyclic.

When building the output of a build rule, all of the rule's transitive dependencies are built first. This means that the graph is built in a "bottom-up" fashion. A build rule knows only who it depends on, not what depends on it, which makes the build graph easier to reason about. This helps Buck identify independent subgraphs that can be built in parallel, as well as determine the minimal set of build rules that need to be rebuilt.

Is Buck for Me?

Buck is designed for building multiple deliverables from a single repository rather than across multiple repositories. It has been our experience that maintaining dependencies in the same repository makes it easier to ensure that all developers have the correct version of all of the code, and simplifies the process of making atomic commits.

If you build multiple applications, or if even if you ship one application but use several sample applications for development, then Buck is definitely for you. Give theQuick Start a try and see how Buck can help you organize your Android project and build it faster than ever before.


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值