Page Not Found
We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/404.html b/404.html new file mode 100644 index 000000000000..a8ee152f7d4d --- /dev/null +++ b/404.html @@ -0,0 +1,20 @@ + + +
+ + +We could not find what you were looking for.
Please contact the owner of the site that linked you to the original URL and let them know their link is broken.
.buckconfig
",id:"re-configuration-in-buckconfig",level:2},{value:"RE platform configuration",id:"re-platform-configuration",level:2}],m={toc:u};function c(e){let{components:n,...t}=e;return(0,a.mdx)("wrapper",(0,r.Z)({},m,t,{components:n,mdxType:"MDXLayout"}),(0,a.mdx)("p",null,"Buck2 can use services that expose\n",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/bazelbuild/remote-apis"},"Bazel's remote execution API")," in\norder to run actions remotely."),(0,a.mdx)("p",null,"Buck2 projects have been successfully tested for remote execution against\n",(0,a.mdx)("a",{parentName:"p",href:"https://www.engflow.com/"},"EngFlow"),",\n",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/buildbarn/bb-remote-execution"},"BuildBarn")," and\n",(0,a.mdx)("a",{parentName:"p",href:"https://www.buildbuddy.io"},"BuildBuddy"),". Sample project configurations for those\nproviders are available under\n",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/facebook/buck2/tree/main/examples/remote_execution"},"examples/remote_execution"),"."),(0,a.mdx)("h2",{id:"re-configuration-in-buckconfig"},"RE configuration in ",(0,a.mdx)("inlineCode",{parentName:"h2"},".buckconfig")),(0,a.mdx)("p",null,"Configuration for remote execution can be found under ",(0,a.mdx)("inlineCode",{parentName:"p"},"[buck2_re_client]")," in\n",(0,a.mdx)("inlineCode",{parentName:"p"},".buckconfig"),"."),(0,a.mdx)("p",null,"Keys supported include:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"engine_address")," - address to your RE's engine."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"action_cache_address")," - address to your action cache endpoint."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"cas_address")," - address to your content-addressable storage (CAS) endpoint."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"tls_ca_certs")," - path to a CA certificates bundle. This must be PEM-encoded.\nIf none is set, a default bundle will be used. This path contains environment\nvariables using shell interpolation syntax (i.e. $VAR). They will be\nsubstituted before reading the file."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"tls_client_cert")," - path to a client certificate (and intermediate chain), as\nwell as its associated private key. This must be PEM-encoded. This path can\ncontain environment variables using shell interpolation syntax (i.e. $VAR).\nThey will be substituted before reading the file."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"http_headers")," - HTTP headers to inject in all requests to RE. This is a\ncomma-separated list of ",(0,a.mdx)("inlineCode",{parentName:"li"},"Header: Value")," pairs. Minimal validation of those\nheaders is done here. This can contain environment variables using shell\ninterpolation syntax ($VAR). They will be substituted before reading the file."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"instance_name")," - an instance name to pass on execution, action cache, and CAS\nrequests.")),(0,a.mdx)("p",null,"Buck2 uses ",(0,a.mdx)("inlineCode",{parentName:"p"},"SHA256")," for all its hashing by default. If your RE engine requires\nsomething else, this can be configured in ",(0,a.mdx)("inlineCode",{parentName:"p"},".buckconfig")," as follows:"),(0,a.mdx)("pre",null,(0,a.mdx)("code",{parentName:"pre",className:"language-ini"},"[buck2]\n# Accepts BLAKE3, SHA1, or SHA256\ndigest_algorithms = BLAKE3\n")),(0,a.mdx)("h2",{id:"re-platform-configuration"},"RE platform configuration"),(0,a.mdx)("p",null,"Next, your build will need an\n",(0,a.mdx)("a",{parentName:"p",href:"https://buck2.build/docs/concepts/glossary/#execution-platform"},"execution platform"),"\nthat specifies how and where actions should be executed. For a sample platform\ndefinition that sets up an execution platform to utilize RE, take a look at the\n",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/facebook/buck2/blob/main/examples/remote_execution/engflow/platforms/defs.bzl"},"EngFlow example"),",\n",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/facebook/buck2/blob/main/examples/remote_execution/buildbarn/platforms/defs.bzl"},"BuildBarn example"),",\nor the\n",(0,a.mdx)("a",{parentName:"p",href:"https://github.com/facebook/buck2/blob/main/examples/remote_execution/buildbuddy/platforms/defs.bzl"},"BuildBuddy example"),"."),(0,a.mdx)("p",null,"To enable remote execution, configure the following fields in\n",(0,a.mdx)("a",{parentName:"p",href:"https://buck2.build/docs/api/build/globals/#commandexecutorconfig"},"CommandExecutorConfig"),"\nas follows:"),(0,a.mdx)("ul",null,(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"remote_enabled")," - set to ",(0,a.mdx)("inlineCode",{parentName:"li"},"True"),"."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"local_enabled")," - set to ",(0,a.mdx)("inlineCode",{parentName:"li"},"True")," if you also want to run actions locally."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"use_limited_hybrid")," - set to ",(0,a.mdx)("inlineCode",{parentName:"li"},"False")," unless you want to exclusively run\nremotely when possible."),(0,a.mdx)("li",{parentName:"ul"},(0,a.mdx)("inlineCode",{parentName:"li"},"remote_execution_properties")," - other additional properties.",(0,a.mdx)("ul",{parentName:"li"},(0,a.mdx)("li",{parentName:"ul"},"If the RE engine requires a container image, this can be done by setting\n",(0,a.mdx)("inlineCode",{parentName:"li"},"container-image")," to an image URL, as is done in the example above.")))))}c.isMDXComponent=!0}}]);
\ No newline at end of file
diff --git a/assets/js/0c7aced5.696b97dc.js b/assets/js/0c7aced5.696b97dc.js
new file mode 100644
index 000000000000..9ed7011725e6
--- /dev/null
+++ b/assets/js/0c7aced5.696b97dc.js
@@ -0,0 +1 @@
+"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[2247],{3905:(e,t,a)=>{a.r(t),a.d(t,{MDXContext:()=>d,MDXProvider:()=>_,mdx:()=>x,useMDXComponents:()=>p,withMDXComponents:()=>m});var i=a(67294);function n(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(){return r=Object.assign||function(e){for(var t=1;tpriv/
directory",id:"with-priv-directory",level:4},{value:"Using OTP applications and mod
field",id:"using-otp-applications-and-mod-field",level:4},{value:"Using Yecc and Leex",id:"using-yecc-and-leex",level:4},{value:"erlang_app_includes",id:"erlang_app_includes",level:2},{value:"Parameters",id:"parameters-47",level:4},{value:"erlang_escript",id:"erlang_escript",level:2},{value:"Parameters",id:"parameters-48",level:4},{value:"Details",id:"details-31",level:4},{value:"erlang_otp_binaries",id:"erlang_otp_binaries",level:2},{value:"Parameters",id:"parameters-49",level:4},{value:"Details",id:"details-32",level:4},{value:"erlang_release",id:"erlang_release",level:2},{value:"Parameters",id:"parameters-50",level:4},{value:"Details",id:"details-33",level:4},{value:"erlang_test",id:"erlang_test",level:2},{value:"Parameters",id:"parameters-51",level:4},{value:"Details",id:"details-34",level:4},{value:"export_file",id:"export_file",level:2},{value:"Parameters",id:"parameters-52",level:4},{value:"Details",id:"details-35",level:4},{value:"external_test_runner",id:"external_test_runner",level:2},{value:"Parameters",id:"parameters-53",level:4},{value:"filegroup",id:"filegroup",level:2},{value:"Parameters",id:"parameters-54",level:4},{value:"Details",id:"details-36",level:4},{value:"gen_aidl",id:"gen_aidl",level:2},{value:"Parameters",id:"parameters-55",level:4},{value:"Details",id:"details-37",level:4},{value:"genrule",id:"genrule",level:2},{value:"Parameters",id:"parameters-56",level:4},{value:"Details",id:"details-38",level:4},{value:"git_fetch",id:"git_fetch",level:2},{value:"Parameters",id:"parameters-57",level:4},{value:"Details",id:"details-39",level:4},{value:"go_binary",id:"go_binary",level:2},{value:"Parameters",id:"parameters-58",level:4},{value:"Details",id:"details-40",level:4},{value:"go_exported_library",id:"go_exported_library",level:2},{value:"Parameters",id:"parameters-59",level:4},{value:"Details",id:"details-41",level:4},{value:"go_library",id:"go_library",level:2},{value:"Parameters",id:"parameters-60",level:4},{value:"Details",id:"details-42",level:4},{value:"go_stdlib",id:"go_stdlib",level:2},{value:"Parameters",id:"parameters-61",level:4},{value:"go_test",id:"go_test",level:2},{value:"Parameters",id:"parameters-62",level:4},{value:"Details",id:"details-43",level:4},{value:"go_test_runner",id:"go_test_runner",level:2},{value:"Parameters",id:"parameters-63",level:4},{value:"groovy_library",id:"groovy_library",level:2},{value:"Parameters",id:"parameters-64",level:4},{value:"Details",id:"details-44",level:4},{value:"groovy_test",id:"groovy_test",level:2},{value:"Parameters",id:"parameters-65",level:4},{value:"gwt_binary",id:"gwt_binary",level:2},{value:"Parameters",id:"parameters-66",level:4},{value:"halide_library",id:"halide_library",level:2},{value:"Parameters",id:"parameters-67",level:4},{value:"Details",id:"details-45",level:4},{value:"haskell_binary",id:"haskell_binary",level:2},{value:"Parameters",id:"parameters-68",level:4},{value:"Details",id:"details-46",level:4},{value:"haskell_ghci",id:"haskell_ghci",level:2},{value:"Parameters",id:"parameters-69",level:4},{value:"haskell_haddock",id:"haskell_haddock",level:2},{value:"Parameters",id:"parameters-70",level:4},{value:"haskell_ide",id:"haskell_ide",level:2},{value:"Parameters",id:"parameters-71",level:4},{value:"haskell_library",id:"haskell_library",level:2},{value:"Parameters",id:"parameters-72",level:4},{value:"Details",id:"details-47",level:4},{value:"haskell_prebuilt_library",id:"haskell_prebuilt_library",level:2},{value:"Parameters",id:"parameters-73",level:4},{value:"Details",id:"details-48",level:4},{value:"http_archive",id:"http_archive",level:2},{value:"Parameters",id:"parameters-74",level:4},{value:"Details",id:"details-49",level:4},{value:"http_file",id:"http_file",level:2},{value:"Parameters",id:"parameters-75",level:4},{value:"Details",id:"details-50",level:4},{value:"jar_genrule",id:"jar_genrule",level:2},{value:"Parameters",id:"parameters-76",level:4},{value:"java_annotation_processor",id:"java_annotation_processor",level:2},{value:"Parameters",id:"parameters-77",level:4},{value:"java_binary",id:"java_binary",level:2},{value:"Parameters",id:"parameters-78",level:4},{value:"java_library",id:"java_library",level:2},{value:"Parameters",id:"parameters-79",level:4},{value:"Details",id:"details-51",level:4},{value:"java_plugin",id:"java_plugin",level:2},{value:"Parameters",id:"parameters-80",level:4},{value:"java_test",id:"java_test",level:2},{value:"Parameters",id:"parameters-81",level:4},{value:"java_test_runner",id:"java_test_runner",level:2},{value:"Parameters",id:"parameters-82",level:4},{value:"js_bundle",id:"js_bundle",level:2},{value:"Parameters",id:"parameters-83",level:4},{value:"js_bundle_genrule",id:"js_bundle_genrule",level:2},{value:"Parameters",id:"parameters-84",level:4},{value:"js_library",id:"js_library",level:2},{value:"Parameters",id:"parameters-85",level:4},{value:"julia_binary",id:"julia_binary",level:2},{value:"Parameters",id:"parameters-86",level:4},{value:"julia_jll_library",id:"julia_jll_library",level:2},{value:"Parameters",id:"parameters-87",level:4},{value:"julia_library",id:"julia_library",level:2},{value:"Parameters",id:"parameters-88",level:4},{value:"julia_test",id:"julia_test",level:2},{value:"Parameters",id:"parameters-89",level:4},{value:"keystore",id:"keystore",level:2},{value:"Parameters",id:"parameters-90",level:4},{value:"kotlin_library",id:"kotlin_library",level:2},{value:"Parameters",id:"parameters-91",level:4},{value:"Details",id:"details-52",level:4},{value:"kotlin_test",id:"kotlin_test",level:2},{value:"Parameters",id:"parameters-92",level:4},{value:"legacy_toolchain",id:"legacy_toolchain",level:2},{value:"Parameters",id:"parameters-93",level:4},{value:"llvm_link_bitcode",id:"llvm_link_bitcode",level:2},{value:"Parameters",id:"parameters-94",level:4},{value:"Details",id:"details-53",level:4},{value:"lua_binary",id:"lua_binary",level:2},{value:"Parameters",id:"parameters-95",level:4},{value:"Details",id:"details-54",level:4},{value:"lua_library",id:"lua_library",level:2},{value:"Parameters",id:"parameters-96",level:4},{value:"Details",id:"details-55",level:4},{value:"matlab_program",id:"matlab_program",level:2},{value:"Parameters",id:"parameters-97",level:4},{value:"ndk_library",id:"ndk_library",level:2},{value:"Parameters",id:"parameters-98",level:4},{value:"Details",id:"details-56",level:4},{value:"ndk_toolchain",id:"ndk_toolchain",level:2},{value:"Parameters",id:"parameters-99",level:4},{value:"ocaml_binary",id:"ocaml_binary",level:2},{value:"Parameters",id:"parameters-100",level:4},{value:"Details",id:"details-57",level:4},{value:"ocaml_library",id:"ocaml_library",level:2},{value:"Parameters",id:"parameters-101",level:4},{value:"Details",id:"details-58",level:4},{value:"ocaml_object",id:"ocaml_object",level:2},{value:"Parameters",id:"parameters-102",level:4},{value:"ocaml_shared",id:"ocaml_shared",level:2},{value:"Parameters",id:"parameters-103",level:4},{value:"platform",id:"platform",level:2},{value:"Parameters",id:"parameters-104",level:4},{value:"prebuilt_apple_framework",id:"prebuilt_apple_framework",level:2},{value:"Parameters",id:"parameters-105",level:4},{value:"Details",id:"details-59",level:4},{value:"prebuilt_cxx_library",id:"prebuilt_cxx_library",level:2},{value:"Parameters",id:"parameters-106",level:4},{value:"Details",id:"details-60",level:4},{value:"prebuilt_cxx_library_group",id:"prebuilt_cxx_library_group",level:2},{value:"Parameters",id:"parameters-107",level:4},{value:"Details",id:"details-61",level:4},{value:"prebuilt_dotnet_library",id:"prebuilt_dotnet_library",level:2},{value:"Parameters",id:"parameters-108",level:4},{value:"Details",id:"details-62",level:4},{value:"prebuilt_go_library",id:"prebuilt_go_library",level:2},{value:"Parameters",id:"parameters-109",level:4},{value:"Details",id:"details-63",level:4},{value:"prebuilt_jar",id:"prebuilt_jar",level:2},{value:"Parameters",id:"parameters-110",level:4},{value:"Details",id:"details-64",level:4},{value:"prebuilt_native_library",id:"prebuilt_native_library",level:2},{value:"Parameters",id:"parameters-111",level:4},{value:"Details",id:"details-65",level:4},{value:"prebuilt_ocaml_library",id:"prebuilt_ocaml_library",level:2},{value:"Parameters",id:"parameters-112",level:4},{value:"prebuilt_python_library",id:"prebuilt_python_library",level:2},{value:"Parameters",id:"parameters-113",level:4},{value:"Details",id:"details-66",level:4},{value:"python_binary",id:"python_binary",level:2},{value:"Parameters",id:"parameters-114",level:4},{value:"Details",id:"details-67",level:4},{value:"python_bootstrap_binary",id:"python_bootstrap_binary",level:2},{value:"Parameters",id:"parameters-115",level:4},{value:"python_bootstrap_library",id:"python_bootstrap_library",level:2},{value:"Parameters",id:"parameters-116",level:4},{value:"python_library",id:"python_library",level:2},{value:"Parameters",id:"parameters-117",level:4},{value:"Details",id:"details-68",level:4},{value:"python_needed_coverage_test",id:"python_needed_coverage_test",level:2},{value:"Parameters",id:"parameters-118",level:4},{value:"python_test",id:"python_test",level:2},{value:"Parameters",id:"parameters-119",level:4},{value:"Details",id:"details-69",level:4},{value:"python_test_runner",id:"python_test_runner",level:2},{value:"Parameters",id:"parameters-120",level:4},{value:"remote_file",id:"remote_file",level:2},{value:"Parameters",id:"parameters-121",level:4},{value:"Details",id:"details-70",level:4},{value:"robolectric_test",id:"robolectric_test",level:2},{value:"Parameters",id:"parameters-122",level:4},{value:"rust_binary",id:"rust_binary",level:2},{value:"Parameters",id:"parameters-123",level:4},{value:"Details",id:"details-71",level:4},{value:"rust_library",id:"rust_library",level:2},{value:"Parameters",id:"parameters-124",level:4},{value:"Details",id:"details-72",level:4},{value:"rust_test",id:"rust_test",level:2},{value:"Parameters",id:"parameters-125",level:4},{value:"Details",id:"details-73",level:4},{value:"scala_library",id:"scala_library",level:2},{value:"Parameters",id:"parameters-126",level:4},{value:"scala_test",id:"scala_test",level:2},{value:"Parameters",id:"parameters-127",level:4},{value:"scene_kit_assets",id:"scene_kit_assets",level:2},{value:"Parameters",id:"parameters-128",level:4},{value:"sh_binary",id:"sh_binary",level:2},{value:"Parameters",id:"parameters-129",level:4},{value:"Details",id:"details-74",level:4},{value:"sh_test",id:"sh_test",level:2},{value:"Parameters",id:"parameters-130",level:4},{value:"Details",id:"details-75",level:4},{value:"supermodule_target_graph",id:"supermodule_target_graph",level:2},{value:"Parameters",id:"parameters-131",level:4},{value:"swift_library",id:"swift_library",level:2},{value:"Parameters",id:"parameters-132",level:4},{value:"swift_toolchain",id:"swift_toolchain",level:2},{value:"Parameters",id:"parameters-133",level:4},{value:"test_suite",id:"test_suite",level:2},{value:"Parameters",id:"parameters-134",level:4},{value:"Details",id:"details-76",level:4},{value:"toolchain_alias",id:"toolchain_alias",level:2},{value:"Parameters",id:"parameters-135",level:4},{value:"Details",id:"details-77",level:4},{value:"versioned_alias",id:"versioned_alias",level:2},{value:"Parameters",id:"parameters-136",level:4},{value:"windows_resource",id:"windows_resource",level:2},{value:"Parameters",id:"parameters-137",level:4},{value:"Details",id:"details-78",level:4},{value:"worker_tool",id:"worker_tool",level:2},{value:"Parameters",id:"parameters-138",level:4},{value:"Details",id:"details-79",level:4},{value:"zip_file",id:"zip_file",level:2},{value:"Parameters",id:"parameters-139",level:4},{value:"Details",id:"details-80",level:4}],m={toc:d};function p(e){let{components:t,...a}=e;return(0,n.mdx)("wrapper",(0,i.Z)({},m,a,{components:t,mdxType:"MDXLayout"}),(0,n.mdx)("h1",{id:"rules"},"Rules"),(0,n.mdx)("p",null,"These rules are available as standard in Buck2."),(0,n.mdx)("pre",null,(0,n.mdx)("code",{parentName:"pre",className:"language-python"},"def alias(\n *,\n name: str,\n default_target_platform: None | str = _,\n target_compatible_with: list[str] = _,\n compatible_with: list[str] = _,\n exec_compatible_with: list[str] = _,\n visibility: list[str] = _,\n within_view: list[str] = _,\n metadata: opaque_metadata = _,\n tests: list[str] = _,\n _apple_platforms: dict[str, str] = _,\n actual: str,\n buck2_compatibility: str = _,\n contacts: list[str] = _,\n default_host_platform: None | str = _,\n labels: list[str] = _,\n licenses: list[str] = _\n) -> None\n")),(0,n.mdx)("h4",{id:"parameters"},"Parameters"),(0,n.mdx)("ul",null,(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"name"),": name of the target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"default_target_platform"),": specifies the default target platform, used when no platforms are specified on the command line"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"target_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"exec_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with an execution platform"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"visibility"),": a list of visibility patterns restricting what targets can depend on this one"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"within_view"),": a list of visibility patterns restricting what this target can depend on"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"metadata"),": a key-value map of metadata associated with this target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"tests"),": a list of targets that provide tests for this one")),(0,n.mdx)("hr",null),(0,n.mdx)("h2",{id:"android_aar"},"android","_","aar"),(0,n.mdx)("pre",null,(0,n.mdx)("code",{parentName:"pre",className:"language-python"},"def android_aar(\n *,\n name: str,\n default_target_platform: None | str = _,\n target_compatible_with: list[str] = _,\n compatible_with: list[str] = _,\n exec_compatible_with: list[str] = _,\n visibility: list[str] = _,\n within_view: list[str] = _,\n metadata: opaque_metadata = _,\n tests: list[str] = _,\n _android_toolchain: str = _,\n _apple_platforms: dict[str, str] = _,\n _cxx_toolchain: str = _,\n _is_building_android_binary: bool = _,\n _is_force_single_cpu: bool = _,\n _is_force_single_default_cpu: bool = _,\n _java_toolchain: str = _,\n _wip_java_plugin_arguments: dict[str, list[str]] = _,\n abi_generation_mode: None | str = _,\n annotation_processing_tool: None | str = _,\n annotation_processor_deps: list[str] = _,\n annotation_processor_params: list[str] = _,\n annotation_processors: list[str] = _,\n buck2_compatibility: str = _,\n build_config_values: list[str] = _,\n build_config_values_file: None | str = _,\n compress_asset_libraries: bool = _,\n contacts: list[str] = _,\n cpu_filters: list[str] = _,\n default_host_platform: None | str = _,\n deps: list[str] = _,\n enable_relinker: bool = _,\n excluded_java_deps: list[str] = _,\n extra_arguments: list[str] = _,\n extra_kotlinc_arguments: list[str] = _,\n friend_paths: list[str] = _,\n include_build_config_class: bool = _,\n java_version: None | str = _,\n javac: None | str = _,\n kotlin_compiler_plugins: dict[str, dict[str, str]] = _,\n labels: list[str] = _,\n language: None | str = _,\n licenses: list[str] = _,\n manifest: None | str = _,\n manifest_file: None | str = _,\n manifest_skeleton: str,\n maven_coords: None | str = _,\n min_sdk_version: None | int = _,\n native_library_merge_code_generator: None | str = _,\n native_library_merge_glue: None | str = _,\n native_library_merge_linker_args: None | dict[str, list[str]] = _,\n native_library_merge_localized_symbols: None | list[str] = _,\n native_library_merge_map: None | dict[str, list[str]] = _,\n native_library_merge_sequence: None | list[typing.Any] = _,\n native_library_merge_sequence_blocklist: None | list[str] = _,\n never_mark_as_unused_dependency: None | bool = _,\n on_unused_dependencies: None | str = _,\n package_asset_libraries: bool = _,\n plugins: list[str] = _,\n proguard_config: None | str = _,\n relinker_whitelist: list[str] = _,\n remove_classes: list[str] = _,\n required_for_source_only_abi: bool = _,\n resource_union_package: None | str = _,\n resources: list[str] = _,\n resources_root: None | str = _,\n runtime_deps: list[str] = _,\n source: None | str = _,\n source_abi_verification_mode: None | str = _,\n source_only_abi_deps: list[str] = _,\n srcs: list[str] = _,\n strip_libraries: bool = _,\n target: None | str = _,\n use_jvm_abi_gen: None | bool = _\n) -> None\n")),(0,n.mdx)("p",null,"An ",(0,n.mdx)("inlineCode",{parentName:"p"},"android_aar()")," rule is used to generate an Android AAR."),(0,n.mdx)("h4",{id:"parameters-1"},"Parameters"),(0,n.mdx)("ul",null,(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"name"),": name of the target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"default_target_platform"),": specifies the default target platform, used when no platforms are specified on the command line"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"target_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"exec_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with an execution platform"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"visibility"),": a list of visibility patterns restricting what targets can depend on this one"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"within_view"),": a list of visibility patterns restricting what this target can depend on"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"metadata"),": a key-value map of metadata associated with this target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"tests"),": a list of targets that provide tests for this one"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"build_config_values"),": See the documentation on the values argument for ",(0,n.mdx)("inlineCode",{parentName:"li"},"android\\_build\\_config()"),"."),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"include_build_config_class"),": Whether to include the ",(0,n.mdx)("inlineCode",{parentName:"li"},"BuildConfig")," class files in the final .aar file. Needs to be set to ",(0,n.mdx)("inlineCode",{parentName:"li"},"True")," if any build","_","config","_","values are specified. This is normally only needed if the build tool that is consuming the .aar file does not generate ",(0,n.mdx)("inlineCode",{parentName:"li"},"BuildConfig")," classes. Note: the AAR format does not specify a way to pass defaults that should be injected into the final ",(0,n.mdx)("inlineCode",{parentName:"li"},"BuildConfig")," class, therefore that information might need to be replicated manually in the build that's consuming the .aar file."),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"manifest_skeleton"),": The skeleton manifest file used to generate the final ",(0,n.mdx)("inlineCode",{parentName:"li"},"AndroidManifest.xml")," . May either be a file or a ",(0,n.mdx)("inlineCode",{parentName:"li"},"android\\_manifest()"),"target."),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"remove_classes"),": List of classes to remove from the output aar. It removes classes from the target's own sources, and its dependencies.")),(0,n.mdx)("h4",{id:"details"},"Details"),(0,n.mdx)("p",null,"See the ",(0,n.mdx)("a",{parentName:"p",href:"https://developer.android.com/studio/projects/android-library#aar-contents"},"official Android documentation")," for details about the ",(0,n.mdx)("inlineCode",{parentName:"p"},".aar")," format."),(0,n.mdx)("p",null,"Examples:"),(0,n.mdx)("pre",null,(0,n.mdx)("code",{parentName:"pre"},"\nandroid_resource(\n name = 'res',\n res = 'res',\n assets = 'assets',\n package = 'com.example',\n)\n\nandroid_library(\n name = 'lib',\n srcs = glob(['**/*.java']),\n)\n\nandroid_aar(\n name = 'app',\n manifest_skeleton = 'AndroidManifestSkeleton.xml',\n deps = [\n ':res',\n ':lib',\n ],\n)\n\n")),(0,n.mdx)("hr",null),(0,n.mdx)("h2",{id:"android_app_modularity"},"android","_","app","_","modularity"),(0,n.mdx)("pre",null,(0,n.mdx)("code",{parentName:"pre",className:"language-python"},"def android_app_modularity(\n *,\n name: str,\n default_target_platform: None | str = _,\n target_compatible_with: list[str] = _,\n compatible_with: list[str] = _,\n exec_compatible_with: list[str] = _,\n visibility: list[str] = _,\n within_view: list[str] = _,\n metadata: opaque_metadata = _,\n tests: list[str] = _,\n _android_toolchain: str = _,\n _apple_platforms: dict[str, str] = _,\n _build_only_native_code: bool = _,\n application_module_blacklist: None | list[str] = _,\n application_module_configs: dict[str, list[str]] = _,\n application_module_dependencies: None | dict[str, list[str]] = _,\n buck2_compatibility: str = _,\n contacts: list[str] = _,\n default_host_platform: None | str = _,\n deps: list[str] = _,\n labels: list[str] = _,\n licenses: list[str] = _,\n no_dx: list[str] = _,\n should_include_classes: bool = _,\n should_include_libraries: bool = _\n) -> None\n")),(0,n.mdx)("h4",{id:"parameters-2"},"Parameters"),(0,n.mdx)("ul",null,(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"name"),": name of the target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"default_target_platform"),": specifies the default target platform, used when no platforms are specified on the command line"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"target_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"exec_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with an execution platform"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"visibility"),": a list of visibility patterns restricting what targets can depend on this one"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"within_view"),": a list of visibility patterns restricting what this target can depend on"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"metadata"),": a key-value map of metadata associated with this target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"tests"),": a list of targets that provide tests for this one")),(0,n.mdx)("hr",null),(0,n.mdx)("h2",{id:"android_binary"},"android","_","binary"),(0,n.mdx)("pre",null,(0,n.mdx)("code",{parentName:"pre",className:"language-python"},"def android_binary(\n *,\n name: str,\n default_target_platform: None | str = _,\n target_compatible_with: list[str] = _,\n compatible_with: list[str] = _,\n exec_compatible_with: list[str] = _,\n visibility: list[str] = _,\n within_view: list[str] = _,\n metadata: opaque_metadata = _,\n tests: list[str] = _,\n _android_toolchain: str = _,\n _apple_platforms: dict[str, str] = _,\n _cxx_toolchain: str = _,\n _dex_toolchain: str = _,\n _exec_os_type: str = _,\n _is_building_android_binary: bool = _,\n _is_force_single_cpu: bool = _,\n _is_force_single_default_cpu: bool = _,\n _java_toolchain: str = _,\n aapt2_keep_raw_values: bool = _,\n aapt2_locale_filtering: bool = _,\n aapt2_preferred_density: None | str = _,\n aapt_mode: str = _,\n additional_aapt_params: list[str] = _,\n allow_r_dot_java_in_secondary_dex: bool = _,\n allowed_duplicate_resource_types: list[str] = _,\n android_sdk_proguard_config: None | str = _,\n application_module_blacklist: None | list[str] = _,\n application_module_configs: dict[str, list[str]] = _,\n application_module_dependencies: None | dict[str, list[str]] = _,\n asset_compression_algorithm: None | str = _,\n banned_duplicate_resource_types: list[str] = _,\n buck2_compatibility: str = _,\n build_config_values: list[str] = _,\n build_config_values_file: None | str = _,\n build_string_source_map: bool = _,\n compress_asset_libraries: bool = _,\n constraint_overrides: list[str] = _,\n contacts: list[str] = _,\n cpu_filters: list[str] = _,\n default_host_platform: None | str = _,\n deps: list[str] = _,\n dex_compression: None | str = _,\n dex_group_lib_limit: int = _,\n dex_tool: str = _,\n disable_pre_dex: bool = _,\n duplicate_resource_behavior: str = _,\n duplicate_resource_whitelist: None | str = _,\n enable_relinker: bool = _,\n exopackage_modes: list[str] = _,\n extra_filtered_resources: list[str] = _,\n extra_no_compress_asset_extensions: list[str] = _,\n field_ref_count_buffer_space: int = _,\n ignore_aapt_proguard_config: bool = _,\n includes_vector_drawables: bool = _,\n is_cacheable: bool = _,\n is_voltron_language_pack_enabled: bool = _,\n keystore: str,\n labels: list[str] = _,\n licenses: list[str] = _,\n linear_alloc_hard_limit: int = _,\n locales: list[str] = _,\n manifest: None | str = _,\n manifest_entries: dict[str, typing.Any] = _,\n manifest_skeleton: None | str = _,\n method_ref_count_buffer_space: int = _,\n min_sdk_version: None | int = _,\n minimize_primary_dex_size: bool = _,\n module_manifest_skeleton: None | str = _,\n native_library_merge_code_generator: None | str = _,\n native_library_merge_glue: None | str = _,\n native_library_merge_linker_args: None | dict[str, list[str]] = _,\n native_library_merge_localized_symbols: None | list[str] = _,\n native_library_merge_map: None | dict[str, list[str]] = _,\n native_library_merge_sequence: None | list[typing.Any] = _,\n native_library_merge_sequence_blocklist: None | list[str] = _,\n no_auto_add_overlay_resources: bool = _,\n no_auto_version_resources: bool = _,\n no_dx: list[str] = _,\n no_version_transitions_resources: bool = _,\n optimization_passes: int = _,\n package_asset_libraries: bool = _,\n package_type: str = _,\n packaged_locales: list[str] = _,\n packaging_options: dict[str, list[str]] = _,\n post_filter_resources_cmd: None | str = _,\n preprocess_java_classes_bash: None | str = _,\n preprocess_java_classes_cmd: None | str = _,\n preprocess_java_classes_deps: list[str] = _,\n primary_dex_patterns: list[str] = _,\n proguard_config: None | str = _,\n proguard_jvm_args: list[str] = _,\n relinker_whitelist: list[str] = _,\n resource_compression: str = _,\n resource_filter: list[str] = _,\n resource_stable_ids: None | str = _,\n resource_union_package: None | str = _,\n secondary_dex_weight_limit: None | int = _,\n skip_crunch_pngs: None | bool = _,\n skip_proguard: bool = _,\n strip_libraries: bool = _,\n trim_resource_ids: bool = _,\n use_split_dex: bool = _,\n validation_deps: list[str] = _,\n xz_compression_level: int = _\n) -> None\n")),(0,n.mdx)("h4",{id:"parameters-3"},"Parameters"),(0,n.mdx)("ul",null,(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"name"),": name of the target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"default_target_platform"),": specifies the default target platform, used when no platforms are specified on the command line"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"target_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"exec_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with an execution platform"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"visibility"),": a list of visibility patterns restricting what targets can depend on this one"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"within_view"),": a list of visibility patterns restricting what this target can depend on"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"metadata"),": a key-value map of metadata associated with this target"),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("inlineCode",{parentName:"li"},"tests"),": a list of targets that provide tests for this one")),(0,n.mdx)("hr",null),(0,n.mdx)("h2",{id:"android_build_config"},"android","_","build","_","config"),(0,n.mdx)("pre",null,(0,n.mdx)("code",{parentName:"pre",className:"language-python"},"def android_build_config(\n *,\n name: str,\n default_target_platform: None | str = _,\n target_compatible_with: list[str] = _,\n compatible_with: list[str] = _,\n exec_compatible_with: list[str] = _,\n visibility: list[str] = _,\n within_view: list[str] = _,\n metadata: opaque_metadata = _,\n tests: list[str] = _,\n _android_toolchain: str = _,\n _apple_platforms: dict[str, str] = _,\n _build_only_native_code: bool = _,\n _is_building_android_binary: bool = _,\n _java_toolchain: str = _,\n buck2_compatibility: str = _,\n contacts: list[str] = _,\n default_host_platform: None | str = _,\n labels: list[str] = _,\n licenses: list[str] = _,\n package: str = _,\n values: list[str] = _,\n values_file: None | str = _\n) -> None\n")),(0,n.mdx)("p",null,"An ",(0,n.mdx)("inlineCode",{parentName:"p"},"android_build_config()")," rule is used to generate a ",(0,n.mdx)("inlineCode",{parentName:"p"},"BuildConfig")," class with global configuration variables that other ",(0,n.mdx)("inlineCode",{parentName:"p"},"android\\_library()"),"rules can compile against. Currently, the only variable exposed by ",(0,n.mdx)("inlineCode",{parentName:"p"},"BuildConfig")," is a global ",(0,n.mdx)("inlineCode",{parentName:"p"},"boolean")," named ",(0,n.mdx)("inlineCode",{parentName:"p"},"DEBUG"),", much like the ",(0,n.mdx)("inlineCode",{parentName:"p"},"BuildConfig.java")," generated by the official Android build tools based on Gradle."),(0,n.mdx)("h4",{id:"parameters-4"},"Parameters"),(0,n.mdx)("ul",null,(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"name"),": name of the target")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"default_target_platform"),": specifies the default target platform, used when no platforms are specified on the command line")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"target_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with a configuration")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"exec_compatible_with"),": a list of constraints that are required to be satisfied for this target to be compatible with an execution platform")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"visibility"),": a list of visibility patterns restricting what targets can depend on this one")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"within_view"),": a list of visibility patterns restricting what this target can depend on")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"metadata"),": a key-value map of metadata associated with this target")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"tests"),": a list of targets that provide tests for this one")),(0,n.mdx)("li",{parentName:"ul"},(0,n.mdx)("p",{parentName:"li"},(0,n.mdx)("inlineCode",{parentName:"p"},"package"),": Name of the Java package to use in the generated ",(0,n.mdx)("inlineCode",{parentName:"p"},"BuildConfig.java")," file. Most developers set this to the application id declared in the manifest via ",(0,n.mdx)("inlineCode",{parentName:"p"},'