Bazel BUILD Encyclopedia of Functions

Report an issue View source Nightly · 7.3 · 7.2 · 7.1 · 7.0 · 6.5

Concepts and terminology

Functions

Rules

Native rules ship with the Bazel binary and do not require a load statement. Native rules are available globally in BUILD files. In .bzl files, you can find them in the native module. For non-native Starlark rules that ship separately from Bazel, see the list of recommended rules.

Language-specific native rules

Language Binary rules Library rules Test rules Other rules
C / C++ cc_binary
cc_import
cc_library
cc_proto_library
cc_shared_library
cc_static_library
cc_test
cc_toolchain
cc_toolchain_suite
fdo_prefetch_hints
fdo_profile
memprof_profile
propeller_optimize
Java java_binary
java_import
java_library
java_lite_proto_library
java_proto_library
java_test
java_package_configuration
java_plugin
java_runtime
java_toolchain
Objective-C objc_import
objc_library
Protocol Buffer proto_library
proto_lang_toolchain
Python py_binary
py_library
py_test
py_runtime
Shell sh_binary
sh_test

Language-agnostic native rules

Family Rules
Extra Actions
General
Platforms and Toolchains
Workspace