android_bundle
Function Signature
def android_bundle(
*,
name: str,
default_target_platform: None | str = None,
target_compatible_with: list[str] = [],
compatible_with: list[str] = [],
exec_compatible_with: list[str] = [],
visibility: list[str] = [],
within_view: list[str] = ["PUBLIC"],
metadata: OpaqueMetadata = {},
tests: list[str] = [],
modifiers: OpaqueMetadata = [],
_android_toolchain: str = "gh_facebook_buck2_shims_meta//:android",
_apple_platforms: dict[str, str] = {},
_cxx_toolchain: str = gh_facebook_buck2_shims_meta//:android-hack,
_dex_toolchain: str = "gh_facebook_buck2_shims_meta//:dex",
_exec_os_type: str = "prelude//os_lookup/targets:os_lookup",
_is_building_android_binary: bool = True,
_is_force_single_cpu: bool = False,
_is_force_single_default_cpu: bool = False,
_java_toolchain: str = "gh_facebook_buck2_shims_meta//:java_for_android",
aapt2_keep_raw_values: bool = False,
aapt2_locale_filtering: bool = False,
aapt2_preferred_density: None | str = None,
additional_aapt_params: list[str] = [],
allow_r_dot_java_in_secondary_dex: bool = False,
allowed_duplicate_resource_types: list[str] = [],
android_sdk_proguard_config: None | str = None,
application_module_blocklist: None | list[str | (str, str)] = None,
application_module_configs: dict[str, list[str | (str, str)]] = {},
application_module_dependencies: None | dict[str, list[str]] = None,
asset_compression_algorithm: None | str = None,
banned_duplicate_resource_types: list[str] = [],
build_config_values: list[str] = [],
build_config_values_file: None | str | (str, str) = None,
build_string_source_map: bool = False,
bundle_config_file: None | str = None,
compiled_resource_apks: list[str] = [],
compress_asset_libraries: bool = False,
contacts: list[str] = [],
cpu_filters: list[str] = [],
default_module_manifest_skeleton: None | str | (str, str) = None,
defer_relink: bool = False,
deps: list[str] = [],
dex_compression: None | str = None,
disable_pre_dex: bool = False,
duplicate_class_checker_enabled: bool = False,
duplicate_resource_behavior: str = "allow_by_default",
duplicate_resource_whitelist: None | str = None,
enable_bootstrap_dexes: bool = False,
enable_relinker: bool = False,
exclude_duplicate_targets_do_not_use: list[str] = [],
exopackage_modes: list[str] = [],
extra_filtered_resources: list[str] = [],
extra_no_compress_asset_extensions: list[str] = [],
extra_no_compress_asset_regex: None | str = None,
extra_relinker_outputs: list[str] = [],
ignore_aapt_proguard_config: bool = False,
includes_vector_drawables: bool = False,
is_cacheable: bool = False,
is_voltron_language_pack_enabled: bool = False,
keystore: str,
labels: list[str] = [],
licenses: list[str] = [],
locales: list[str] = [],
manifest: None | str | (str, str) = None,
manifest_entries: dict[str, typing.Any] = {},
manifest_skeleton: None | str | (str, str) = None,
min_sdk_version: None | int = None,
minimize_primary_dex_size: bool = False,
module_manifest_skeleton: dict[str, str | (str, str)] = {},
module_manifests: None | str | (str, str) = None,
multidex_min_api: None | str = None,
native_library_bolt_args: None | dict[str, list[str]] = None,
native_library_merge_code_generator: None | str = None,
native_library_merge_glue: None | str = None,
native_library_merge_linker_args: None | dict[str, list[str]] = None,
native_library_merge_linker_args_all: list[str] = [],
native_library_merge_map: None | dict[str, list[str]] = None,
native_library_merge_non_asset_libs: bool = False,
native_library_merge_sequence: None | list[list[(str, list[str])] | (str, list[str])] = None,
native_library_merge_sequence_blocklist: None | list[str] = None,
native_library_pick_first: list[str] = [],
no_dx: list[str] = [],
optimization_passes: int = 1,
package_asset_libraries: bool = False,
package_type: str = "debug",
package_validators: list[(str, list[str])] = [],
package_voltron_asset_libraries: bool = False,
packaged_locales: list[str] = [],
packaging_options: dict[str, list[str]] = {},
post_filter_resources_cmd: None | str = None,
preprocess_java_classes_bash: None | str = None,
preprocess_java_classes_cmd: None | str = None,
preprocess_java_classes_deps: list[str] = [],
primary_dex_patterns: list[str] = [],
proguard_config: None | str = None,
proguard_jvm_args: list[str] = [],
relinker_extra_args: dict[str, list[str]] = {},
relinker_extra_args_all: list[str] = [],
relinker_extra_deps: list[str] = [],
relinker_whitelist: list[str] = [],
resource_compression: str = "disabled",
resource_filter: list[str] = [],
resource_stable_ids: None | str = None,
resource_union_package: None | str = None,
secondary_dex_weight_limit: None | int = None,
shared_libraries_to_exclude: list[str] = [],
skip_crunch_pngs: None | bool = None,
skip_proguard: bool = False,
trim_resource_ids: bool = False,
use_derived_apk: bool = False,
use_split_dex: bool = False,
validation_deps: list[str | (str, str)] = [],
xz_compression_level: int = 4,
) -> None
Parameters
-
name: (required)name of the target
-
default_target_platform: (defaults to:None)specifies the default target platform, used when no platforms are specified on the command line
-
target_compatible_with: (defaults to:[])a list of constraints that are required to be satisfied for this target to be compatible with a configuration
-
compatible_with: (defaults to:[])a list of constraints that are required to be satisfied for this target to be compatible with a configuration
-
exec_compatible_with: (defaults to:[])a list of constraints that are required to be satisfied for this target to be compatible with an execution platform
-
visibility: (defaults to:[])a list of visibility patterns restricting what targets can depend on this one
-
within_view: (defaults to:["PUBLIC"])a list of visibility patterns restricting what this target can depend on
-
metadata: (defaults to:{})a key-value map of metadata associated with this target
-
tests: (defaults to:[])a list of targets that provide tests for this one
-
modifiers: (defaults to:[])an array of modifiers associated with this target
-
allowed_duplicate_resource_types: (defaults to:[])Similar to banned_duplicate_resource_types, but lists the types that are allowed to have duplicates. This should only be used if duplicate_resource_behavior is 'ban_by_default'.
-
android_sdk_proguard_config: (defaults to:None)The type of proguard configuration to use from the Android SDK. Options are 'default' to use the default config, 'optimized' to use the config with optimizations enabled, or 'none' to not use any standard configuration (you will need to supply your own version, otherwise your app will probably not work).
-
application_module_configs: (defaults to:{})A map of module names to lists of targets, where the targets should seed the corresponding module. The seed targets and their exclusive dependencies are packaged into the APK in separate files to allow them to be loaded independently.
-
banned_duplicate_resource_types: (defaults to:[])If ['string'] is used, the build will break if multiple string resources with the same name are added in an app's Android Resources. Resource names are name-spaced by resource type, this does not enforce unique names between multiple resource types. AAPT does not enforce this, but you can prevent easy-to-introduce resource bugs by enabling this.
-
build_config_values: (defaults to:[])See the documentation on the values argument for android_build_config().
-
build_config_values_file: (defaults to:None)See the documentation on the values_file argument for android_build_config().
-
contacts: (defaults to:[])A list of organizational contacts for this rule. These could be individuals who you would contact in the event of a failure or other issue with the rule.
contacts = [ 'Joe Sixpack', 'Erika Mustermann' ] -
cpu_filters: (defaults to:[])The CPU architecture filter applied to the final apk. Could be a subset of ARM, ARMV7, ARM64, X86, X86_64, MIPS. Note: If you set this parameter, you must setup your NDK, otherwise Buck build will fail.
-
deps: (defaults to:[])List of build targets whose corresponding compiled Java code, Android resources, and native libraries will be included in the APK. From the transitive closure of these dependencies, the outputs of rules of the following type will be included in the APK: android_library(), android_resource(), cxx_library(), groovy_library(), java_library(), java_binary(), prebuilt_jar(), prebuilt_native_library().
-
duplicate_resource_behavior: (defaults to:"allow_by_default")If set to 'ban_by_default', duplicate resource definitions with the same type and name will cause the build to fail, unless they are excluded by allowed_duplicate_resource_types or duplicate_resource_whitelist. If set to 'allow_by_default' (the default), no duplicate resource checks will be performed. They can still be enabled on individual types by using banned_duplicate_resource_types.
-
duplicate_resource_whitelist: (defaults to:None)Either a build target or a path to a file containing a whitelist of resources that should be excluded from duplicate resource detection. Format is one resource per line with the type followed by the name, separated by a space. For example, 'string app_name'.
-
ignore_aapt_proguard_config: (defaults to:False)If true, the proguard config automatically generated by aapt will be ignored.
-
includes_vector_drawables: (defaults to:False)When calling AAPT during the packaging process, pass the --no-version-vectors flag which ensures that any vector drawables which make use of the Android support library are backwards compatible with Android 4.4 and earlier.
-
keystore: (required)A build target that identifies a keystore to use to sign the APK.
-
labels: (defaults to:[])Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using
buck query(). -
licenses: (defaults to:[])Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use buck query
-
manifest_entries: (defaults to:{})Insert values into the packaged AndroidManifest.xml file. Valid values are min_sdk_version, target_sdk_version, version_code, version_name, and debug_mode.
-
native_library_merge_linker_args_all: (defaults to:[])Extra linker arguments passed to all merged libraries.
-
native_library_merge_map: (defaults to:None)An advanced option for apps with many native libraries.
-
no_dx: (defaults to:[])List of dependency targets whose Java code should be excluded from the DEX files in the final APK. The classes from these targets will not be dexed, but their other resources will still be included. This might be useful to resolve duplicate class errors when multiple dependencies provide the same class. See this document for how to resolve duplicate classes using this attribute.
-
package_type: (defaults to:"debug")Determines whether ProGuard will be used when packaging the APK. Acceptable values for package_type are 'debug' and 'release'. The default value is 'debug', which indicates that ProGuard should not be used.
-
package_voltron_asset_libraries: (defaults to:False)Similar global flag as package_asset_libraries to control voltron module libs specifically.
-
proguard_config: (defaults to:None)Relative path to a ProGuard configuration file that will be passed via the -include flag when package_type is 'release'.
-
relinker_extra_args: (defaults to:{})Per-library extra linker arguments passed when relinking, mapping sonames to lists of arguments.
-
relinker_extra_args_all: (defaults to:[])Extra arguments passed when relinking all libraries.
-
relinker_extra_deps: (defaults to:[])Deps statically linked to every native lib by the relinker.
-
skip_crunch_pngs: (defaults to:None)If True, PNGs in the APK are not crushed by aapt.
-
skip_proguard: (defaults to:False)To produce a release build without running ProGuard set the skip_proguard flag to True. This will still cause ProGuard configuration files to be generated for use by other optimizers like Redex.
-
use_split_dex: (defaults to:False)If this argument is True, Buck enables multidex support for the output APK. Multidex support enables your app to use multiple Dalvik Executable (DEX) bytecode files and thereby work around the 64K limit on the number of methods that can be referenced in a single DEX file.