Awesome Bazel
{Fast, Correct} - Choose two
Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports large codebases across multiple repositories, and large numbers of users. (via docs)
A curated list of Bazel rules, tooling and resources.
Have something to contribute or discuss? Open a pull request or create an issue.
Contents
Rules
Language/Platform | Repository/Documentation |
---|---|
.NET (C#, Nuget) | |
Android |
|
Apple (iOS, macOS, tvOS, watchOS) | |
ANTLR | |
C++ |
|
Closure | |
CocoaPods | |
D | |
Dart | |
Docker | |
ECS | |
Emscripten | |
Go |
|
GWT | |
Haskell |
|
Hugo | |
Idris | |
Java |
|
Kotlin | |
Kubernetes | |
LaTeX | |
LLVM toolchain | |
Maven |
|
Nixpkgs | |
Node.js | |
OCaml | |
OCI Containers | |
OpenAPI/Swagger | |
PHP | |
Protobuf | |
Purescript | |
Python |
|
R | |
ReasonML, BuckleScript | |
Ruby | |
Rust |
|
Sass | |
Scala | |
Swift | |
Twirl | |
TypeScript | |
Web (HTML, CSS, JS, assets) |
Tooling
General
- bazelbuild/bazel-watcher - Automatically run Bazel commands when source files change
- nadirizr/dazel - Run Bazel inside a Docker container via a seamless proxy
- spotify/bazel-tools - Spotify's production tools for dealing with very large Bazel-managed repositories.
- atlassian/bazel-tools - Atlassian's reusable bits for Bazel
- gerrit/bazlets - Gerrit's re-usable building blocks for Bazel build tool
- Bazel Code Search - Browse Bazel's codebase with cross references.
- heroku-buildpack-bazel - Heroku buildpack for Bazel
- hchauvin/bazel-coverage-report - A multi-language coverage report generator for Bazel
- bazel-arcanist - Integration with Arcanist with
arc test
andarc lint
- Asana/bazeltsc - TypeScript compiler that knows how to run as a Bazel persistent worker
- bazelbuild/sandboxfs - A virtual file system for sandboxing
Starlark
Starlark (formerly called Skylark) is Bazel's domain-specific language for writing BUILD definitions and rules.
- Official documentation
- Language description
- Skylark in Go
- Skydoc - Starlark documentation generator
- Skylib - Common useful functions for writing custom build rules with Starlark
- Bazel Common Libraries - Common functionality for Google's open-source libraries that are built with Bazel.
Remote caching and execution
- bazel-remote - A remote cache for Bazel using HTTP/1.1 with
--remote_rest_cache
- bazelbuild/bazel-buildfarm - Self-hosted remote caching and execution service
- EdSchouten/bazel-buildbarn - Alternative buildfarm implementation written in Go
- Asana/bazels3cache - Small web server for a Bazel cache that proxies to S3, allowing Bazel to work offline and has async uploads to make Bazel faster.
Project generators
Tools for generating WORKSPACE and BUILD files from source code.
- blakefiler.py - Generate a Makefile and tarball-able distribution using
bazel query
- Lavender - Generate Visual Studio projects that uses Bazel for the actual building
- Jadep: Java Automated Dependencies - Generate BUILD files automatically for an existing Java project with class dependency analysis.
- BUILD File Generator - Similar tool for existing Java projects.
- Gazelle - BUILD file generator for Go projects.
- Pazel - Generate Bazel BUILD files for Python
- Tulsi for Xcode - A project generator for Xcode projects
- pinterest/xchammer - XCHammer generates Xcode projects from a Bazel Workspace
- create-bazel-workspace - Generate a new multi-language Bazel workspace with minimal configuration
Editors
- IntelliJ plugin (compatible with Android Studio and CLion)
- Eclipse plugin
- Vim plugin
- Emacs Support
- VSCode
- PyCharm
BUILD file tools
bazelbuild/buildtools contains:
- Buildifier - Prettifier for BUILD files
- Buildozer - Manipulate BUILD file contents from the command line
- unused_deps - Find unneeded dependencies in BUILD files
Migration
- bazelbuild/migration-tooling - Migrate an existing Maven project to Bazel.
- johnynek/bazel-deps - Generate bazel dependencies transitively for Maven artifacts, with scala support.
- rules_maven - Rules to define Maven dependencies
- bazelize-maven-plugin - Maven plugin for migration from Maven to Bazel
- bazelbuild/gmaven_rules - Transitive WORKSPACE rules for Google's Maven repository
- stripe/sbt-bazel - Easily convert SBT projects to Bazel workspaces
Resources
Designs
- bazelbuild/proposals - Index of all design documents and proposals for Bazel.
- Bazel's design process
Tutorials
Official
Codelabs
Community
Projects
A list of projects built with Bazel:
- bazelment/trunk: A collection of C++/Java OSS with BUILD files. e.g. grpc, guava, netty.
- tensorflow/tensorflow: Computation using data flow graphs for scalable machine learning.
- abseil/abseil-cpp - OSS collection of C++ code (compliant to C++11) designed to augment the C++ standard library.
- GoogleCloudPlatform/distroless - Language focused docker images, minus the operating system.
- google/subpar - Subpar is a utility for creating self-contained python executables. It is designed to work well with Bazel.
- alexeagle/angular-bazel-example: Building an Angular application with Bazel
- ABC: Angular Buildtools Convergence https://g.co/ng/abc
- google/startup-os - Working examples of Google's Open Source tools and Cloud.
- lucperkins/colossus - An example microservice architecture for Kubernetes using Bazel, Go, Java, Docker, Kubernetes, Minikube, Gazelle, gRPC, Prometheus, Grafana, and more.
Articles
- Build mobile apps with Bazel. Part 2: iOS - Francois Stephany
- Build mobile apps with Bazel. Part 1: Android - Francois Stephany
- (In Japanese) Building C++ with Bazel / C++ビルド環境としてのBazel導入試行
- Nix + Bazel = fully reproducible, incremental builds
- Production Code Splitting With Bazel - Greg Magolan (Google)
- Build large polyglot projects with Bazel... now with Haskell support
- Managing a Go monorepo with Bazel - Filip Nikolovski (InPlayer)
- How to Create a Persistent Worker for Bazel - Mike Morearty (Asana)
- We Switched from Maven to Bazel and Builds Got 10x Faster - Jason Lunz (Redfin)
- Angular Bazel Build With Dev Server - Torgeir "Tor" Helgevold
- Bazel Conference 2017 - Justin Poehnelt
- What Angular is doing with Bazel and Closure
- Building Docker Images Without Docker
- Bazel Golang Hello World
- Migrating from Gradle to Bazel
- Benchmarking the Bazel build system on real-life C++
- Migrating Gypsum and CodeSwitch to Bazel - Jay Conrod (Google)
Videos
- ScalaSphere 2018: Using Bazel to build Scala - Andy Scott (Stripe)
- GopherChina 2018: Bazel build //:Go - Yuan He (流利说/liulishuo.com)
- How I love being ejected: Customizing your Angular build with Bazel - Greg Magolan (Angular team)
- SF Scala: Bazel - a Brief Overview - Ulf Adams (Google)
- Bazel for building Angular applications at Angular Lunch - Kyle Cordes
- Deep Dive of Google's Angular Build Toolchain - Alex Eagle (Google)
- Bazel Conference 2017 Opening Remarks - Helen Altshuler, John Field, Ulf Adams (Google)
- Bazel Remote Execution and Remote Caching w/ Two Sigma and Uber - Alpha Lam (Two Sigma), George Gensure (Uber)
- Tensorflow with Bazel — Lessons Learned - Gunhan Gulsoy (Google)
- Building Real-time Systems with Bazel w/ SpaceX - Matt Sachtler, Patrick Conrad (SpaceX)
- Hacks and Tips for Incremental Adoption of Bazel for iOS w/ Pinterest - Rahul Malik, Brandon Kase, Jerry Marino (Pinterest)
- Front End Development with Bazel: Angular/TypeScript and Persistent Workers w/ Asana - Mike Morearty (Asana), Alex Eagle (Google)
- Scala with Bazel w/ Wix, Stripe, Databricks - Ittai Zeidman (Wix), Oscar Boykin (Stripe), Ahir Reddy (DataBricks)
- Skylark: The Bazel Extensibility Language - Laurent Le Brun (Google)
- Using Bazel for Fast, Correct Docker Deployments w/ Databricks - Miles Yucht (Databricks), Matthew Moore (Google)
- Platforms and Toolchains in Bazel - John Cater (Google)
- Building Kubernetes [a Go binary] with Bazel - Jeff Grafton (Google)
- Integration testing with Bazel w/Dropbox - Benjamin Peterson (Dropbox)
- Bazel Conference 2017 playlist
- GothamGo 2017: A Go implementation of the Skylark Configuration Language - Alan Donovan (Google)
- Bazel: Google's Extensible, Multilingual, Scalable Build System DevTools@Scale2017 - Dmitry Lomov (Google)
- Building Go with Bazel at Golang UK Conference 2017 - Paul Bellamy
- Building Software At Google Scale - Ulf Adams, Helen Altshuler, David Stanke (Google)
- Bazel: Google's own build tool, now publicly available in Beta - Paul Johnston
- Bazel at FrOSCon - Klaus Aehlig (Google)
- Building Python with Bazel - Benjamin Peterson (Dropbox)
- Bazel at the Dart Developer Summit 2016 - Damien Martin-Guillerez (Google)
Slides
- Building Gerrit with Bazel at Gerrit User Conference 2016 - David Ostrovsky
Blogs
Community
- #bazelbuild on Slack
- BuildTeamWorld on Slack - A community slack for BuildFarm, BuildGrid, Bazel and general build teams.
#bazel
on Freenode- Stack Overflow
- Bazel users mailing list
- Bazel developers mailing list
Misc
- Why Google Stores Billions of Lines of Code in a Single Repository (Video at @Scale 2015)