We are delighted to announce the 0.5.0 release of Bazel (follow the link for the full release notes and list of changes).
This release simplifies Bazel installation on Windows and platforms where a JDK is not available. It solidifies the Build Event Protocol and Remote Execution APIs.
Note: Bazel release 0.5.0 contains a bug in the compiler detection on macOS which requires Xcode and the iOS tooling to be installed (corresponding issue #3063). If you had Command Line Tools installed, you also need to switch to Xcode using
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
.
Improvements from our roadmap
Bundled JDK
As announced earlier, when using an install script, bazel now comes by default bundled with JDK 8. This means fewer steps required to install Bazel. Read more about JDK 7 deprecation in the related blog post.
Windows support: now in beta
Bazel on Windows is now easier to install: it is no longer linked with MSYS. A following blog post will detail this further. Bazel is now able to build Java, C++ and Python on Windows.
Build Event Protocol
The Build Event Protocol is now available as an experimental option; it enables programmatic subscription to Bazel's events (build started, action status, target completed, test results…). Currently, the protocol can only be written to a file. A gRPC transport is already in the works and will be added in the next minor release. The API will be stabilized in 0.5.1.
Coverage support for pure Java targets
Use bazel coverage //my:target to generate coverage information from a java_test.
Other major changes since 0.4.0
New rules
New rules in Bazel: proto_library, java_lite_proto_library, java_proto_library and cc_proto_library.
New Apple rules
There is a new repository for building for Apple platforms: https://github.com/bazelbuild/rules_apple. These rules replace the deprecated iOS/watchOS rules built into Bazel. By rebuilding the rules from the ground up in Skylark and hosting them separately, we can more quickly fix bugs and implement new Apple features and platform versions as they become available.
Android Support Improvements
- Integration with the Android Support Repository libraries in android_sdk_repository.
- Support for Java 8 in Android builds with --experimental_desugar_for_android. See Android Studio's documentation for more details about Android's Java 8 language features.
- Multidex is now fully supported via android_binary.multidex.
- android_ndk_repository now supports Android NDK 13 and NDK 14.
- APKs are now signed with both APK Signature V1 and V2. See Android documentation for more details about APK Signature Scheme v2.
Remote Execution API
We fixed a number of bugs in the Remote Execution implementation. The final RPC API design has been sent to bazel-discuss@ for discussion (see Design Document: Remote Execution API) and it should be finalized in the 0.6.0 release. The final API should only be a minor change compared to the implementation in this 0.5.0 release.
Skylark
- Declared Providers are now implemented and documented. They enable more robust and clearly defined interfaces between different rules and aspects. We recommend using them for all rules and aspects.
- The type formerly known as 'set' is now called 'depset'. Depsets make your rules perform much better, allowing rules memory consumption to scale linearly instead of quadratically with build graph size - make sure you have read the documentation on depsets.
Finally...
A big thank you to our community for your continued support. Particular shout-outs to Peter Mounce for the Chocolatey Windows package and Yuki Yugui Sonoda for maintaining rules_go (they both received an open source peer bonus from Google).
Thank you all, keep the questions and bug reports coming!
See the full list of changes on GitHub.