simon stewart, facebook engineer - building facebook for android

Post on 11-May-2015

209 Views

Category:

Technology

3 Downloads

Preview:

Click to see full reader

DESCRIPTION

How does Facebook build its Android app? How are they working to improve the quality, speed and stability? In this talk, we'll cover everything Facebook's Android team does from source control, builds, testing and release, and show you how you can do the same. More details on: http://2013.howtoweb.co/

TRANSCRIPT

Simon Stewartsimons@fb.com

github.com/shs96c@shs96c

Move Fast and Build Things

The Challenge

>300 engineers

>150,000 files

>100,000 commits

There is no Android team

How do we “move fast”?

Build fast

The working copy

▪We use git for source control

▪Two branches we care about day-to-day:

▪ master

▪ stable

How the code is organized

Text

http://www.flickr.com/photos/darwinbell/3030214710/

Code review

Image macros

QuickTime™ and aGIF decompressor

are needed to see this picture.

Dependency injection

http://www.flickr.com/photos/31246066@N04/5253179784/

We needed a better tool

▪Minimal overhead in creating a module

▪Keep boilerplate out of the codebase

▪ IDE friendly

▪Faster clean builds

▪Faster incremental builds

▪Support ad-hoc build steps

Buck: an Android build system

▪build rule procedure for producing output files from input files

▪build file file (named BUCK) where build rules are declared

▪build target string identifier for a build rule

Build Target

//java/com/facebook/share:ui

Root of the repository

Directory where the build file can be found

Name of the build rule

Build Rule

android_library( name = 'ui', srcs = glob(['**/*.java']), deps = [ '//android_res/com/facebook/share:res', '//java/com/facebook/base:base', '//third-party/java/guava:guava', ], visibility = [ 'PUBLIC' ],)

Dependency Graph

AR AR

AR

ALAL AL

AL AL

AL

AB

GR

AB

GR

Dependency Graph

AR AR

AR

ALAL AL

AL AL

AL

AB

GR

AB

GR

Buck is Open Source!

▪Available on GitHub: https://github.com/facebook/buck/

▪Documentation galore: http://facebook.github.com/buck/

▪Apache 2.0 License

▪Written in Java and a smattering of Python

▪Works on OS X and Linux

Test fast

Developers write tests

Unit tests

http://www.flickr.com/photos/aracelota/4773084433/

Larger tests

http://www.flickr.com/photos/amphalon/6510474165/

Deploy fast

Dogfood, Alpha and Beta

Questions?

top related