android_app
android_app compiles sources and Android resources into an Android application package `.apk` file.
name
,
srcs
,
exclude_srcs
,
defaults
,
aapt_include_all_resources
,
aaptflags
,
aconfig_Cache_files
,
additional_certificates
,
additional_manifests
,
aidl
,
apex_available
,
arch
,
asset_dirs
,
assets
,
certificate
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dont_merge_manifests
,
dxflags
,
embed_notices
,
enabled
,
enforce_default_target_sdk_version
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
export_package_resources
,
exported_plugins
,
flags_packages
,
generate_product_characteristics_rro
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
jni_uses_platform_apis
,
jni_uses_sdk_apis
,
kotlincflags
,
libs
,
licenses
,
lineage
,
lint
,
logging_parent
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
overrides
,
owner
,
package_name
,
package_splits
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
privapp_allowlist
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
rename_resources_package
,
replace_max_sdk_version_placeholder
,
required
,
resource_dirs
,
resource_zips
,
rotationMinSdkVersion
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
stl
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_only
,
uncompress_dex
,
updatable
,
use_embedded_dex
,
use_embedded_native_libs
,
use_resource_processor
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aapt_include_all_resources
bool, include all resource configurations, not just the product-configured
ones.
aaptflags
list of string, flags passed to aapt when creating the apk
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
additional_certificates
list of string, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
additional_manifests
list of string, paths to additional manifest files to merge with main manifest.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
asset_dirs
list of string, list of directories relative to the Blueprints file containing assets.
Defaults to ["assets"] if a directory called assets exists. Set to []
to disable the default.
assets
list of string, list of files to use as assets.
certificate
string, The name of a certificate in the default certificate directory, blank to use the default product certificate,
or an android_app_certificate module name in the form ":module".
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
dxflags
list of string, list of module-specific flags that will be used for dex compiles
embed_notices
bool, If set, find and merge all NOTICE files that this module and its dependencies have and store
it in the APK as an asset.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_default_target_sdk_version
bool, It can be set to test the behaviour of default target sdk version.
Only required when updatable: false. It is an error if updatable: true and this is false.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
extra_check_modules
list of string, List of java_plugin modules that provide extra errorprone checks.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
export_package_resources
bool, If set, create package-export.apk, which other packages can
use to get PRODUCT-agnostic resource data like IDs and type definitions.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
flags_packages
list of string, Names of aconfig_declarations modules that specify aconfig flags that the module depends on.
generate_product_characteristics_rro
bool, If set, create an RRO package which contains only resources having PRODUCT_CHARACTERISTICS
and install the RRO package to /product partition, instead of passing --product argument
to aapt2. Default is false.
Setting this will make this APK identical to all targets, regardless of
PRODUCT_CHARACTERISTICS.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
headers_only
bool, If true, then only the headers are built and not the implementation jar.
⊕hidden_api
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, list of native libraries that will be provided in or alongside the resulting jar
jni_uses_platform_apis
bool, if true, use JNI libraries that link against platform APIs even if this module sets
sdk_version.
jni_uses_sdk_apis
bool, if true, use JNI libraries that link against SDK APIs even if this module does not set
sdk_version.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
extra_check_modules
list of string, Modules that provide extra lint checks
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
logging_parent
string, the logging parent of this app.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, path to AndroidManifest.xml. If unset, defaults to "AndroidManifest.xml".
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
Default: false
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
Default: true
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
package_splits
list of string, list of resource labels to generate individual resource packages
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
privapp_allowlist
string, Specifies the file that contains the allowlist for this app.
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
rename_resources_package
bool, Whether to rename the package in resources to the override name rather than the base name. Defaults to true.
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
resource_dirs
list of string, list of directories relative to the Blueprints file containing
Android resources. Defaults to ["res"] if a directory called res exists.
Set to [] to disable the default.
resource_zips
list of string, list of zip files containing Android resources.
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
stl
string, STL library to use for JNI libraries.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_only
bool, Indicates that the module and its source code are only used in tests, not
production code. Used by coverage reports and potentially other tools.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
updatable
bool, Whether this app is considered mainline updatable or not. When set to true, this will enforce
additional rules to make sure an app can safely be updated. Default is false.
Prefer using other specific properties if build behaviour must be changed; avoid using this
flag for anything but neverallow rules (unless the behaviour change is invisible to owners).
use_embedded_dex
bool, Store dex files uncompressed in the APK and set the android:useEmbeddedDex="true" manifest attribute so that
they are used from inside the APK at runtime.
use_embedded_native_libs
bool, Store native libraries uncompressed in the APK and set the android:extractNativeLibs="false" manifest
flag so that they are used from inside the APK at runtime. Defaults to true for android_test modules unless
sdk_version or min_sdk_version is set to a version that doesn't support it (<23), defaults to true for
android_app modules that are embedded to APEXes, defaults to false for other module types where the native
libraries are generally preinstalled outside the APK.
use_resource_processor
bool, If use_resource_processor is set, use Bazel's resource processor instead of aapt2 to generate R.class files.
The resource processor produces more optimal R.class files that only list resources in the package of the
library that provided them, as opposed to aapt2 which produces R.java files for every package containing
every resource. Using the resource processor can provide significant build time speedups, but requires
fixing the module to use the correct package to reference each resource, and to avoid having any other
libraries in the tree that use the same package name. Defaults to false, but will default to true in the
future.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_app_certificate
android_app_certificate modules can be referenced by the certificates property of android_app modules to select
the signing key.
name
,
certificate
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
certificate
string, Name of the certificate files. Extensions .x509.pem and .pk8 will be added to the name.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_app_import
android_app_import imports a prebuilt apk with additional processing specified in the module.
DPI-specific apk source files can be specified using dpi_variants. Example:
android_app_import {
name: "example_import",
apk: "prebuilts/example.apk",
dpi_variants: {
mdpi: {
apk: "prebuilts/example_mdpi.apk",
},
xhdpi: {
apk: "prebuilts/example_xhdpi.apk",
},
},
presigned: true,
}
name
,
defaults
,
additional_certificates
,
apex_available
,
apk
,
arch
,
certificate
,
compile_multilib
,
debug_ramdisk
,
default_dev_cert
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dpi_variants.hdpi
,
dpi_variants.ldpi
,
dpi_variants.mdpi
,
dpi_variants.xhdpi
,
dpi_variants.xxhdpi
,
dpi_variants.xxxhdpi
,
enabled
,
enforce_uses_libs
,
exclude_uses_libs
,
export_package_resources
,
filename
,
host_required
,
init_rc
,
licenses
,
lineage
,
multilib
,
native_bridge_supported
,
optional_uses_libs
,
overrides
,
owner
,
prebuilt_info
,
prefer
,
preprocessed
,
presigned
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
provides_uses_lib
,
ramdisk
,
recovery
,
relative_install_path
,
required
,
rotationMinSdkVersion
,
skip_preprocessed_apk_checks
,
soc_specific
,
source_module_name
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
additional_certificates
list of string, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
apk
string, A prebuilt apk to import
⊕arch
⊕arm
*java.AndroidAppImportProperties
⊕arm64
*java.AndroidAppImportProperties
⊕riscv64
*java.AndroidAppImportProperties
⊕x86
*java.AndroidAppImportProperties
⊕x86_64
*java.AndroidAppImportProperties
*struct { Arm *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; Arm64 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; Riscv64 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; X86 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; X86_64 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } } }
certificate
string, The name of a certificate in the default certificate directory or an android_app_certificate
module name in the form ":module". Should be empty if presigned or default_dev_cert is set.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
default_dev_cert
bool, Sign with the default system dev certificate. Must be used judiciously. Most imported apps
need to either specify a specific certificate or be presigned.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
⊕dpi_variants.hdpi
*java.AndroidAppImportProperties
⊕dpi_variants.ldpi
*java.AndroidAppImportProperties
⊕dpi_variants.mdpi
*java.AndroidAppImportProperties
⊕dpi_variants.xhdpi
*java.AndroidAppImportProperties
⊕dpi_variants.xxhdpi
*java.AndroidAppImportProperties
⊕dpi_variants.xxxhdpi
*java.AndroidAppImportProperties
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
export_package_resources
bool, If set, create package-export.apk, which other packages can
use to get PRODUCT-agnostic resource data like IDs and type definitions.
filename
string, Optional name for the installed app. If unspecified, it is derived from the module name.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
prebuilt_info
string, Path to the .prebuilt_info file of the prebuilt app.
In case of mainline modules, the .prebuilt_info file contains the build_id that was used
to generate the prebuilt.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
preprocessed
bool, Whether the prebuilt apk can be installed without additional processing. Default is false.
presigned
bool, Set this flag to true if the prebuilt apk is already signed. The certificate property must not
be set for presigned modules.
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
relative_install_path
string, Optional. Install to a subdirectory of the default install path for the module
required
list of string, names of other modules to install if this module is installed
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
skip_preprocessed_apk_checks
bool, Whether or not to skip checking the preprocessed apk for proper alignment and uncompressed
JNI libs and dex files. Default is false
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_app_set
android_app_set extracts a set of APKs based on the target device
configuration and installs this set as "split APKs".
The extracted set always contains an APK whose name is
_module_name_.apk and every split APK matching target device.
The extraction of the density-specific splits depends on
PRODUCT_AAPT_PREBUILT_DPI variable. If present (its value should
be a list density names: LDPI, MDPI, HDPI, etc.), only listed
splits will be extracted. Otherwise all density-specific splits
will be extracted.
name
,
defaults
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
overrides
,
owner
,
prebuilt_info
,
prefer
,
prerelease
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
set
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
overrides
list of string, Names of modules to be overridden. Listed modules can only be other apps
(in Make or Soong).
owner
string, vendor who owns this module
prebuilt_info
string, Path to the .prebuilt_info file of the prebuilt app.
In case of mainline modules, the .prebuilt_info file contains the build_id that was used
to generate the prebuilt.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
prerelease
bool, APKs in this set use prerelease SDK version
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
set
string, APK Set path
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_library
android_library builds and links sources into a `.jar` file for the device along with Android resources.
An android_library has a single variant that produces a `.jar` file containing `.class` files that were
compiled against the device bootclasspath, along with a `package-res.apk` file containing Android resources compiled
with aapt2. This module is not suitable for installing on a device, but can be used as a `static_libs` dependency of
an android_app module.
name
,
srcs
,
exclude_srcs
,
defaults
,
aapt_include_all_resources
,
aaptflags
,
aconfig_Cache_files
,
additional_manifests
,
aidl
,
apex_available
,
arch
,
asset_dirs
,
assets
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dont_merge_manifests
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
flags_packages
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
resource_dirs
,
resource_zips
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_only
,
uncompress_dex
,
use_resource_processor
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aapt_include_all_resources
bool, include all resource configurations, not just the product-configured
ones.
aaptflags
list of string, flags passed to aapt when creating the apk
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
additional_manifests
list of string, paths to additional manifest files to merge with main manifest.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
asset_dirs
list of string, list of directories relative to the Blueprints file containing assets.
Defaults to ["assets"] if a directory called assets exists. Set to []
to disable the default.
assets
list of string, list of files to use as assets.
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
extra_check_modules
list of string, List of java_plugin modules that provide extra errorprone checks.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
flags_packages
list of string, Names of aconfig_declarations modules that specify aconfig flags that the module depends on.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
headers_only
bool, If true, then only the headers are built and not the implementation jar.
⊕hidden_api
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
extra_check_modules
list of string, Modules that provide extra lint checks
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
resource_dirs
list of string, list of directories relative to the Blueprints file containing
Android resources. Defaults to ["res"] if a directory called res exists.
Set to [] to disable the default.
resource_zips
list of string, list of zip files containing Android resources.
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_only
bool, Indicates that the module and its source code are only used in tests, not
production code. Used by coverage reports and potentially other tools.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_resource_processor
bool, If use_resource_processor is set, use Bazel's resource processor instead of aapt2 to generate R.class files.
The resource processor produces more optimal R.class files that only list resources in the package of the
library that provided them, as opposed to aapt2 which produces R.java files for every package containing
every resource. Using the resource processor can provide significant build time speedups, but requires
fixing the module to use the correct package to reference each resource, and to avoid having any other
libraries in the tree that use the same package name. Defaults to false, but will default to true in the
future.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_library_import
android_library_import imports an `.aar` file into the build graph as if it was built with android_library.
This module is not suitable for installing on a device, but can be used as a `static_libs` dependency of
an android_app module.
name
,
defaults
,
aars
,
apex_available
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
exclude_uses_libs
,
extract_jni
,
host_required
,
init_rc
,
jetifier
,
libs
,
licenses
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
optional_uses_libs
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.unbundled_build
,
proprietary
,
provides_uses_lib
,
ramdisk
,
recovery
,
required
,
sdk_version
,
soc_specific
,
static_libs
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
aars
list of string, ARR (android library prebuilt) filepath. Exactly one ARR is required.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
extract_jni
bool, If true, extract JNI libs from AAR archive. These libs will be accessible to android_app modules and
will be passed transitively through android_libraries to an android_app.
TODO(b/241138093) evaluate whether we can have this flag default to true for Bazel conversion
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
jetifier
bool, If set to true, run Jetifier against .aar file. Defaults to false.
libs
list of string, List of java libraries that the included ARR (android library prebuilts) has dependencies to.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
min_sdk_version
string, If not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕product_variables.malloc_not_svelte
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to private.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
list of string, List of java static libraries that the included ARR (android library prebuilts) has dependencies to.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_ravenwood_libgroup
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
jni_libs
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
jni_libs
list of string
libs
list of string
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_ravenwood_test
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
aidl
,
arch
,
auto_gen_config
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
data
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
extra_check_modules
list of string, List of java_plugin modules that provide extra errorprone checks.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
headers_only
bool, If true, then only the headers are built and not the implementation jar.
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
extra_check_modules
list of string, Modules that provide extra lint checks
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
Default: true
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
TestOptions
Test options.
extra_test_configs
list of string, a list of extra test configuration files that should be installed with the module.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
Default: false
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
Default: [general-tests ravenwood-tests]
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_robolectric_runtimes
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
jars
,
lib
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
jars
list of string
lib
string
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_robolectric_test
An android_robolectric_test module compiles tests against the Robolectric framework that can run on the local host
instead of on a device. It also generates a rule with the name of the module prefixed with "Run" that can be
used to run the tests. Running the tests with build rule will eventually be deprecated and replaced with atest.
The test runner considers any file listed in srcs whose name ends with Test.java to be a test class, unless
it is named BaseRobolectricTest.java. The path to the each source file must exactly match the package
name, or match the package name when the prefix "src/" is removed.
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
aidl
,
arch
,
auto_gen_config
,
common_srcs
,
compile_data
,
compile_multilib
,
coverage_libs
,
data
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
instrumentation_for
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optional_uses_libs
,
owner
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
robolectric_prebuilt_version
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
upstream
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
coverage_libs
list of string, Additional libraries for which coverage data should be generated
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
extra_check_modules
list of string, List of java_plugin modules that provide extra errorprone checks.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
headers_only
bool, If true, then only the headers are built and not the implementation jar.
⊕hidden_api
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
instrumentation_for
string, The name of the android_app module that the tests will run against.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the test.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
robolectric_prebuilt_version
string, The version number of a robolectric prebuilt to use from prebuilts/misc/common/robolectric
instead of the one built from source in external/robolectric-shadows.
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
timeout
int64, Timeout in seconds when running the tests.
shards
int64, Number of shards to use when running the tests.
extra_test_configs
list of string, a list of extra test configuration files that should be installed with the module.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
Default: [robolectric-tests]
upstream
bool, Use /external/robolectric rather than /external/robolectric-shadows as the version of robolectric
to use. /external/robolectric closely tracks github's master, and will fully replace /external/robolectric-shadows
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_test
android_test compiles test sources and Android resources into an Android application package `.apk` file and
creates an `AndroidTest.xml` file to allow running the test with `atest` or a `TEST_MAPPING` file.
name
,
srcs
,
exclude_srcs
,
defaults
,
aapt_include_all_resources
,
aaptflags
,
aconfig_Cache_files
,
additional_certificates
,
additional_manifests
,
aidl
,
arch
,
asset_dirs
,
assets
,
auto_gen_config
,
certificate
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
data
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dont_merge_manifests
,
dxflags
,
embed_notices
,
enabled
,
enforce_default_target_sdk_version
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
export_package_resources
,
exported_plugins
,
flags_packages
,
generate_product_characteristics_rro
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
instrumentation_for
,
instrumentation_target_package
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
jni_uses_platform_apis
,
jni_uses_sdk_apis
,
kotlincflags
,
libs
,
licenses
,
lineage
,
lint
,
logging_parent
,
main_dex_rules
,
mainline_package_name
,
manifest
,
manifest_values
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
overrides
,
owner
,
package_name
,
package_splits
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
privapp_allowlist
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
rename_resources_package
,
replace_max_sdk_version_placeholder
,
required
,
resource_dirs
,
resource_zips
,
rotationMinSdkVersion
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
stl
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
uncompress_dex
,
updatable
,
use_embedded_dex
,
use_embedded_native_libs
,
use_resource_processor
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aapt_include_all_resources
bool, include all resource configurations, not just the product-configured
ones.
aaptflags
list of string, flags passed to aapt when creating the apk
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
additional_certificates
list of string, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
additional_manifests
list of string, paths to additional manifest files to merge with main manifest.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
asset_dirs
list of string, list of directories relative to the Blueprints file containing assets.
Defaults to ["assets"] if a directory called assets exists. Set to []
to disable the default.
assets
list of string, list of files to use as assets.
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
certificate
string, The name of a certificate in the default certificate directory, blank to use the default product certificate,
or an android_app_certificate module name in the form ":module".
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
dxflags
list of string, list of module-specific flags that will be used for dex compiles
embed_notices
bool, If set, find and merge all NOTICE files that this module and its dependencies have and store
it in the APK as an asset.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_default_target_sdk_version
bool, It can be set to test the behaviour of default target sdk version.
Only required when updatable: false. It is an error if updatable: true and this is false.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
extra_check_modules
list of string, List of java_plugin modules that provide extra errorprone checks.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
export_package_resources
bool, If set, create package-export.apk, which other packages can
use to get PRODUCT-agnostic resource data like IDs and type definitions.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
flags_packages
list of string, Names of aconfig_declarations modules that specify aconfig flags that the module depends on.
generate_product_characteristics_rro
bool, If set, create an RRO package which contains only resources having PRODUCT_CHARACTERISTICS
and install the RRO package to /product partition, instead of passing --product argument
to aapt2. Default is false.
Setting this will make this APK identical to all targets, regardless of
PRODUCT_CHARACTERISTICS.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
headers_only
bool, If true, then only the headers are built and not the implementation jar.
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
instrumentation_for
string, The name of the android_app module that the tests will run against.
instrumentation_target_package
string, If specified, the instrumentation target package name in the manifest is overwritten by it.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the test.
jni_uses_platform_apis
bool, if true, use JNI libraries that link against platform APIs even if this module sets
sdk_version.
jni_uses_sdk_apis
bool, if true, use JNI libraries that link against SDK APIs even if this module does not set
sdk_version.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
extra_check_modules
list of string, Modules that provide extra lint checks
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
Default: true
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
logging_parent
string, the logging parent of this app.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
mainline_package_name
string, If specified, the mainline module package name in the test config is overwritten by it.
manifest
string, path to AndroidManifest.xml. If unset, defaults to "AndroidManifest.xml".
⊕manifest_values
Manifest_values
applicationId
string, Overrides the value of package_name in the manifest
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
package_splits
list of string, list of resource labels to generate individual resource packages
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
privapp_allowlist
string, Specifies the file that contains the allowlist for this app.
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
rename_resources_package
bool, Whether to rename the package in resources to the override name rather than the base name. Defaults to true.
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
resource_dirs
list of string, list of directories relative to the Blueprints file containing
Android resources. Defaults to ["res"] if a directory called res exists.
Set to [] to disable the default.
resource_zips
list of string, list of zip files containing Android resources.
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
stl
string, STL library to use for JNI libraries.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
TestOptions
Test options.
extra_test_configs
list of string, a list of extra test configuration files that should be installed with the module.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
updatable
bool, Whether this app is considered mainline updatable or not. When set to true, this will enforce
additional rules to make sure an app can safely be updated. Default is false.
Prefer using other specific properties if build behaviour must be changed; avoid using this
flag for anything but neverallow rules (unless the behaviour change is invisible to owners).
use_embedded_dex
bool, Store dex files uncompressed in the APK and set the android:useEmbeddedDex="true" manifest attribute so that
they are used from inside the APK at runtime.
use_embedded_native_libs
bool, Store native libraries uncompressed in the APK and set the android:extractNativeLibs="false" manifest
flag so that they are used from inside the APK at runtime. Defaults to true for android_test modules unless
sdk_version or min_sdk_version is set to a version that doesn't support it (<23), defaults to true for
android_app modules that are embedded to APEXes, defaults to false for other module types where the native
libraries are generally preinstalled outside the APK.
Default: true
use_resource_processor
bool, If use_resource_processor is set, use Bazel's resource processor instead of aapt2 to generate R.class files.
The resource processor produces more optimal R.class files that only list resources in the package of the
library that provided them, as opposed to aapt2 which produces R.java files for every package containing
every resource. Using the resource processor can provide significant build time speedups, but requires
fixing the module to use the correct package to reference each resource, and to avoid having any other
libraries in the tree that use the same package name. Defaults to false, but will default to true in the
future.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_test_helper_app
android_test_helper_app compiles sources and Android resources into an Android application package `.apk` file that
will be used by tests, but does not produce an `AndroidTest.xml` file so the module will not be run directly as a
test.
name
,
srcs
,
exclude_srcs
,
defaults
,
aapt_include_all_resources
,
aaptflags
,
aconfig_Cache_files
,
additional_certificates
,
additional_manifests
,
aidl
,
apex_available
,
arch
,
asset_dirs
,
assets
,
auto_gen_config
,
certificate
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dont_merge_manifests
,
dxflags
,
embed_notices
,
enabled
,
enforce_default_target_sdk_version
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
export_package_resources
,
exported_plugins
,
flags_packages
,
generate_product_characteristics_rro
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
jni_uses_platform_apis
,
jni_uses_sdk_apis
,
kotlincflags
,
libs
,
licenses
,
lineage
,
lint
,
logging_parent
,
main_dex_rules
,
manifest
,
manifest_values
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
overrides
,
owner
,
package_name
,
package_splits
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
privapp_allowlist
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
rename_resources_package
,
replace_max_sdk_version_placeholder
,
required
,
resource_dirs
,
resource_zips
,
rotationMinSdkVersion
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
stl
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_suites
,
uncompress_dex
,
updatable
,
use_embedded_dex
,
use_embedded_native_libs
,
use_resource_processor
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aapt_include_all_resources
bool, include all resource configurations, not just the product-configured
ones.
aaptflags
list of string, flags passed to aapt when creating the apk
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
additional_certificates
list of string, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
additional_manifests
list of string, paths to additional manifest files to merge with main manifest.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
asset_dirs
list of string, list of directories relative to the Blueprints file containing assets.
Defaults to ["assets"] if a directory called assets exists. Set to []
to disable the default.
assets
list of string, list of files to use as assets.
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
certificate
string, The name of a certificate in the default certificate directory, blank to use the default product certificate,
or an android_app_certificate module name in the form ":module".
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
dxflags
list of string, list of module-specific flags that will be used for dex compiles
embed_notices
bool, If set, find and merge all NOTICE files that this module and its dependencies have and store
it in the APK as an asset.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_default_target_sdk_version
bool, It can be set to test the behaviour of default target sdk version.
Only required when updatable: false. It is an error if updatable: true and this is false.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
extra_check_modules
list of string, List of java_plugin modules that provide extra errorprone checks.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
export_package_resources
bool, If set, create package-export.apk, which other packages can
use to get PRODUCT-agnostic resource data like IDs and type definitions.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
flags_packages
list of string, Names of aconfig_declarations modules that specify aconfig flags that the module depends on.
generate_product_characteristics_rro
bool, If set, create an RRO package which contains only resources having PRODUCT_CHARACTERISTICS
and install the RRO package to /product partition, instead of passing --product argument
to aapt2. Default is false.
Setting this will make this APK identical to all targets, regardless of
PRODUCT_CHARACTERISTICS.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
headers_only
bool, If true, then only the headers are built and not the implementation jar.
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, list of native libraries that will be provided in or alongside the resulting jar
jni_uses_platform_apis
bool, if true, use JNI libraries that link against platform APIs even if this module sets
sdk_version.
jni_uses_sdk_apis
bool, if true, use JNI libraries that link against SDK APIs even if this module does not set
sdk_version.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
extra_check_modules
list of string, Modules that provide extra lint checks
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
Default: true
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
logging_parent
string, the logging parent of this app.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
⊕manifest_values
Manifest_values
applicationId
string, Overrides the value of package_name in the manifest
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
package_splits
list of string, list of resource labels to generate individual resource packages
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
privapp_allowlist
string, Specifies the file that contains the allowlist for this app.
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
rename_resources_package
bool, Whether to rename the package in resources to the override name rather than the base name. Defaults to true.
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
resource_dirs
list of string, list of directories relative to the Blueprints file containing
Android resources. Defaults to ["res"] if a directory called res exists.
Set to [] to disable the default.
resource_zips
list of string, list of zip files containing Android resources.
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
stl
string, STL library to use for JNI libraries.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
updatable
bool, Whether this app is considered mainline updatable or not. When set to true, this will enforce
additional rules to make sure an app can safely be updated. Default is false.
Prefer using other specific properties if build behaviour must be changed; avoid using this
flag for anything but neverallow rules (unless the behaviour change is invisible to owners).
use_embedded_dex
bool, Store dex files uncompressed in the APK and set the android:useEmbeddedDex="true" manifest attribute so that
they are used from inside the APK at runtime.
use_embedded_native_libs
bool, Store native libraries uncompressed in the APK and set the android:extractNativeLibs="false" manifest
flag so that they are used from inside the APK at runtime. Defaults to true for android_test modules unless
sdk_version or min_sdk_version is set to a version that doesn't support it (<23), defaults to true for
android_app modules that are embedded to APEXes, defaults to false for other module types where the native
libraries are generally preinstalled outside the APK.
Default: true
use_resource_processor
bool, If use_resource_processor is set, use Bazel's resource processor instead of aapt2 to generate R.class files.
The resource processor produces more optimal R.class files that only list resources in the package of the
library that provided them, as opposed to aapt2 which produces R.java files for every package containing
every resource. Using the resource processor can provide significant build time speedups, but requires
fixing the module to use the correct package to reference each resource, and to avoid having any other
libraries in the tree that use the same package name. Defaults to false, but will default to true in the
future.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
android_test_import
android_test_import imports a prebuilt test apk with additional processing specified in the
module. DPI or arch variant configurations can be made as with android_app_import.
name
,
defaults
,
additional_certificates
,
apex_available
,
apk
,
arch
,
certificate
,
compile_multilib
,
data
,
debug_ramdisk
,
default_dev_cert
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dpi_variants.hdpi
,
dpi_variants.ldpi
,
dpi_variants.mdpi
,
dpi_variants.xhdpi
,
dpi_variants.xxhdpi
,
dpi_variants.xxxhdpi
,
enabled
,
export_package_resources
,
filename
,
host_required
,
init_rc
,
licenses
,
lineage
,
multilib
,
native_bridge_supported
,
overrides
,
owner
,
per_testcase_directory
,
prebuilt_info
,
prefer
,
preprocessed
,
presigned
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
relative_install_path
,
required
,
rotationMinSdkVersion
,
skip_preprocessed_apk_checks
,
soc_specific
,
source_module_name
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_suites
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
additional_certificates
list of string, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
apk
string, A prebuilt apk to import
⊕arch
interface
⊕arm
*java.AndroidAppImportProperties
⊕arm64
*java.AndroidAppImportProperties
⊕riscv64
*java.AndroidAppImportProperties
⊕x86
*java.AndroidAppImportProperties
⊕x86_64
*java.AndroidAppImportProperties
*struct { Arm *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; Arm64 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; Riscv64 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; X86 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } }; X86_64 *struct { Dpi_variants *struct { Ldpi *java.AndroidAppImportProperties; Mdpi *java.AndroidAppImportProperties; Hdpi *java.AndroidAppImportProperties; Xhdpi *java.AndroidAppImportProperties; Xxhdpi *java.AndroidAppImportProperties; Xxxhdpi *java.AndroidAppImportProperties } } }
certificate
string, The name of a certificate in the default certificate directory or an android_app_certificate
module name in the form ":module". Should be empty if presigned or default_dev_cert is set.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
⊕data
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
default_dev_cert
bool, Sign with the default system dev certificate. Must be used judiciously. Most imported apps
need to either specify a specific certificate or be presigned.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
⊕dpi_variants.hdpi
*java.AndroidAppImportProperties
⊕dpi_variants.ldpi
*java.AndroidAppImportProperties
⊕dpi_variants.mdpi
*java.AndroidAppImportProperties
⊕dpi_variants.xhdpi
*java.AndroidAppImportProperties
⊕dpi_variants.xxhdpi
*java.AndroidAppImportProperties
⊕dpi_variants.xxxhdpi
*java.AndroidAppImportProperties
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_package_resources
bool, If set, create package-export.apk, which other packages can
use to get PRODUCT-agnostic resource data like IDs and type definitions.
filename
string, Optional name for the installed app. If unspecified, it is derived from the module name.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
⊕per_testcase_directory
prebuilt_info
string, Path to the .prebuilt_info file of the prebuilt app.
In case of mainline modules, the .prebuilt_info file contains the build_id that was used
to generate the prebuilt.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
preprocessed
bool, Whether the prebuilt apk can be installed without additional processing. Default is false.
presigned
bool, Set this flag to true if the prebuilt apk is already signed. The certificate property must not
be set for presigned modules.
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
relative_install_path
string, Optional. Install to a subdirectory of the default install path for the module
required
list of string, names of other modules to install if this module is installed
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
skip_preprocessed_apk_checks
bool, Whether or not to skip checking the preprocessed apk for proper alignment and uncompressed
JNI libs and dex files. Default is false
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
⊕test_suites
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
bootclasspath_fragment
name
,
defaults
,
additional_stubs
,
apex_available
,
api
,
arch
,
compile_multilib
,
contents
,
core_platform_api
,
coverage
,
coverage.hidden_api
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
fragments
,
generate_classpaths_proto
,
hidden_api
,
host_required
,
image_name
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
additional_stubs
list of string, The list of additional stub libraries which this fragment's contents use but which are not
provided by another bootclasspath_fragment.
Note, "android-non-updatable" is treated specially. While no such module exists it is treated
as if it was a java_sdk_library. So, when public API stubs are needed then it will be replaced
with "android-non-updatable.stubs", with "androidn-non-updatable.system.stubs" when the system
stubs are needed and so on.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage
BootclasspathFragmentCoverageAffectedProperties
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage.hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
fragments
list of ApexVariantReference, The names of the bootclasspath_fragment modules that form part of this module.
generate_classpaths_proto
bool, Whether to generated classpaths.proto config instance for the fragment. If the config is not
generated, then relevant boot jars are added to platform classpath, i.e. platform_bootclasspath
or platform_systemserverclasspath. This is useful for non-updatable APEX boot jars, to keep
them as part of dexopt on device. Defaults to true.
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
host_required
list of string, names of other modules to install on host if this module is installed
image_name
string, The name of the image this represents.
If specified then it must be one of "art" or "boot".
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
bootclasspath_fragment_test
name
,
defaults
,
additional_stubs
,
apex_available
,
api
,
arch
,
compile_multilib
,
contents
,
core_platform_api
,
coverage
,
coverage.hidden_api
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
fragments
,
generate_classpaths_proto
,
hidden_api
,
host_required
,
image_name
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
additional_stubs
list of string, The list of additional stub libraries which this fragment's contents use but which are not
provided by another bootclasspath_fragment.
Note, "android-non-updatable" is treated specially. While no such module exists it is treated
as if it was a java_sdk_library. So, when public API stubs are needed then it will be replaced
with "android-non-updatable.stubs", with "androidn-non-updatable.system.stubs" when the system
stubs are needed and so on.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage
BootclasspathFragmentCoverageAffectedProperties
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage.hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
fragments
list of ApexVariantReference, The names of the bootclasspath_fragment modules that form part of this module.
generate_classpaths_proto
bool, Whether to generated classpaths.proto config instance for the fragment. If the config is not
generated, then relevant boot jars are added to platform classpath, i.e. platform_bootclasspath
or platform_systemserverclasspath. This is useful for non-updatable APEX boot jars, to keep
them as part of dexopt on device. Defaults to true.
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
host_required
list of string, names of other modules to install on host if this module is installed
image_name
string, The name of the image this represents.
If specified then it must be one of "art" or "boot".
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
dex_bootjars
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
Default: dex_bootjars
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
dex_import
dex_import imports a `.jar` file containing classes.dex files.
A dex_import module cannot be used as a dependency of a java_* or android_* module, it can only be installed
to the device.
name
,
defaults
,
apex_available
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
jars
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
jars
list of string
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
stem
string, set the name of the output
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
dexpreopt_systemserver_check
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
Default: dexpreopt_systemserver_check
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
doc_defaults
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aidl
,
apex_available
,
arch
,
arg_files
,
args
,
compat_config
,
compile_multilib
,
custom_template
,
debug_ramdisk
,
defaults_visibility
,
device_specific
,
dist
,
dists
,
dokka_enabled
,
enabled
,
filter_packages
,
flags
,
hdf
,
host_required
,
html_dirs
,
init_rc
,
installable
,
java_version
,
knowntags
,
libs
,
licenses
,
lint_baseline
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proofread_file
,
proprietary
,
ramdisk
,
recovery
,
required
,
resourcesdir
,
resourcesoutdir
,
sdk_version
,
soc_specific
,
static_doc_index_redirect
,
static_doc_properties
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
todo_file
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
compat_config
string, Compat config XML. Generates compat change documentation if set.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
custom_template
string, directory relative to top of the source tree that contains doc templates files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
defaults_visibility
list of string, Controls the visibility of the defaults module itself.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dokka_enabled
bool, if set to true, generate docs through Dokka instead of Doclava.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
hdf
list of string, set a value in the Clearsilver hdf namespace.
host_required
list of string, names of other modules to install on host if this module is installed
html_dirs
list of string, directories under current module source which contains html/jd files.
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
knowntags
list of string, a list of files under current module source dir which contains known tags in Java sources.
filegroup or genrule can be included within this property.
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lint_baseline
string, A file containing a baseline for allowed lint errors.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proofread_file
string, proofread file contains all of the text content of the javadocs concatenated into one file,
suitable for spell-checking and other goodness.
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
resourcesdir
string, directory under current module source that provide additional resources (images).
resourcesoutdir
string, resources output directory under out/soong/.intermediates.
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_doc_index_redirect
string, index.html under current module will be copied to docs out dir, if not null.
static_doc_properties
string, source.properties under current module will be copied to docs out dir, if not null.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
todo_file
string, a todo file lists the program elements that are missing documentation.
At some point, this might be improved to show more warnings.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
droiddoc
droiddoc converts .java source files to documentation using doclava or dokka.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aidl
,
arch
,
arg_files
,
args
,
compat_config
,
compile_multilib
,
custom_template
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
dokka_enabled
,
enabled
,
filter_packages
,
flags
,
hdf
,
host_required
,
html_dirs
,
init_rc
,
installable
,
java_version
,
knowntags
,
libs
,
licenses
,
lint_baseline
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proofread_file
,
proprietary
,
ramdisk
,
recovery
,
required
,
resourcesdir
,
resourcesoutdir
,
sdk_version
,
soc_specific
,
static_doc_index_redirect
,
static_doc_properties
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
todo_file
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
compat_config
string, Compat config XML. Generates compat change documentation if set.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
custom_template
string, directory relative to top of the source tree that contains doc templates files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dokka_enabled
bool, if set to true, generate docs through Dokka instead of Doclava.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
hdf
list of string, set a value in the Clearsilver hdf namespace.
host_required
list of string, names of other modules to install on host if this module is installed
html_dirs
list of string, directories under current module source which contains html/jd files.
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
knowntags
list of string, a list of files under current module source dir which contains known tags in Java sources.
filegroup or genrule can be included within this property.
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lint_baseline
string, A file containing a baseline for allowed lint errors.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proofread_file
string, proofread file contains all of the text content of the javadocs concatenated into one file,
suitable for spell-checking and other goodness.
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
resourcesdir
string, directory under current module source that provide additional resources (images).
resourcesoutdir
string, resources output directory under out/soong/.intermediates.
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_doc_index_redirect
string, index.html under current module will be copied to docs out dir, if not null.
static_doc_properties
string, source.properties under current module will be copied to docs out dir, if not null.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
todo_file
string, a todo file lists the program elements that are missing documentation.
At some point, this might be improved to show more warnings.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
droiddoc_exported_dir
droiddoc_exported_dir exports a directory of html templates or nullability annotations for use by doclava.
name
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
native_bridge_supported
,
owner
,
path
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
path
string, path to the directory containing Droiddoc related files.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
droiddoc_host
droiddoc_host converts .java source files to documentation using doclava or dokka.
name
,
srcs
,
exclude_srcs
,
defaults
,
aidl
,
arch
,
arg_files
,
args
,
compat_config
,
compile_multilib
,
custom_template
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
dokka_enabled
,
enabled
,
filter_packages
,
flags
,
hdf
,
host_required
,
html_dirs
,
init_rc
,
installable
,
java_version
,
knowntags
,
libs
,
licenses
,
lint_baseline
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proofread_file
,
proprietary
,
ramdisk
,
recovery
,
required
,
resourcesdir
,
resourcesoutdir
,
sdk_version
,
soc_specific
,
static_doc_index_redirect
,
static_doc_properties
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
todo_file
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
compat_config
string, Compat config XML. Generates compat change documentation if set.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
custom_template
string, directory relative to top of the source tree that contains doc templates files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dokka_enabled
bool, if set to true, generate docs through Dokka instead of Doclava.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
hdf
list of string, set a value in the Clearsilver hdf namespace.
host_required
list of string, names of other modules to install on host if this module is installed
html_dirs
list of string, directories under current module source which contains html/jd files.
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
knowntags
list of string, a list of files under current module source dir which contains known tags in Java sources.
filegroup or genrule can be included within this property.
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lint_baseline
string, A file containing a baseline for allowed lint errors.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proofread_file
string, proofread file contains all of the text content of the javadocs concatenated into one file,
suitable for spell-checking and other goodness.
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
resourcesdir
string, directory under current module source that provide additional resources (images).
resourcesoutdir
string, resources output directory under out/soong/.intermediates.
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_doc_index_redirect
string, index.html under current module will be copied to docs out dir, if not null.
static_doc_properties
string, source.properties under current module will be copied to docs out dir, if not null.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
todo_file
string, a todo file lists the program elements that are missing documentation.
At some point, this might be improved to show more warnings.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
droidstubs
droidstubs passes sources files through Metalava to generate stub .java files that only contain the API to be
documented, filtering out hidden classes and methods. The resulting .java files are intended to be passed to
a droiddoc module to generate documentation.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_declarations
,
aidl
,
annotations_enabled
,
api_filename
,
api_levels_annotations_dirs
,
api_levels_annotations_enabled
,
api_levels_jar_filename
,
api_levels_module
,
api_levels_sdk_type
,
api_surface
,
arch
,
arg_files
,
args
,
check_api.api_lint
,
check_api.current
,
check_api.last_released
,
check_nullability_warnings
,
compile_multilib
,
create_doc_stubs
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
extensions_info_file
,
filter_packages
,
flags
,
generate_stubs
,
high_mem
,
host_required
,
init_rc
,
installable
,
java_version
,
libs
,
licenses
,
merge_annotations_dirs
,
merge_inclusion_annotations_dirs
,
multilib
,
native_bridge_supported
,
out
,
output_javadoc_comments
,
owner
,
previous_api
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
removed_api_filename
,
required
,
sdk_version
,
soc_specific
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
validate_nullability_from_list
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
write_sdk_values
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_declarations
list of string, a list of aconfig_declarations module names that the stubs generated in this module
depend on.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
annotations_enabled
bool, is set to true, Metalava will allow framework SDK to contain annotations.
api_filename
string, The generated public API filename by Metalava, defaults to <module>_api.txt
api_levels_annotations_dirs
list of string, the dirs which Metalava extracts API levels annotations from.
api_levels_annotations_enabled
bool, if set to true, Metalava will allow framework SDK to contain API levels annotations.
api_levels_jar_filename
string, the filename which Metalava extracts API levels annotations from. Defaults to android.jar.
api_levels_module
string, Apply the api levels database created by this module rather than generating one in this droidstubs.
api_levels_sdk_type
string, the sdk kind which Metalava extracts API levels annotations from. Supports 'public', 'system', 'module-lib' and 'system-server'; defaults to public.
api_surface
string, API surface of this module. If set, the module contributes to an API surface.
For the full list of available API surfaces, refer to soong/android/sdk_version.go
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
⊕check_api.api_lint
enabled
bool
new_since
string, If set, performs api_lint on any new APIs not found in the given signature file
baseline_file
string, If not blank, path to the baseline txt file for approved API lint violations.
⊕check_api.current
ApiToCheck
api_file
string, path to the API txt file that the new API extracted from source code is checked
against. The path can be local to the module or from other module (via :module syntax).
removed_api_file
string, path to the API txt file that the new @removed API extractd from source code is
checked against. The path can be local to the module or from other module (via
:module syntax).
baseline_file
string, If not blank, path to the baseline txt file for approved API check violations.
args
string, Arguments to the apicheck tool.
⊕check_api.last_released
ApiToCheck
api_file
string, path to the API txt file that the new API extracted from source code is checked
against. The path can be local to the module or from other module (via :module syntax).
removed_api_file
string, path to the API txt file that the new @removed API extractd from source code is
checked against. The path can be local to the module or from other module (via
:module syntax).
baseline_file
string, If not blank, path to the baseline txt file for approved API check violations.
args
string, Arguments to the apicheck tool.
check_nullability_warnings
string, a file containing expected warnings produced by validation of nullability annotations.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
create_doc_stubs
bool, if set to true, allow Metalava to generate doc_stubs source files. Defaults to false.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
extensions_info_file
string, path or filegroup to file defining extension an SDK name <-> numerical ID mapping and
what APIs exist in which SDKs; passed to metalava via --sdk-extensions-info
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
generate_stubs
bool, if set to false then do not write out stubs. Defaults to true.
TODO(b/146727827): Remove capability when we do not need to generate stubs and API separately.
high_mem
bool, if set to true, provides a hint to the build system that this rule uses a lot of memory,
which can be used for scheduling purposes
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
merge_annotations_dirs
list of string, a list of top-level directories containing files to merge qualifier annotations (i.e. those intended to be included in the stubs written) from.
merge_inclusion_annotations_dirs
list of string, a list of top-level directories containing Java stub files to merge show/hide annotations from.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
previous_api
string, user can specify the version of previous released API file in order to do compatibility check.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
removed_api_filename
string, the generated removed API filename by Metalava, defaults to <module>_removed.txt
required
list of string, names of other modules to install if this module is installed
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
validate_nullability_from_list
string, a file containing a list of classes to do nullability validation for.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_sdk_values
bool, if set to true, collect the values used by the Dev tools and
write them in files packaged with the SDK. Defaults to false.
droidstubs_host
droidstubs_host passes sources files through Metalava to generate stub .java files that only contain the API
to be documented, filtering out hidden classes and methods. The resulting .java files are intended to be
passed to a droiddoc_host module to generate documentation. Use a droidstubs_host instead of a droidstubs
module when symbols needed by the source files are provided by java_library_host modules.
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_declarations
,
aidl
,
annotations_enabled
,
api_filename
,
api_levels_annotations_dirs
,
api_levels_annotations_enabled
,
api_levels_jar_filename
,
api_levels_module
,
api_levels_sdk_type
,
api_surface
,
arch
,
arg_files
,
args
,
check_api.api_lint
,
check_api.current
,
check_api.last_released
,
check_nullability_warnings
,
compile_multilib
,
create_doc_stubs
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
extensions_info_file
,
filter_packages
,
flags
,
generate_stubs
,
high_mem
,
host_required
,
init_rc
,
installable
,
java_version
,
libs
,
licenses
,
merge_annotations_dirs
,
merge_inclusion_annotations_dirs
,
multilib
,
native_bridge_supported
,
out
,
output_javadoc_comments
,
owner
,
previous_api
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
removed_api_filename
,
required
,
sdk_version
,
soc_specific
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
validate_nullability_from_list
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
write_sdk_values
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
aconfig_declarations
list of string, a list of aconfig_declarations module names that the stubs generated in this module
depend on.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
annotations_enabled
bool, is set to true, Metalava will allow framework SDK to contain annotations.
api_filename
string, The generated public API filename by Metalava, defaults to <module>_api.txt
api_levels_annotations_dirs
list of string, the dirs which Metalava extracts API levels annotations from.
api_levels_annotations_enabled
bool, if set to true, Metalava will allow framework SDK to contain API levels annotations.
api_levels_jar_filename
string, the filename which Metalava extracts API levels annotations from. Defaults to android.jar.
api_levels_module
string, Apply the api levels database created by this module rather than generating one in this droidstubs.
api_levels_sdk_type
string, the sdk kind which Metalava extracts API levels annotations from. Supports 'public', 'system', 'module-lib' and 'system-server'; defaults to public.
api_surface
string, API surface of this module. If set, the module contributes to an API surface.
For the full list of available API surfaces, refer to soong/android/sdk_version.go
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
⊕check_api.api_lint
enabled
bool
new_since
string, If set, performs api_lint on any new APIs not found in the given signature file
baseline_file
string, If not blank, path to the baseline txt file for approved API lint violations.
⊕check_api.current
ApiToCheck
api_file
string, path to the API txt file that the new API extracted from source code is checked
against. The path can be local to the module or from other module (via :module syntax).
removed_api_file
string, path to the API txt file that the new @removed API extractd from source code is
checked against. The path can be local to the module or from other module (via
:module syntax).
baseline_file
string, If not blank, path to the baseline txt file for approved API check violations.
args
string, Arguments to the apicheck tool.
⊕check_api.last_released
ApiToCheck
api_file
string, path to the API txt file that the new API extracted from source code is checked
against. The path can be local to the module or from other module (via :module syntax).
removed_api_file
string, path to the API txt file that the new @removed API extractd from source code is
checked against. The path can be local to the module or from other module (via
:module syntax).
baseline_file
string, If not blank, path to the baseline txt file for approved API check violations.
args
string, Arguments to the apicheck tool.
check_nullability_warnings
string, a file containing expected warnings produced by validation of nullability annotations.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
create_doc_stubs
bool, if set to true, allow Metalava to generate doc_stubs source files. Defaults to false.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
extensions_info_file
string, path or filegroup to file defining extension an SDK name <-> numerical ID mapping and
what APIs exist in which SDKs; passed to metalava via --sdk-extensions-info
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
generate_stubs
bool, if set to false then do not write out stubs. Defaults to true.
TODO(b/146727827): Remove capability when we do not need to generate stubs and API separately.
high_mem
bool, if set to true, provides a hint to the build system that this rule uses a lot of memory,
which can be used for scheduling purposes
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
merge_annotations_dirs
list of string, a list of top-level directories containing files to merge qualifier annotations (i.e. those intended to be included in the stubs written) from.
merge_inclusion_annotations_dirs
list of string, a list of top-level directories containing Java stub files to merge show/hide annotations from.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
previous_api
string, user can specify the version of previous released API file in order to do compatibility check.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
removed_api_filename
string, the generated removed API filename by Metalava, defaults to <module>_removed.txt
required
list of string, names of other modules to install if this module is installed
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
validate_nullability_from_list
string, a file containing a list of classes to do nullability validation for.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_sdk_values
bool, if set to true, collect the values used by the Dev tools and
write them in files packaged with the SDK. Defaults to false.
global_compat_config
global_compat_config provides access to the merged compat config xml file generated by the build.
name
,
host_supported
,
device_supported
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
filename
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
filename
string, name of the file into which the metadata will be copied.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_api_contribution
name
,
defaults
,
api_file
,
api_surface
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
⊕api_file
⊕api_surface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_api_contribution_import
name
,
defaults
,
api_file
,
api_surface
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
source_module_name
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
⊕api_file
⊕api_surface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_api_library
name
,
defaults
,
aconfig_declarations
,
api_contributions
,
api_surface
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enable_validation
,
enabled
,
full_api_surface_stub
,
host_required
,
init_rc
,
javacflags
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
previous_api
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
static_libs
,
stubs_type
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
aconfig_declarations
list of string, List of aconfig_declarations module names that the stubs generated in this module
depend on.
api_contributions
list of string, list of Java API contribution modules that consists this API surface
This is a list of Soong modules
api_surface
string, name of the API surface
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enable_validation
bool, If true, the module runs validation on the API signature files provided
by the modules passed via api_contributions by checking if the files are
in sync with the source Java files. However, the environment variable
DISABLE_STUB_VALIDATION has precedence over this property.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
full_api_surface_stub
string, Java Api library to provide the full API surface stub jar file.
If this property is set, the stub jar of this module is created by
extracting the compiled class files provided by the
full_api_surface_stub module.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
javacflags
list of string, List of flags to be passed to the javac compiler to generate jar file
libs
list of string, List of shared java libs that this module has dependencies to and
should be passed as classpath in javac invocation
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
previous_api
string, Version of previously released API file for compatibility check.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
list of string, List of java libs that this module has static dependencies to and will be
merge zipped after metalava invocation
stubs_type
string, Type of stubs the module should generate. Must be one of "everything", "runtime" or
"exportable". Defaults to "everything".
- "everything" stubs include all non-flagged apis and flagged apis, regardless of the state
of the flag.
- "runtime" stubs include all non-flagged apis and flagged apis that are ENABLED or
READ_WRITE, and all other flagged apis are stripped.
- "exportable" stubs include all non-flagged apis and flagged apis that are ENABLED and
READ_ONLY, and all other flagged apis are stripped.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, java_system_modules module providing the jar to be added to the
bootclasspath when compiling the stubs.
The jar will also be passed to metalava as a classpath to
generate compilable stubs.
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_binary
java_binary builds a `.jar` file and a shell script that executes it for the device, and possibly for the host
as well.
By default, a java_binary has a single variant that produces a `.jar` file containing `classes.dex` files that were
compiled against the device bootclasspath.
Specifying `host_supported: true` will produce two variants, one compiled against the device bootclasspath and one
compiled against the host bootclasspath.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aidl
,
arch
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_class
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_only
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
wrapper
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the host
variant of the binary.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_class
string, Name of the class containing main to be inserted into the manifest as Main-Class.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_only
bool, Indicates that the module and its source code are only used in tests, not
production code. Used by coverage reports and potentially other tools.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
wrapper
string, installable script to execute the resulting jar
java_binary_host
java_binary_host builds a `.jar` file and a shell script that executes it for the host.
A java_binary_host has a single variant that produces a `.jar` file containing `.class` files that were
compiled against the host bootclasspath.
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
arch
,
common_srcs
,
compile_data
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hiddenapi_additional_annotations
,
host_required
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
main_class
,
manifest
,
multilib
,
native_bridge_supported
,
openjdk9
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_tools_jar
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
wrapper
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the host
variant of the binary.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
main_class
string, Name of the class containing main to be inserted into the manifest as Main-Class.
manifest
string, manifest file to be included in resulting jar
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
wrapper
string, installable script to execute the resulting jar
java_defaults
java_defaults provides a set of properties that can be inherited by other java or android modules.
A module can use the properties from a java_defaults module using `defaults: ["defaults_module_name"]`. Each
property in the defaults module that exists in the depending module will be prepended to the depending module's
value for that property.
Example:
java_defaults {
name: "example_defaults",
srcs: ["common/**/*.java"],
javacflags: ["-Xlint:all"],
aaptflags: ["--auto-add-overlay"],
}
java_library {
name: "example",
defaults: ["example_defaults"],
srcs: ["example/**/*.java"],
}
is functionally identical to:
java_library {
name: "example",
srcs: [
"common/**/*.java",
"example/**/*.java",
],
javacflags: ["-Xlint:all"],
}
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aapt_include_all_resources
,
aaptflags
,
aars
,
aconfig_Cache_files
,
aconfig_declarations
,
additional_certificates
,
additional_manifests
,
additional_stubs
,
aidl
,
annotations_enabled
,
apex_available
,
api
,
api_contributions
,
api_dir
,
api_lint
,
api_only
,
api_packages
,
api_srcs
,
api_surface
,
arch
,
asset_dirs
,
assets
,
auto_gen_config
,
certificate
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
contents
,
contribute_to_android_api
,
core_platform_api
,
coverage
,
coverage.hidden_api
,
data
,
data_device_bins_32
,
data_device_bins_64
,
data_device_bins_both
,
data_device_bins_first
,
data_device_bins_prefer32
,
data_native_bins
,
debug_ramdisk
,
default_to_stubs
,
defaults_visibility
,
device_specific
,
dex_preopt
,
dist
,
dist_group
,
dist_stem
,
dists
,
doctag_files
,
dont_merge_manifests
,
droiddoc_option_files
,
droiddoc_options
,
dxflags
,
embed_notices
,
enable_validation
,
enabled
,
enforce_default_target_sdk_version
,
errorprone
,
exclude_dirs
,
exclude_files
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
export_package_resources
,
exported_plugins
,
extract_jni
,
flags_packages
,
fragments
,
full_api_surface_stub
,
generate_product_characteristics_rro
,
generated_srcjars
,
headers_only
,
hidden_api
,
hidden_api_packages
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
image_name
,
impl_library_visibility
,
impl_only_libs
,
impl_only_static_libs
,
include_srcs
,
init_rc
,
installable
,
instrumentation_for
,
instrumentation_target_package
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
jars
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jetifier
,
jni_libs
,
jni_uses_platform_apis
,
jni_uses_sdk_apis
,
kotlincflags
,
libs
,
licenses
,
lineage
,
lint
,
logging_parent
,
main_dex_rules
,
mainline_package_name
,
manifest
,
manifest_values
,
max_device_sdk
,
max_sdk_version
,
merge_annotations_dirs
,
merge_inclusion_annotations_dirs
,
min_device_sdk
,
min_sdk_version
,
module_lib
,
multilib
,
naming_scheme
,
native_bridge_supported
,
no_dist
,
on_bootclasspath_before
,
on_bootclasspath_since
,
openjdk9
,
optimize
,
overrides
,
owner
,
package_name
,
package_splits
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
previous_api
,
privapp_allowlist
,
privileged
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
public
,
ramdisk
,
recovery
,
rename_resources_package
,
replace_max_sdk_version_placeholder
,
required
,
resource_dirs
,
resource_libs
,
resource_zips
,
rotationMinSdkVersion
,
sdk_version
,
services
,
shared_library
,
soc_specific
,
source_module_name
,
static_kotlin_stdlib
,
static_libs
,
stem
,
stl
,
stub_only_libs
,
stub_only_static_libs
,
stubs_library_visibility
,
stubs_source_visibility
,
stubs_type
,
system
,
system_ext_specific
,
system_modules
,
system_server
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
theme
,
uncompress_dex
,
unsafe_ignore_missing_latest_api
,
updatable
,
use_embedded_dex
,
use_embedded_native_libs
,
use_resource_processor
,
use_tools_jar
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aapt_include_all_resources
bool, include all resource configurations, not just the product-configured
ones.
aaptflags
list of string, flags passed to aapt when creating the apk
aars
list of string, ARR (android library prebuilt) filepath. Exactly one ARR is required.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
aconfig_declarations
list of string, a list of aconfig_declarations module names that the stubs generated in this module
depend on.
additional_certificates
list of string, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
additional_manifests
list of string, paths to additional manifest files to merge with main manifest.
additional_stubs
list of string, The list of additional stub libraries which this fragment's contents use but which are not
provided by another bootclasspath_fragment.
Note, "android-non-updatable" is treated specially. While no such module exists it is treated
as if it was a java_sdk_library. So, when public API stubs are needed then it will be replaced
with "android-non-updatable.stubs", with "androidn-non-updatable.system.stubs" when the system
stubs are needed and so on.
⊕aidl
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
annotations_enabled
bool, is set to true, Metalava will allow framework SDK to contain annotations.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
api_contributions
list of string, list of Java API contribution modules that consists this API surface
This is a list of Soong modules
api_dir
string, the relative path to the directory containing the api specification files.
Defaults to "api".
⊕api_lint
Properties related to api linting.
enabled
bool, Enable api linting.
legacy_errors_allowed
bool, If API lint is enabled, this flag controls whether a set of legitimate lint errors
are turned off. The default is true.
api_only
bool, Determines whether a runtime implementation library is built; defaults to false.
If true then it also prevents the module from being used as a shared module, i.e.
it is as if shared_library: false, was set.
api_packages
list of string, list of package names that will be documented and publicized as API.
This allows the API to be restricted to a subset of the source files provided.
If this is unspecified then all the source files will be treated as being part
of the API.
api_srcs
list of string, List of source files that are needed to compile the API, but are not part of runtime library.
api_surface
string, name of the API surface
arch
interface
asset_dirs
list of string, list of directories relative to the Blueprints file containing assets.
Defaults to ["assets"] if a directory called assets exists. Set to []
to disable the default.
assets
list of string, list of files to use as assets.
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
certificate
string, the name of a certificate in the default certificate directory or an android_app_certificate
module name in the form ":module".
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
contribute_to_android_api
bool, Determines if the module contributes to any api surfaces.
This property should be set to true only if the module is listed under
frameworks-base-api.bootclasspath in frameworks/base/api/Android.bp.
Otherwise, this property should be set to false.
Defaults to false.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage
BootclasspathFragmentCoverageAffectedProperties
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage.hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
data_device_bins_32
list of string, list of device binary modules that should be installed alongside the test
This property only adds 32bit variants of the dependency
data_device_bins_64
list of string, list of device binary modules that should be installed alongside the test
This property only adds 64bit variants of the dependency
data_device_bins_both
list of string, list of device binary modules that should be installed alongside the test
This property adds 64bit AND 32bit variants of the dependency
data_device_bins_first
list of string, list of device binary modules that should be installed alongside the test
This property only adds the first variant of the dependency
data_device_bins_prefer32
list of string, list of device binary modules that should be installed alongside the test
This property adds 32bit variants of the dependency if available, or else
defaults to the 64bit variant
data_native_bins
list of string, list of native binary modules that should be installed alongside the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
default_to_stubs
bool, Determines if the stubs are preferred over the implementation library
for linking, even when the client doesn't specify sdk_version. When this
is set to true, such clients are provided with the widest API surface that
this lib provides. Note however that this option doesn't affect the clients
that are in the same APEX as this library. In that case, the clients are
always linked with the implementation library. Default is false.
defaults_visibility
list of string, Controls the visibility of the defaults module itself.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dist_group
string, The subdirectory for the artifacts that are copied to the dist directory. If not specified
then defaults to "unknown". Should be set to "android" for anything that should be published
in the public Android SDK.
dist_stem
string, The stem for the artifacts that are copied to the dist, if not specified
then defaults to the base module name.
For each scope the following artifacts are copied to the apistubs/<scope>
directory in the dist.
* stubs impl jar -> <dist-stem>.jar
* API specification file -> api/<dist-stem>.txt
* Removed API specification file -> api/<dist-stem>-removed.txt
Also used to construct the name of the filegroup (created by prebuilt_apis)
that references the latest released API and remove API specification files.
* API specification filegroup -> <dist-stem>.api.<scope>.latest
* Removed API specification filegroup -> <dist-stem>-removed.api.<scope>.latest
* API incompatibilities baseline filegroup -> <dist-stem>-incompatibilities.api.<scope>.latest
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
doctag_files
list of string, Files containing information about supported java doc tags.
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
droiddoc_option_files
list of string, local files that are used within user customized droiddoc options.
droiddoc_options
list of string, additional droiddoc options.
Available variables for substitution:
$(location <label>): the path to the droiddoc_option_files with name <label>
dxflags
list of string, list of module-specific flags that will be used for dex compiles
embed_notices
bool, If set, find and merge all NOTICE files that this module and its dependencies have and store
it in the APK as an asset.
enable_validation
bool, If true, the module runs validation on the API signature files provided
by the modules passed via api_contributions by checking if the files are
in sync with the source Java files. However, the environment variable
DISABLE_STUB_VALIDATION has precedence over this property.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_default_target_sdk_version
bool, It can be set to test the behaviour of default target sdk version.
Only required when updatable: false. It is an error if updatable: true and this is false.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_dirs
list of string, List of directories to remove from the jar file(s)
exclude_files
list of string, List of files to remove from the jar file(s)
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
export_package_resources
bool, If set, create package-export.apk, which other packages can
use to get PRODUCT-agnostic resource data like IDs and type definitions.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
flags_packages
list of string, Names of aconfig_declarations modules that specify aconfig flags that the module depends on.
fragments
list of ApexVariantReference, The names of the bootclasspath_fragment modules that form part of this module.
full_api_surface_stub
string, Java Api library to provide the full API surface stub jar file.
If this property is set, the stub jar of this module is created by
extracting the compiled class files provided by the
full_api_surface_stub module.
generate_product_characteristics_rro
bool, If set, create an RRO package which contains only resources having PRODUCT_CHARACTERISTICS
and install the RRO package to /product partition, instead of passing --product argument
to aapt2. Default is false.
Setting this will make this APK identical to all targets, regardless of
PRODUCT_CHARACTERISTICS.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hidden_api_packages
list of string, list of package names that must be hidden from the API
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
image_name
string, The name of the image this represents.
If specified then it must be one of "art" or "boot".
impl_library_visibility
list of string, Visibility for impl library module. If not specified then defaults to the
visibility property.
impl_only_libs
list of string, List of Java libraries that will be in the classpath when building the implementation lib
impl_only_static_libs
list of string, List of Java libraries that will included in the implementation lib.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool
instrumentation_for
string, The name of the android_app module that the tests will run against.
instrumentation_target_package
string, If specified, the instrumentation target package name in the manifest is overwritten by it.
is_stubs_module
bool, Property signifying whether the module provides stubs jar or not.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
jars
list of string
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jetifier
bool, if set to true, run Jetifier against .jar file. Defaults to false.
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the test.
jni_uses_platform_apis
bool, if true, use JNI libraries that link against platform APIs even if this module sets
sdk_version.
jni_uses_sdk_apis
bool, if true, use JNI libraries that link against SDK APIs even if this module does not set
sdk_version.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, List of shared java libs that this module has dependencies to and
should be passed as classpath in javac invocation
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
logging_parent
string, the logging parent of this app.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
mainline_package_name
string, If specified, the mainline module package name in the test config is overwritten by it.
manifest
string, manifest file to be included in resulting jar
⊕manifest_values
Manifest_values
applicationId
string, Overrides the value of package_name in the manifest
max_device_sdk
string, Indicates that PackageManager should ignore this shared library if the
platform is above the version indicated in this attribute.
This means that the device won't recognise this library as installed.
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
merge_annotations_dirs
list of string, a list of top-level directories containing files to merge qualifier annotations
(i.e. those intended to be included in the stubs written) from.
merge_inclusion_annotations_dirs
list of string, a list of top-level directories containing Java stub files to merge show/hide annotations from.
min_device_sdk
string, Indicates that PackageManager should ignore this shared library if the
platform is below the version indicated in this attribute.
This means that the device won't recognise this library as installed.
min_sdk_version
string, If not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
⊕module_lib
ApiScopeProperties
The properties specific to the module-lib api scope
Unless explicitly specified by using module_lib.enabled the module_lib api
scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
multilib
interface
naming_scheme
string, The naming scheme to use for the components that this module creates.
If not specified then it defaults to "default".
This is a temporary mechanism to simplify conversion from separate modules for each
component that follow a different naming pattern to the default one.
TODO(b/155480189) - Remove once naming inconsistencies have been resolved.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
no_dist
bool, If set to true then don't create dist rules.
on_bootclasspath_before
string, Signals that this shared library was part of the bootclasspath before
(but not including) the version indicated in this attribute.
The system will automatically add a <uses-library> tag with this library to
apps that target any SDK less than the version indicated in this attribute.
on_bootclasspath_since
string, Signals that this shared library is part of the bootclasspath starting
on the version indicated in this attribute.
This will make platforms at this level and above to ignore
<uses-library> tags with this library name because the library is already
available
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
package_splits
list of string, list of resource labels to generate individual resource packages
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
previous_api
string, Version of previously released API file for compatibility check.
privapp_allowlist
string, Specifies the file that contains the allowlist for this app.
privileged
bool, Specifies that this app should be installed to the priv-app directory,
where the system will grant it additional privileges not available to
normal apps.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
⊕public
ApiScopeProperties
The properties specific to the public api scope
Unless explicitly specified by using public.enabled the public api scope is
enabled by default in both legacy and non-legacy mode.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
rename_resources_package
bool, Whether to rename the package in resources to the override name rather than the base name. Defaults to true.
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
resource_dirs
list of string, list of directories relative to the Blueprints file containing
Android resources. Defaults to ["res"] if a directory called res exists.
Set to [] to disable the default.
resource_libs
list of string, list of android_app modules whose resources are extracted and linked against
resource_zips
list of string, list of zip files containing Android resources.
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
sdk_version
string, If not blank, set to the version of the sdk to compile against. This
can be either an API version (e.g. "29" for API level 29 AKA Android 10)
or special subsets of the current platform, for example "none", "current",
"core", "system", "test". See build/soong/java/sdk.go for the full and
up-to-date list of possible values.
Defaults to compiling against the current platform.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
shared_library
bool, Specifies whether this module can be used as an Android shared library; defaults
to true.
An Android shared library is one that can be referenced in a <uses-library> element
in an AndroidManifest.xml.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
stl
string, STL library to use for JNI libraries.
stub_only_libs
list of string, List of Java libraries that will be in the classpath when building stubs
stub_only_static_libs
list of string, List of Java libraries that will included in stub libraries
stubs_library_visibility
list of string, Visibility for stubs library modules. If not specified then defaults to the
visibility property.
stubs_source_visibility
list of string, Visibility for stubs source modules. If not specified then defaults to the
visibility property.
stubs_type
string, Type of stubs the module should generate. Must be one of "everything", "runtime" or
"exportable". Defaults to "everything".
- "everything" stubs include all non-flagged apis and flagged apis, regardless of the state
of the flag.
- "runtime" stubs include all non-flagged apis and flagged apis that are ENABLED or
READ_WRITE, and all other flagged apis are stripped.
- "exportable" stubs include all non-flagged apis and flagged apis that are ENABLED and
READ_ONLY, and all other flagged apis are stripped.
⊕system
ApiScopeProperties
The properties specific to the system api scope
In legacy mode the system api scope is enabled by default when sdk_version
is set to something other than "none".
In non-legacy mode the system api scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
⊕system_server
ApiScopeProperties
The properties specific to the system-server api scope
Unless explicitly specified by using system_server.enabled the
system_server api scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
⊕test
ApiScopeProperties
The properties specific to the test api scope
In legacy mode the test api scope is enabled by default when sdk_version
is set to something other than "none".
In non-legacy mode the test api scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
TestOptions
Test options.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
theme
string, optional theme name. If specified, the overlay package will be applied
only when the ro.boot.vendor.overlay.theme system property is set to the same value.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
unsafe_ignore_missing_latest_api
bool, A compatibility mode that allows historical API-tracking files to not exist.
Do not use.
updatable
bool, Whether this app is considered mainline updatable or not. When set to true, this will enforce
additional rules to make sure an app can safely be updated. Default is false.
Prefer using other specific properties if build behaviour must be changed; avoid using this
flag for anything but neverallow rules (unless the behaviour change is invisible to owners).
use_embedded_dex
bool, Store dex files uncompressed in the APK and set the android:useEmbeddedDex="true" manifest attribute so that
they are used from inside the APK at runtime.
use_embedded_native_libs
bool, Store native libraries uncompressed in the APK and set the android:extractNativeLibs="false" manifest
flag so that they are used from inside the APK at runtime. Defaults to true for android_test modules unless
sdk_version or min_sdk_version is set to a version that doesn't support it (<23), defaults to true for
android_app modules that are embedded to APEXes, defaults to false for other module types where the native
libraries are generally preinstalled outside the APK.
use_resource_processor
bool, If use_resource_processor is set, use Bazel's resource processor instead of aapt2 to generate R.class files.
The resource processor produces more optimal R.class files that only list resources in the package of the
library that provided them, as opposed to aapt2 which produces R.java files for every package containing
every resource. Using the resource processor can provide significant build time speedups, but requires
fixing the module to use the correct package to reference each resource, and to avoid having any other
libraries in the tree that use the same package name. Defaults to false, but will default to true in the
future.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_device_for_host
java_device_for_host makes the classes.jar output of a device java_library module available to host
java_library modules.
It is rarely necessary, and its usage is restricted to a few allowed projects.
name
,
defaults
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
libs
list of string, List of modules whose contents will be visible to modules that depend on this module.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_fuzz
java_fuzz builds and links sources into a `.jar` file for the device.
This generates .class files in a jar which can then be instrumented before
fuzzing in Android Runtime (ART: Android OS on emulator or device)
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aidl
,
arch
,
auto_gen_config
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
corpus
,
data
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dictionary
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
fuzz_config
,
fuzzing_frameworks
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
corpus
list of string, Optional list of seed files to be installed to the fuzz target's output
directory.
data
list of string, Optional list of data files to be installed to the fuzz target's output
directory. Directory structure relative to the module is preserved.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
dictionary
string, Optional dictionary to be installed to the fuzz target's output directory.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
fuzz_config
FuzzConfig, Config for running the target on fuzzing infrastructure.
fuzzing_frameworks
FuzzFrameworks, Define the fuzzing frameworks this fuzz target can be built for. If
empty then the fuzz target will be available to be built for all fuzz
frameworks available
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the test.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
Default: true
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
TestOptions
Test options.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_genrule
java_genrule is a genrule that can depend on other java_* objects.
By default a java_genrule has a single variant that will run against the device variant of its dependencies and
produce an output that can be used as an input to a device java rule.
Specifying `host_supported: true` will produce two variants, one that uses device dependencies and one that uses
host dependencies. Each variant will run the command.
Use a java_genrule instead of a genrule when it needs to depend on or be depended on by other java modules, unless
the dependency is for a generated source file.
Examples:
Use a java_genrule to package generated java resources:
java_genrule {
name: "generated_resources",
tools: [
"generator",
"soong_zip",
],
srcs: ["generator_inputs/**/*"],
out: ["generated_android_icu4j_resources.jar"],
cmd: "$(location generator) $(in) -o $(genDir) " +
"&& $(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res",
}
java_library {
name: "lib_with_generated_resources",
srcs: ["src/**/*.java"],
static_libs: ["generated_resources"],
}
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
arch
,
cmd
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
export_include_dirs
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_extension_version
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
tool_files
,
tools
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
write_if_changed
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of input files
exclude_srcs
list of string, input files to exclude
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
arch
interface
cmd
string, The command to run on one or more input files. Cmd supports substitution of a few variables.
Available variables for substitution:
$(location): the path to the first entry in tools or tool_files.
$(location <label>): the path to the tool, tool_file, input or output with name <label>. Use $(location) if <label> refers to a rule that outputs exactly one file.
$(locations <label>): the paths to the tools, tool_files, inputs or outputs with name <label>. Use $(locations) if <label> refers to a rule that outputs two or more files.
$(in): one or more input files.
$(out): a single output file.
$(genDir): the sandbox directory for this tool; contains $(out).
$$: a literal $
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_include_dirs
list of string, List of directories to export generated headers from
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕cmd
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_extension_version
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
tool_files
list of string, Local files that are used by the tool
tools
list of string, name of the modules (if any) that produces the host executable. Leave empty for
prebuilts or scripts that do not need a module to build them.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_if_changed
bool, Enable restat to update the output only if the output is changed
java_genrule_host
java_genrule_host is a genrule that can depend on other java_* objects.
A java_genrule_host has a single variant that will run against the host variant of its dependencies and
produce an output that can be used as an input to a host java rule.
name
,
srcs
,
exclude_srcs
,
defaults
,
arch
,
cmd
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
export_include_dirs
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_extension_version
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
tool_files
,
tools
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
write_if_changed
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of input files
exclude_srcs
list of string, input files to exclude
defaults
list of string
arch
interface
cmd
string, The command to run on one or more input files. Cmd supports substitution of a few variables.
Available variables for substitution:
$(location): the path to the first entry in tools or tool_files.
$(location <label>): the path to the tool, tool_file, input or output with name <label>. Use $(location) if <label> refers to a rule that outputs exactly one file.
$(locations <label>): the paths to the tools, tool_files, inputs or outputs with name <label>. Use $(locations) if <label> refers to a rule that outputs two or more files.
$(in): one or more input files.
$(out): a single output file.
$(genDir): the sandbox directory for this tool; contains $(out).
$$: a literal $
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_include_dirs
list of string, List of directories to export generated headers from
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕cmd
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_extension_version
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
tool_files
list of string, Local files that are used by the tool
tools
list of string, name of the modules (if any) that produces the host executable. Leave empty for
prebuilts or scripts that do not need a module to build them.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_if_changed
bool, Enable restat to update the output only if the output is changed
java_host_for_device
java_host_for_device makes the classes.jar output of a host java_library module available to device
java_library modules.
It is rarely necessary, and its usage is restricted to a few allowed projects.
name
,
defaults
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
libs
list of string, List of modules whose contents will be visible to modules that depend on this module.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_import
java_import imports one or more `.jar` files into the build graph as if they were built by a java_library module.
By default, a java_import has a single variant that expects a `.jar` file containing `.class` files that were
compiled against an Android classpath.
Specifying `host_supported: true` will produce two variants, one for use as a dependency of device modules and one
for host modules.
name
,
defaults
,
host_supported
,
device_supported
,
aidl
,
apex_available
,
arch
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
exclude_dirs
,
exclude_files
,
exclude_kotlinc_generated_files
,
host_required
,
init_rc
,
installable
,
is_stubs_module
,
jars
,
jetifier
,
libs
,
licenses
,
main_dex_rules
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
optimize
,
owner
,
permitted_packages
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
soc_specific
,
source_module_name
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
uncompress_dex
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
⊕aidl
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
profile_guided
bool, If true, use the profile in the prebuilt APEX to guide optimization. Defaults to false.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_dirs
list of string, List of directories to remove from the jar file(s)
exclude_files
list of string, List of files to remove from the jar file(s)
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool
is_stubs_module
bool, Property signifying whether the module provides stubs jar or not.
jars
list of string
jetifier
bool, if set to true, run Jetifier against .jar file. Defaults to false.
libs
list of string, List of shared java libs that this module has dependencies to
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
min_sdk_version
string, The minimum version of the SDK that this module supports. Defaults to sdk_version if not
specified.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
owner
string, vendor who owns this module
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, The max sdk version placeholder used to replace maxSdkVersion attributes on permission
and uses-permission tags in manifest_fixer.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, The version of the SDK that the source prebuilt file was built against. Defaults to the
current version if not specified.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
static_libs
list of string, List of static java libs that this module has dependencies to
stem
string, set the name of the output
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_import_host
java_import imports one or more `.jar` files into the build graph as if they were built by a java_library_host
module.
A java_import_host has a single variant that expects a `.jar` file containing `.class` files that were
compiled against a host bootclasspath.
name
,
defaults
,
aidl
,
apex_available
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
exclude_dirs
,
exclude_files
,
host_required
,
init_rc
,
installable
,
is_stubs_module
,
jars
,
jetifier
,
libs
,
licenses
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
owner
,
permitted_packages
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
soc_specific
,
source_module_name
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
⊕aidl
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_dirs
list of string, List of directories to remove from the jar file(s)
exclude_files
list of string, List of files to remove from the jar file(s)
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool
is_stubs_module
bool, Property signifying whether the module provides stubs jar or not.
jars
list of string
jetifier
bool, if set to true, run Jetifier against .jar file. Defaults to false.
libs
list of string, List of shared java libs that this module has dependencies to
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
min_sdk_version
string, The minimum version of the SDK that this module supports. Defaults to sdk_version if not
specified.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕product_variables.malloc_not_svelte
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, The max sdk version placeholder used to replace maxSdkVersion attributes on permission
and uses-permission tags in manifest_fixer.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, The version of the SDK that the source prebuilt file was built against. Defaults to the
current version if not specified.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
static_libs
list of string, List of static java libs that this module has dependencies to
stem
string, set the name of the output
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_library
java_library builds and links sources into a `.jar` file for the device, and possibly for the host as well.
By default, a java_library has a single variant that produces a `.jar` file containing `.class` files that were
compiled against the device bootclasspath. This jar is not suitable for installing on a device, but can be used
as a `static_libs` dependency of another module.
Specifying `installable: true` will product a `.jar` file containing `classes.dex` files, suitable for installing on
a device.
Specifying `host_supported: true` will produce two variants, one compiled against the device bootclasspath and one
compiled against the host bootclasspath.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aidl
,
apex_available
,
arch
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_only
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_only
bool, Indicates that the module and its source code are only used in tests, not
production code. Used by coverage reports and potentially other tools.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_library_host
java_library_host builds and links sources into a `.jar` file for the host.
A java_library_host has a single variant that produces a `.jar` file containing `.class` files that were
compiled against the host bootclasspath.
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
apex_available
,
arch
,
common_srcs
,
compile_data
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hiddenapi_additional_annotations
,
host_required
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
manifest
,
multilib
,
native_bridge_supported
,
openjdk9
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_tools_jar
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
manifest
string, manifest file to be included in resulting jar
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_library_static
java_library_static is an obsolete alias for java_library.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aidl
,
apex_available
,
arch
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_only
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_only
bool, Indicates that the module and its source code are only used in tests, not
production code. Used by coverage reports and potentially other tools.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_plugin
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
arch
,
common_srcs
,
compile_data
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
generates_api
,
headers_only
,
hiddenapi_additional_annotations
,
host_required
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
manifest
,
multilib
,
native_bridge_supported
,
openjdk9
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
plugins
,
processor_class
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_tools_jar
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
generates_api
bool, If true, assume the annotation processor will generate classes that are referenced from outside the module.
This necessitates disabling the turbine optimization on modules that use this plugin, which will reduce
parallelism and cause more recompilation for modules that depend on modules that use this plugin.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
manifest
string, manifest file to be included in resulting jar
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
plugins
list of string, List of modules to use as annotation processors
processor_class
string, The optional name of the class that javac will use to run the annotation processor.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_sdk_library
java_sdk_library is a special Java library that provides optional platform APIs to apps.
In practice, it can be viewed as a combination of several modules: 1) stubs library that clients
are linked against to, 2) droiddoc module that internally generates API stubs source files,
3) the real runtime shared library that implements the APIs, and 4) XML file for adding
the runtime lib to the classpath at runtime if requested via <uses-library>.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aconfig_declarations
,
aidl
,
annotations_enabled
,
apex_available
,
api_dir
,
api_lint
,
api_only
,
api_packages
,
api_srcs
,
arch
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
contribute_to_android_api
,
debug_ramdisk
,
default_to_stubs
,
device_specific
,
dex_preopt
,
dist
,
dist_group
,
dist_stem
,
dists
,
doctag_files
,
droiddoc_option_files
,
droiddoc_options
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hidden_api_packages
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
impl_library_visibility
,
impl_only_libs
,
impl_only_static_libs
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_device_sdk
,
max_sdk_version
,
merge_annotations_dirs
,
merge_inclusion_annotations_dirs
,
min_device_sdk
,
min_sdk_version
,
module_lib
,
multilib
,
naming_scheme
,
native_bridge_supported
,
no_dist
,
on_bootclasspath_before
,
on_bootclasspath_since
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
public
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
shared_library
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
stub_only_libs
,
stub_only_static_libs
,
stubs_library_visibility
,
stubs_source_visibility
,
system
,
system_ext_specific
,
system_modules
,
system_server
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test
,
uncompress_dex
,
unsafe_ignore_missing_latest_api
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
aconfig_declarations
list of string, a list of aconfig_declarations module names that the stubs generated in this module
depend on.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
annotations_enabled
bool, is set to true, Metalava will allow framework SDK to contain annotations.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
api_dir
string, the relative path to the directory containing the api specification files.
Defaults to "api".
⊕api_lint
Properties related to api linting.
enabled
bool, Enable api linting.
legacy_errors_allowed
bool, If API lint is enabled, this flag controls whether a set of legitimate lint errors
are turned off. The default is true.
api_only
bool, Determines whether a runtime implementation library is built; defaults to false.
If true then it also prevents the module from being used as a shared module, i.e.
it is as if shared_library: false, was set.
api_packages
list of string, list of package names that will be documented and publicized as API.
This allows the API to be restricted to a subset of the source files provided.
If this is unspecified then all the source files will be treated as being part
of the API.
api_srcs
list of string, List of source files that are needed to compile the API, but are not part of runtime library.
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contribute_to_android_api
bool, Determines if the module contributes to any api surfaces.
This property should be set to true only if the module is listed under
frameworks-base-api.bootclasspath in frameworks/base/api/Android.bp.
Otherwise, this property should be set to false.
Defaults to false.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
default_to_stubs
bool, Determines if the stubs are preferred over the implementation library
for linking, even when the client doesn't specify sdk_version. When this
is set to true, such clients are provided with the widest API surface that
this lib provides. Note however that this option doesn't affect the clients
that are in the same APEX as this library. In that case, the clients are
always linked with the implementation library. Default is false.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dist_group
string, The subdirectory for the artifacts that are copied to the dist directory. If not specified
then defaults to "unknown". Should be set to "android" for anything that should be published
in the public Android SDK.
dist_stem
string, The stem for the artifacts that are copied to the dist, if not specified
then defaults to the base module name.
For each scope the following artifacts are copied to the apistubs/<scope>
directory in the dist.
* stubs impl jar -> <dist-stem>.jar
* API specification file -> api/<dist-stem>.txt
* Removed API specification file -> api/<dist-stem>-removed.txt
Also used to construct the name of the filegroup (created by prebuilt_apis)
that references the latest released API and remove API specification files.
* API specification filegroup -> <dist-stem>.api.<scope>.latest
* Removed API specification filegroup -> <dist-stem>-removed.api.<scope>.latest
* API incompatibilities baseline filegroup -> <dist-stem>-incompatibilities.api.<scope>.latest
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
doctag_files
list of string, Files containing information about supported java doc tags.
droiddoc_option_files
list of string, local files that are used within user customized droiddoc options.
droiddoc_options
list of string, additional droiddoc options.
Available variables for substitution:
$(location <label>): the path to the droiddoc_option_files with name <label>
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hidden_api_packages
list of string, list of package names that must be hidden from the API
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
impl_library_visibility
list of string, Visibility for impl library module. If not specified then defaults to the
visibility property.
impl_only_libs
list of string, List of Java libraries that will be in the classpath when building the implementation lib
impl_only_static_libs
list of string, List of Java libraries that will included in the implementation lib.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_device_sdk
string, Indicates that PackageManager should ignore this shared library if the
platform is above the version indicated in this attribute.
This means that the device won't recognise this library as installed.
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
merge_annotations_dirs
list of string, a list of top-level directories containing files to merge qualifier annotations
(i.e. those intended to be included in the stubs written) from.
merge_inclusion_annotations_dirs
list of string, a list of top-level directories containing Java stub files to merge show/hide annotations from.
min_device_sdk
string, Indicates that PackageManager should ignore this shared library if the
platform is below the version indicated in this attribute.
This means that the device won't recognise this library as installed.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
⊕module_lib
ApiScopeProperties
The properties specific to the module-lib api scope
Unless explicitly specified by using module_lib.enabled the module_lib api
scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
multilib
interface
naming_scheme
string, The naming scheme to use for the components that this module creates.
If not specified then it defaults to "default".
This is a temporary mechanism to simplify conversion from separate modules for each
component that follow a different naming pattern to the default one.
TODO(b/155480189) - Remove once naming inconsistencies have been resolved.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
no_dist
bool, If set to true then don't create dist rules.
on_bootclasspath_before
string, Signals that this shared library was part of the bootclasspath before
(but not including) the version indicated in this attribute.
The system will automatically add a <uses-library> tag with this library to
apps that target any SDK less than the version indicated in this attribute.
on_bootclasspath_since
string, Signals that this shared library is part of the bootclasspath starting
on the version indicated in this attribute.
This will make platforms at this level and above to ignore
<uses-library> tags with this library name because the library is already
available
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
⊕public
ApiScopeProperties
The properties specific to the public api scope
Unless explicitly specified by using public.enabled the public api scope is
enabled by default in both legacy and non-legacy mode.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
shared_library
bool, Specifies whether this module can be used as an Android shared library; defaults
to true.
An Android shared library is one that can be referenced in a <uses-library> element
in an AndroidManifest.xml.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
stub_only_libs
list of string, List of Java libraries that will be in the classpath when building stubs
stub_only_static_libs
list of string, List of Java libraries that will included in stub libraries
stubs_library_visibility
list of string, Visibility for stubs library modules. If not specified then defaults to the
visibility property.
stubs_source_visibility
list of string, Visibility for stubs source modules. If not specified then defaults to the
visibility property.
⊕system
ApiScopeProperties
The properties specific to the system api scope
In legacy mode the system api scope is enabled by default when sdk_version
is set to something other than "none".
In non-legacy mode the system api scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
⊕system_server
ApiScopeProperties
The properties specific to the system-server api scope
Unless explicitly specified by using system_server.enabled the
system_server api scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
⊕test
ApiScopeProperties
The properties specific to the test api scope
In legacy mode the test api scope is enabled by default when sdk_version
is set to something other than "none".
In non-legacy mode the test api scope is disabled by default.
enabled
bool, Indicates whether the api surface is generated.
If this is set for any scope then all scopes must explicitly specify if they
are enabled. This is to prevent new usages from depending on legacy behavior.
Otherwise, if this is not set for any scope then the default behavior is
scope specific so please refer to the scope specific property documentation.
sdk_version
string, The sdk_version to use for building the stubs.
If not specified then it will use an sdk_version determined as follows:
1) If the sdk_version specified on the java_sdk_library is none then this
will be none. This is used for java_sdk_library instances that are used
to create stubs that contribute to the core_current sdk version.
2) Otherwise, it is assumed that this library extends but does not
contribute directly to a specific sdk_version and so this uses the
sdk_version appropriate for the api scope. e.g. public will use
sdk_version: current, system will use sdk_version: system_current, etc.
This does not affect the sdk_version used for either generating the stubs source
or the API file. They both have to use the same sdk_version as is used for
compiling the implementation library.
libs
list of string, Extra libs used when compiling stubs for this scope.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
unsafe_ignore_missing_latest_api
bool, A compatibility mode that allows historical API-tracking files to not exist.
Do not use.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_sdk_library_import
java_sdk_library_import imports a prebuilt java_sdk_library.
name
,
defaults
,
host_supported
,
device_supported
,
apex_available
,
arch
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
doctag_files
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
max_device_sdk
,
min_device_sdk
,
module_lib
,
multilib
,
naming_scheme
,
native_bridge_supported
,
on_bootclasspath_before
,
on_bootclasspath_since
,
owner
,
permitted_packages
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
public
,
ramdisk
,
recovery
,
required
,
shared_library
,
soc_specific
,
source_module_name
,
system
,
system_ext_specific
,
system_server
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_dex
bool, If set to true, compile dex files for the stubs. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
profile_guided
bool, If true, use the profile in the prebuilt APEX to guide optimization. Defaults to false.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
doctag_files
list of string, Files containing information about supported java doc tags.
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
libs
list of string, List of shared java libs, common to all scopes, that this module has
dependencies to
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
max_device_sdk
string, Indicates that PackageManager should ignore this shared library if the
platform is above the version indicated in this attribute.
This means that the device won't recognise this library as installed.
min_device_sdk
string, Indicates that PackageManager should ignore this shared library if the
platform is below the version indicated in this attribute.
This means that the device won't recognise this library as installed.
⊕module_lib
sdkLibraryScopeProperties
Properties associated with each api scope.
jars
list of string
sdk_version
string
libs
list of string, List of shared java libs that this module has dependencies to
stub_srcs
list of string, The stubs source.
current_api
string, The current.txt
removed_api
string, The removed.txt
annotations
string, Annotation zip
multilib
interface
naming_scheme
string, The naming scheme to use for the components that this module creates.
If not specified then it defaults to "default".
This is a temporary mechanism to simplify conversion from separate modules for each
component that follow a different naming pattern to the default one.
TODO(b/155480189) - Remove once naming inconsistencies have been resolved.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
on_bootclasspath_before
string, Signals that this shared library was part of the bootclasspath before
(but not including) the version indicated in this attribute.
The system will automatically add a <uses-library> tag with this library to
apps that target any SDK less than the version indicated in this attribute.
on_bootclasspath_since
string, Signals that this shared library is part of the bootclasspath starting
on the version indicated in this attribute.
This will make platforms at this level and above to ignore
<uses-library> tags with this library name because the library is already
available
owner
string, vendor who owns this module
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕public
sdkLibraryScopeProperties
Properties associated with each api scope.
jars
list of string
sdk_version
string
libs
list of string, List of shared java libs that this module has dependencies to
stub_srcs
list of string, The stubs source.
current_api
string, The current.txt
removed_api
string, The removed.txt
annotations
string, Annotation zip
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
shared_library
bool, Specifies whether this module can be used as an Android shared library; defaults
to true.
An Android shared library is one that can be referenced in a <uses-library> element
in an AndroidManifest.xml.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
⊕system
sdkLibraryScopeProperties
Properties associated with each api scope.
jars
list of string
sdk_version
string
libs
list of string, List of shared java libs that this module has dependencies to
stub_srcs
list of string, The stubs source.
current_api
string, The current.txt
removed_api
string, The removed.txt
annotations
string, Annotation zip
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕system_server
sdkLibraryScopeProperties
Properties associated with each api scope.
jars
list of string
sdk_version
string
libs
list of string, List of shared java libs that this module has dependencies to
stub_srcs
list of string, The stubs source.
current_api
string, The current.txt
removed_api
string, The removed.txt
annotations
string, Annotation zip
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
⊕test
sdkLibraryScopeProperties
Properties associated with each api scope.
jars
list of string
sdk_version
string
libs
list of string, List of shared java libs that this module has dependencies to
stub_srcs
list of string, The stubs source.
current_api
string, The current.txt
removed_api
string, The removed.txt
annotations
string, Annotation zip
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_system_modules
java_system_modules creates a system module from a set of java libraries that can
be referenced from the system_modules property. It must contain at a minimum the
java.base module which must include classes from java.lang amongst other java packages.
name
,
defaults
,
host_supported
,
device_supported
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
libs
list of string, List of java library modules that should be included in the system modules
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_system_modules_import
A prebuilt version of java_system_modules. It does not import the
generated system module, it generates the system module from imported
java libraries in the same way that java_system_modules does. It just
acts as a prebuilt, i.e. can have the same base name as another module
type and the one to use is selected at runtime.
name
,
defaults
,
host_supported
,
device_supported
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
source_module_name
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
libs
list of string, List of java library modules that should be included in the system modules
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_test
java_test builds a and links sources into a `.jar` file for the device, and possibly for the host as well, and
creates an `AndroidTest.xml` file to allow running the test with `atest` or a `TEST_MAPPING` file.
By default, a java_test has a single variant that produces a `.jar` file containing `classes.dex` files that were
compiled against the device bootclasspath.
Specifying `host_supported: true` will produce two variants, one compiled against the device bootclasspath and one
compiled against the host bootclasspath.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aidl
,
arch
,
auto_gen_config
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
data
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the test.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
Default: true
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
TestOptions
Test options.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_test_helper_library
java_test_helper_library creates a java library and makes sure that it is added to the appropriate test suite.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_Cache_files
,
aidl
,
arch
,
common_srcs
,
compile_data
,
compile_dex
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dex_preopt
,
dist
,
dists
,
dxflags
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_kotlinc_generated_files
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hidden_api
,
hiddenapi_additional_annotations
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
main_dex_rules
,
manifest
,
max_sdk_version
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
openjdk9
,
optimize
,
optional_uses_libs
,
owner
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
team
,
test_suites
,
uncompress_dex
,
use_tools_jar
,
uses_libs
,
v4_signature
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
generate_traces
bool, whether to generate traces (for systrace) for this interface
generate_get_transaction_name
bool, whether to generate Binder#GetTransaction name method.
enforce_permissions
bool, whether all interfaces should be annotated with required permissions.
enforce_permissions_exceptions
list of string, allowlist for interfaces that (temporarily) do not require annotation for permissions.
flags
list of string, list of flags that will be passed to the AIDL compiler
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_dex
bool, If set to true, compile dex regardless of installable. Defaults to false.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dex_preopt
enabled
bool, If false, prevent dexpreopting. Defaults to true.
app_image
bool, If true, generate an app image (.art file) for this module.
profile_guided
bool, If true, use a checked-in profile to guide optimization. Defaults to false unless
a matching profile is set or a profile is found in PRODUCT_DEX_PREOPT_PROFILE_DIR
that matches the name of this module, in which case it is defaulted to true.
profile
string, If set, provides the path to profile relative to the Android.bp file. If not set,
defaults to searching for a file that matches the name of this module in the default
profile location set by PRODUCT_DEX_PREOPT_PROFILE_DIR, or empty if not found.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dxflags
list of string, list of module-specific flags that will be used for dex compiles
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_kotlinc_generated_files
bool, Exclude kotlinc generate files: *.kotlin_module, *.kotlin_builtins. Defaults to false.
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
⊕hidden_api
package_prefixes
list of string, Contains prefixes of a package hierarchy that is provided solely by this
bootclasspath_fragment.
This affects the signature patterns file that is used to select the subset of monolithic
hidden API flags. See split_packages property for more details.
single_packages
list of string, A list of individual packages that are provided solely by this
bootclasspath_fragment but which cannot be listed in package_prefixes
because there are sub-packages which are provided by other modules.
This should only be used for legacy packages. New packages should be
covered by a package prefix.
split_packages
list of string, The list of split packages provided by this bootclasspath_fragment.
A split package is one that contains classes which are provided by multiple
bootclasspath_fragment modules.
This defaults to "*" - which treats all packages as being split. A module that has no split
packages must specify an empty list.
This affects the signature patterns file that is generated by a bootclasspath_fragment and
used to select the subset of monolithic hidden API flags against which the flags generated
by the bootclasspath_fragment are compared.
The signature patterns file selects the subset of monolithic hidden API flags using a number
of patterns, i.e.:
* The qualified name (including package) of an outermost class, e.g. java/lang/Character.
This selects all the flags for all the members of this class and any nested classes.
* A package wildcard, e.g. java/lang/*. This selects all the flags for all the members of all
the classes in this package (but not in sub-packages).
* A recursive package wildcard, e.g. java/**. This selects all the flags for all the members
of all the classes in this package and sub-packages.
The signature patterns file is constructed as follows:
* All the signatures are retrieved from the all-flags.csv file.
* The member and inner class names are removed.
* If a class is in a split package then that is kept, otherwise the class part is removed
and replaced with a wildcard, i.e. *.
* If a package matches a package prefix then the package is removed.
* All the package prefixes are added with a recursive wildcard appended to each, i.e. **.
* The resulting patterns are sorted.
So, by default (i.e. without specifying any package_prefixes or split_packages) the signature
patterns is a list of class names, because there are no package packages and all packages are
assumed to be split.
If any split packages are specified then only those packages are treated as split and all
other packages are treated as belonging solely to the bootclasspath_fragment and so they use
wildcard package patterns.
So, if an empty list of split packages is specified then the signature patterns file just
includes a wildcard package pattern for every package provided by the bootclasspath_fragment.
If split_packages are specified and a package that is split is not listed then it could lead
to build failures as it will select monolithic flags that are generated by another
bootclasspath_fragment to compare against the flags provided by this fragment. The latter
will obviously not contain those flags and that can cause the comparison and build to fail.
If any package prefixes are specified then any matching packages are removed from the
signature patterns and replaced with a single recursive package pattern.
It is not strictly necessary to specify either package_prefixes or split_packages as the
defaults will produce a valid set of signature patterns. However, those patterns may include
implementation details, e.g. names of implementation classes or packages, which will be
exported to the sdk snapshot in the signature patterns file. That is something that should be
avoided where possible. Specifying package_prefixes and split_packages allows those
implementation details to be excluded from the snapshot.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
hostdex
bool, If true, export a copy of the module as a -hostdex module for host testing.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
⊕lint
Controls for running Android Lint on the module.
enabled
bool, If true, run Android Lint on the module. Defaults to true.
flags
list of string, Flags to pass to the Android Lint tool.
fatal_checks
list of string, Checks that should be treated as fatal.
error_checks
list of string, Checks that should be treated as errors.
warning_checks
list of string, Checks that should be treated as warnings.
disabled_checks
list of string, Checks that should be skipped.
baseline_filename
string, The lint baseline file to use. If specified, lint warnings listed in this file will be
suppressed during lint checks.
strict_updatability_linting
bool, If true, baselining updatability lint checks (e.g. NewApi) is prohibited. Defaults to false.
test
bool, Treat the code in this module as test code for @VisibleForTesting enforcement.
This will be true by default for test module types, false otherwise.
If soong gets support for testonly, this flag should be replaced with that.
Default: true
suppress_exit_code
bool, Whether to ignore the exit code of Android lint. This is the --exit_code
option. Defaults to false.
main_dex_rules
list of string, A list of files containing rules that specify the classes to keep in the main dex file.
manifest
string, manifest file to be included in resulting jar
max_sdk_version
string, if not blank, set the maximum version of the sdk that the compiled artifacts will run against.
Defaults to empty string "". See sdk_version for possible values.
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set. See sdk_version for possible values.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
⊕optimize
enabled
bool, If false, disable all optimization. Defaults to true for android_app and
android_test_helper_app modules, false for android_test, java_library, and java_test modules.
ignore_warnings
bool, Whether to continue building even if warnings are emitted. Defaults to true.
proguard_compatibility
bool, If true, runs R8 in Proguard compatibility mode, otherwise runs R8 in full mode.
Defaults to false for apps, true for libraries and tests.
shrink
bool, If true, optimize for size by removing unused code. Defaults to true for apps,
false for libraries and tests.
optimize
bool, If true, optimize bytecode. Defaults to false.
obfuscate
bool, If true, obfuscate bytecode. Defaults to false.
no_aapt_flags
bool, If true, do not use the flag files generated by aapt that automatically keep
classes referenced by the app manifest. Defaults to false.
shrink_resources
bool, If true, optimize for size by removing unused resources. Defaults to false.
optimized_shrink_resources
bool, If true, use optimized resource shrinking in R8, overriding the
Shrink_resources setting. Defaults to false.
Optimized shrinking means that R8 will trace and treeshake resources together with code
and apply additional optimizations. This implies non final fields in the R classes.
proguard_flags
list of string, Flags to pass to proguard.
proguard_flags_files
list of string, Specifies the locations of files containing proguard flags.
export_proguard_flags_files
bool, If true, transitive reverse dependencies of this module will have this
module's proguard spec appended to their optimization action
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
platform_apis
bool, Whether to compile against the platform APIs instead of an SDK.
If true, then sdk_version must be empty. The value of this field
is ignored when module's type isn't android_app, android_test, or android_test_helper_app.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.eng
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of string, List of extra options that will be passed to the proto generator.
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, if not blank, set the maxSdkVersion properties of permission and uses-permission tags.
Defaults to empty string "". See sdk_version for possible values.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, If not blank, set to the version of the sdk to compile against.
Defaults to an empty string, which compiles the module against the private platform APIs.
Values are of one of the following forms:
1) numerical API level, "current", "none", or "core_platform"
2) An SDK kind with an API level: "<sdk kind>_<API level>"
See build/soong/android/sdk_version.go for the complete and up to date list of SDK kinds.
If the SDK kind is empty, it will be set to public.
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
target
interface
⊕target.android
⊕target.host
⊕target.hostdex
required
list of string, Additional required dependencies to add to -hostdex modules.
target_required
list of string, names of other modules to install on target if this module is installed
target_sdk_version
string, if not blank, set the targetSdkVersion in the AndroidManifest.xml.
Defaults to sdk_version if not set. See sdk_version for possible values.
team
string, The team (defined by the owner/vendor) who owns the property.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
uncompress_dex
bool, Keep the data uncompressed. We always need uncompressed dex for execution,
so this might actually save space by avoiding storing the same data twice.
This defaults to reasonable value based on module and should not be set.
It exists only to support ART tests.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
v4_signature
bool, If true, generate the signature file of APK Signing Scheme V4, along side the signed APK file.
Defaults to false.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_test_host
java_test_host builds a and links sources into a `.jar` file for the host, and creates an `AndroidTest.xml` file to
allow running the test with `atest` or a `TEST_MAPPING` file.
A java_test_host has a single variant that produces a `.jar` file containing `.class` files that were
compiled against the host bootclasspath.
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
arch
,
auto_gen_config
,
common_srcs
,
compile_data
,
compile_multilib
,
data
,
data_device_bins_32
,
data_device_bins_64
,
data_device_bins_both
,
data_device_bins_first
,
data_device_bins_prefer32
,
data_native_bins
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hiddenapi_additional_annotations
,
host_required
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
jni_libs
,
kotlincflags
,
libs
,
licenses
,
manifest
,
multilib
,
native_bridge_supported
,
openjdk9
,
optional_uses_libs
,
owner
,
patch_module
,
per_testcase_directory
,
permitted_packages
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_config_template
,
test_mainline_modules
,
test_options
,
test_suites
,
use_tools_jar
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
data_device_bins_32
list of string, list of device binary modules that should be installed alongside the test
This property only adds 32bit variants of the dependency
data_device_bins_64
list of string, list of device binary modules that should be installed alongside the test
This property only adds 64bit variants of the dependency
data_device_bins_both
list of string, list of device binary modules that should be installed alongside the test
This property adds 64bit AND 32bit variants of the dependency
data_device_bins_first
list of string, list of device binary modules that should be installed alongside the test
This property only adds the first variant of the dependency
data_device_bins_prefer32
list of string, list of device binary modules that should be installed alongside the test
This property adds 32bit variants of the dependency if available, or else
defaults to the 64bit variant
data_native_bins
list of string, list of native binary modules that should be installed alongside the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
jni_libs
list of string, Names of modules containing JNI libraries that should be installed alongside the test.
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
manifest
string, manifest file to be included in resulting jar
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
per_testcase_directory
bool, Install the test into a folder named for the module in all test suites.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_mainline_modules
list of string, Add parameterized mainline modules to auto generated test config. The options will be
handled by TradeFed to do downloading and installing the specified modules on the device.
⊕test_options
TestOptions
Test options.
tradefed_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file. The "key"
is optional in each of these.
test_runner_options
list of *ast.SelectorExpr, Extra <option> tags to add to the auto generated test xml file under the test runner, e.g., AndroidJunitTest.
The "key" is optional in each of these.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
java_test_import
java_test_import imports one or more `.jar` files into the build graph as if they were built by a java_test module
and makes sure that it is added to the appropriate test suite.
By default, a java_test_import has a single variant that expects a `.jar` file containing `.class` files that were
compiled against an Android classpath.
Specifying `host_supported: true` will produce two variants, one for use as a dependency of device modules and one
for host modules.
name
,
defaults
,
host_supported
,
device_supported
,
aidl
,
apex_available
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
exclude_dirs
,
exclude_files
,
host_required
,
init_rc
,
installable
,
is_stubs_module
,
jars
,
jetifier
,
libs
,
licenses
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
owner
,
permitted_packages
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
replace_max_sdk_version_placeholder
,
required
,
sdk_version
,
soc_specific
,
source_module_name
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_suites
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
⊕aidl
export_include_dirs
list of string, directories that should be added as include directories for any aidl sources of modules
that depend on this module, as well as to aidl for this module.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_dirs
list of string, List of directories to remove from the jar file(s)
exclude_files
list of string, List of files to remove from the jar file(s)
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool
Default: true
is_stubs_module
bool, Property signifying whether the module provides stubs jar or not.
jars
list of string
jetifier
bool, if set to true, run Jetifier against .jar file. Defaults to false.
libs
list of string, List of shared java libs that this module has dependencies to
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
min_sdk_version
string, The minimum version of the SDK that this module supports. Defaults to sdk_version if not
specified.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕product_variables.malloc_not_svelte
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
replace_max_sdk_version_placeholder
string, The max sdk version placeholder used to replace maxSdkVersion attributes on permission
and uses-permission tags in manifest_fixer.
required
list of string, names of other modules to install if this module is installed
sdk_version
string, The version of the SDK that the source prebuilt file was built against. Defaults to the
current version if not specified.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
static_libs
list of string, List of static java libs that this module has dependencies to
stem
string, set the name of the output
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
javadoc
javadoc converts .java source files to documentation using javadoc.
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aidl
,
arch
,
arg_files
,
args
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
filter_packages
,
flags
,
host_required
,
init_rc
,
installable
,
java_version
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
sdk_version
,
soc_specific
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
javadoc_host
javadoc_host converts .java source files to documentation using javadoc.
name
,
srcs
,
exclude_srcs
,
defaults
,
aidl
,
arch
,
arg_files
,
args
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
filter_packages
,
flags
,
host_required
,
init_rc
,
installable
,
java_version
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
out
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
sdk_version
,
soc_specific
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
override_android_app
override_android_app is used to create an android_app module based on another android_app by overriding
some of its properties.
name
,
arch
,
base
,
certificate
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
lineage
,
logging_parent
,
multilib
,
native_bridge_supported
,
overrides
,
owner
,
package_name
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
rename_resources_package
,
required
,
rotationMinSdkVersion
,
soc_specific
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
base
string, Name of the base module to be overridden
certificate
string, The name of a certificate in the default certificate directory, blank to use the default product certificate,
or an android_app_certificate module name in the form ":module".
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
logging_parent
string, the logging parent of this app.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
rename_resources_package
bool, Whether to rename the package in resources to the override name rather than the base name. Defaults to true.
required
list of string, names of other modules to install if this module is installed
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
override_android_test
override_android_test is used to create an android_app module based on another android_test by overriding
some of its properties.
name
,
arch
,
base
,
certificate
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
instrumentation_for
,
instrumentation_target_package
,
licenses
,
lineage
,
logging_parent
,
mainline_package_name
,
manifest_values
,
multilib
,
native_bridge_supported
,
overrides
,
owner
,
package_name
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
rename_resources_package
,
required
,
rotationMinSdkVersion
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
base
string, Name of the base module to be overridden
certificate
string, The name of a certificate in the default certificate directory, blank to use the default product certificate,
or an android_app_certificate module name in the form ":module".
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
instrumentation_for
string, The name of the android_app module that the tests will run against.
instrumentation_target_package
string, If specified, the instrumentation target package name in the manifest is overwritten by it.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file or filegroup module.
logging_parent
string, the logging parent of this app.
mainline_package_name
string, If specified, the mainline module package name in the test config is overwritten by it.
⊕manifest_values
Manifest_values
applicationId
string, Overrides the value of package_name in the manifest
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
overrides
list of string, Names of modules to be overridden. Listed modules can only be other binaries
(in Make or Soong).
This does not completely prevent installation of the overridden binaries, but if both
binaries would be installed by default (in PRODUCT_PACKAGES) the other binary will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
rename_resources_package
bool, Whether to rename the package in resources to the override name rather than the base name. Defaults to true.
required
list of string, names of other modules to install if this module is installed
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
override_runtime_resource_overlay
override_runtime_resource_overlay is used to create a module based on another
runtime_resource_overlay module by overriding some of its properties.
name
,
arch
,
base
,
category
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
package_name
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_package_name
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
base
string, Name of the base module to be overridden
category
string, the rro category of this overlay. The category in the manifest file is used if one was not given.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_package_name
string, the target package name of this overlay app. The target package name in the manifest file is used if one was not given.
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
fragments
,
generate_classpaths_proto
,
hidden_api
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
fragments
list of ApexVariantReference, The names of the bootclasspath_fragment modules that form part of this module.
generate_classpaths_proto
bool, Whether to generated classpaths.proto config instance for the fragment. If the config is not
generated, then relevant boot jars are added to platform classpath, i.e. platform_bootclasspath
or platform_systemserverclasspath. This is useful for non-updatable APEX boot jars, to keep
them as part of dexopt on device. Defaults to true.
⊕hidden_api
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
name
,
src
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
src
string
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
generate_classpaths_proto
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
generate_classpaths_proto
bool, Whether to generated classpaths.proto config instance for the fragment. If the config is not
generated, then relevant boot jars are added to platform classpath, i.e. platform_bootclasspath
or platform_systemserverclasspath. This is useful for non-updatable APEX boot jars, to keep
them as part of dexopt on device. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
prebuilt_apis
prebuilt_apis is a meta-module that generates modules for all API txt files
found under the directory where the Android.bp is located.
Specifically, an API file located at ./<ver>/<scope>/api/<module>.txt
generates a module named <module>-api.<scope>.<ver>.
It also creates <module>-api.<scope>.latest for the latest <ver>.
Similarly, it generates a java_import for all API .jar files found under the
directory where the Android.bp is located. Specifically, an API file located
at ./<ver>/<scope>/api/<module>.jar generates a java_import module named
<prebuilt-api-module>_<scope>_<ver>_<module>, and for SDK versions >= 30
a java_system_modules module named
<prebuilt-api-module>_public_<ver>_system_modules
name
,
allow_incremental_platform_api
,
api_dirs
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
extensions_dir
,
host_required
,
imports_compile_dex
,
imports_sdk_version
,
init_rc
,
licenses
,
native_bridge_supported
,
next_api_dir
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
allow_incremental_platform_api
bool, If set to true, allow incremental platform API of the form MM.m where MM is the major release
version corresponding to the API level/SDK_INT and m is an incremental release version
(e.g. API changes associated with QPR). Defaults to false.
api_dirs
list of string, list of api version directories
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
extensions_dir
string, Directory containing finalized api txt files for extension versions.
Extension versions higher than the base sdk extension version will
be assumed to be finalized later than all Api_dirs.
host_required
list of string, names of other modules to install on host if this module is installed
imports_compile_dex
bool, If set to true, compile dex for java_import modules. Defaults to false.
imports_sdk_version
string, The sdk_version of java_import modules generated based on jar files.
Defaults to "current"
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
next_api_dir
string, The next API directory can optionally point to a directory where
files incompatibility-tracking files are stored for the current
"in progress" API. Each module present in one of the api_dirs will have
a <module>-incompatibilities.api.<scope>.latest module created.
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
prebuilt_bootclasspath_fragment
name
,
host_supported
,
device_supported
,
additional_stubs
,
apex_available
,
api
,
arch
,
compile_multilib
,
contents
,
core_platform_api
,
coverage
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
fragments
,
hidden_api
,
host_required
,
image_name
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
additional_stubs
list of string, The list of additional stub libraries which this fragment's contents use but which are not
provided by another bootclasspath_fragment.
Note, "android-non-updatable" is treated specially. While no such module exists it is treated
as if it was a java_sdk_library. So, when public API stubs are needed then it will be replaced
with "android-non-updatable.stubs", with "androidn-non-updatable.system.stubs" when the system
stubs are needed and so on.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕coverage
BootclasspathFragmentCoverageAffectedProperties
contents
list of string, The contents of this bootclasspath_fragment, could be either java_library, or java_sdk_library.
A java_sdk_library specified here will also be treated as if it was specified on the stub_libs
property.
The order of this list matters as it is the order that is used in the bootclasspath.
⊕api
BootclasspathNestedAPIProperties
Api properties provide information about the APIs provided by the bootclasspath_fragment.
Properties in this section apply to public, system and test api scopes. They DO NOT apply to
core_platform as that is a special, ART specific scope, that does not follow the pattern and so
has its own section. It is in the process of being deprecated and replaced by the system scope
but this will remain for the foreseeable future to maintain backwards compatibility.
Every bootclasspath_fragment must specify at least one stubs_lib in this section and must
specify stubs for all the APIs provided by its contents. Failure to do so will lead to those
methods being inaccessible to other parts of Android, including but not limited to
applications.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
⊕core_platform_api
BootclasspathNestedAPIProperties
Properties related to the core platform API surface.
This must only be used by the following modules:
* ART
* Conscrypt
* I18N
The bootclasspath_fragments for each of the above modules must specify at least one stubs_lib
and must specify stubs for all the APIs provided by its contents. Failure to do so will lead to
those methods being inaccessible to the other modules in the list.
stub_libs
list of string, java_library or preferably, java_sdk_library modules providing stub classes that define the
APIs provided by this bootclasspath_fragment.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
fragments
list of ApexVariantReference, The names of the bootclasspath_fragment modules that form part of this module.
⊕hidden_api
annotation_flags
string, The path to the annotation-flags.csv file created by the bootclasspath_fragment.
metadata
string, The path to the metadata.csv file created by the bootclasspath_fragment.
index
string, The path to the index.csv file created by the bootclasspath_fragment.
signature_patterns
string, The path to the signature-patterns.csv file created by the bootclasspath_fragment.
stub_flags
string, The path to the stub-flags.csv file created by the bootclasspath_fragment.
all_flags
string, The path to the all-flags.csv file created by the bootclasspath_fragment.
filtered_stub_flags
string, The path to the filtered-stub-flags.csv file created by the bootclasspath_fragment.
filtered_flags
string, The path to the filtered-flags.csv file created by the bootclasspath_fragment.
unsupported
list of string, Marks each signature in the referenced files as being unsupported.
removed
list of string, Marks each signature in the referenced files as being unsupported because it has been
removed. Any conflicts with other flags are ignored.
max_target_r_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= R and low priority.
max_target_q
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= Q.
max_target_p
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= P.
max_target_o_low_priority
list of string, Marks each signature in the referenced files as being supported only for
targetSdkVersion <= O
and low priority. Any conflicts with other flags are ignored.
blocked
list of string, Marks each signature in the referenced files as being blocked.
unsupported_packages
list of string, Marks each signature in every package in the referenced files as being unsupported.
host_required
list of string, names of other modules to install on host if this module is installed
image_name
string, The name of the image this represents.
If specified then it must be one of "art" or "boot".
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
A prebuilt version of platform_compat_config that provides the metadata.
name
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
metadata
,
multilib
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
source_module_name
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
metadata
string
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
prebuilt_stubs_sources
prebuilt_stubs_sources imports a set of java source files as if they were
generated by droidstubs.
By default, a prebuilt_stubs_sources has a single variant that expects a
set of `.java` files generated by droidstubs.
Specifying `host_supported: true` will produce two variants, one for use as a dependency of device modules and one
for host modules.
Intended only for use by sdk snapshots.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
arch
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
source_module_name
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_module_name
string, Name of the source soong module that gets shadowed by this prebuilt
If unspecified, follows the naming convention that the source module of
the prebuilt is Name() without "prebuilt_" prefix
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
prebuilt_systemserverclasspath_fragment
name
,
apex_available
,
arch
,
compile_multilib
,
contents
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
prefer
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
standalone_contents
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_source_config_var
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contents
list of string, List of system_server classpath jars, could be either java_library, or java_sdk_library.
The order of this list matters as it is the order that is used in the SYSTEMSERVERCLASSPATH.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
prefer
bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
standalone_contents
list of string, List of jars that system_server loads dynamically using separate classloaders.
The order does not matter.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
runtime_resource_overlay
runtime_resource_overlay generates a resource-only apk file that can overlay application and
system resources at run time.
name
,
defaults
,
aapt_include_all_resources
,
aaptflags
,
additional_manifests
,
arch
,
asset_dirs
,
assets
,
category
,
certificate
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
dont_merge_manifests
,
enabled
,
flags_packages
,
host_required
,
init_rc
,
licenses
,
lineage
,
manifest
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
overrides
,
owner
,
package_name
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
resource_dirs
,
resource_libs
,
resource_zips
,
rotationMinSdkVersion
,
sdk_version
,
soc_specific
,
static_libs
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_package_name
,
target_required
,
team
,
theme
,
use_resource_processor
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
defaults
list of string
aapt_include_all_resources
bool, include all resource configurations, not just the product-configured
ones.
aaptflags
list of string, flags passed to aapt when creating the apk
additional_manifests
list of string, paths to additional manifest files to merge with main manifest.
arch
interface
asset_dirs
list of string, list of directories relative to the Blueprints file containing assets.
Defaults to ["assets"] if a directory called assets exists. Set to []
to disable the default.
assets
list of string, list of files to use as assets.
category
string, the rro category of this overlay. The category in the manifest file is used if one was not given.
certificate
string, the name of a certificate in the default certificate directory or an android_app_certificate
module name in the form ":module".
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
flags_packages
list of string, Names of aconfig_declarations modules that specify aconfig flags that the module depends on.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lineage
string, Name of the signing certificate lineage file.
manifest
string, path to AndroidManifest.xml. If unset, defaults to "AndroidManifest.xml".
min_sdk_version
string, if not blank, set the minimum version of the sdk that the compiled artifacts will run against.
Defaults to sdk_version if not set.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
overrides
list of string, Names of modules to be overridden. Listed modules can only be other overlays
(in Make or Soong).
This does not completely prevent installation of the overridden overlays, but if both
overlays would be installed by default (in PRODUCT_PACKAGES) the other overlay will be removed
from PRODUCT_PACKAGES.
owner
string, vendor who owns this module
package_name
string, the package name of this app. The package name in the manifest file is used if one was not given.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕product_variables.malloc_not_svelte
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
resource_dirs
list of string, list of directories relative to the Blueprints file containing
Android resources. Defaults to ["res"] if a directory called res exists.
Set to [] to disable the default.
resource_libs
list of string, list of android_app modules whose resources are extracted and linked against
resource_zips
list of string, list of zip files containing Android resources.
rotationMinSdkVersion
string, For overriding the --rotation-min-sdk-version property of apksig
sdk_version
string, If not blank, set to the version of the sdk to compile against. This
can be either an API version (e.g. "29" for API level 29 AKA Android 10)
or special subsets of the current platform, for example "none", "current",
"core", "system", "test". See build/soong/java/sdk.go for the full and
up-to-date list of possible values.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
list of string, list of android_library modules whose resources are extracted and linked against statically
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_package_name
string, the target package name of this overlay app. The target package name in the manifest file is used if one was not given.
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
theme
string, optional theme name. If specified, the overlay package will be applied
only when the ro.boot.vendor.overlay.theme system property is set to the same value.
use_resource_processor
bool, If use_resource_processor is set, use Bazel's resource processor instead of aapt2 to generate R.class files.
The resource processor produces more optimal R.class files that only list resources in the package of the
library that provided them, as opposed to aapt2 which produces R.java files for every package containing
every resource. Using the resource processor can provide significant build time speedups, but requires
fixing the module to use the correct package to reference each resource, and to avoid having any other
libraries in the tree that use the same package name. Defaults to false, but will default to true in the
future.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
stubs_defaults
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
aconfig_declarations
,
aidl
,
annotations_enabled
,
apex_available
,
api_filename
,
api_levels_annotations_dirs
,
api_levels_annotations_enabled
,
api_levels_jar_filename
,
api_levels_module
,
api_levels_sdk_type
,
api_surface
,
arch
,
arg_files
,
args
,
check_api.api_lint
,
check_api.current
,
check_api.last_released
,
check_nullability_warnings
,
compile_multilib
,
create_doc_stubs
,
debug_ramdisk
,
defaults_visibility
,
device_specific
,
dist
,
dists
,
enabled
,
extensions_info_file
,
filter_packages
,
flags
,
generate_stubs
,
high_mem
,
host_required
,
init_rc
,
installable
,
java_version
,
libs
,
licenses
,
merge_annotations_dirs
,
merge_inclusion_annotations_dirs
,
multilib
,
native_bridge_supported
,
out
,
output_javadoc_comments
,
owner
,
previous_api
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
removed_api_filename
,
required
,
sdk_version
,
soc_specific
,
system_ext_specific
,
system_modules
,
target
,
target.android
,
target.host
,
target_required
,
team
,
validate_nullability_from_list
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
,
write_sdk_values
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
filegroup or genrule can be included within this property.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
aconfig_declarations
list of string, a list of aconfig_declarations module names that the stubs generated in this module
depend on.
⊕aidl
include_dirs
list of string, Top level directories to pass to aidl tool
local_include_dirs
list of string, Directories rooted at the Android.bp file to pass to aidl tool
annotations_enabled
bool, is set to true, Metalava will allow framework SDK to contain annotations.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
api_filename
string, The generated public API filename by Metalava, defaults to <module>_api.txt
api_levels_annotations_dirs
list of string, the dirs which Metalava extracts API levels annotations from.
api_levels_annotations_enabled
bool, if set to true, Metalava will allow framework SDK to contain API levels annotations.
api_levels_jar_filename
string, the filename which Metalava extracts API levels annotations from. Defaults to android.jar.
api_levels_module
string, Apply the api levels database created by this module rather than generating one in this droidstubs.
api_levels_sdk_type
string, the sdk kind which Metalava extracts API levels annotations from. Supports 'public', 'system', 'module-lib' and 'system-server'; defaults to public.
api_surface
string, API surface of this module. If set, the module contributes to an API surface.
For the full list of available API surfaces, refer to soong/android/sdk_version.go
arch
interface
arg_files
list of string, local files that are used within user customized droiddoc options.
args
string, user customized droiddoc args. Deprecated, use flags instead.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
⊕check_api.api_lint
enabled
bool
new_since
string, If set, performs api_lint on any new APIs not found in the given signature file
baseline_file
string, If not blank, path to the baseline txt file for approved API lint violations.
⊕check_api.current
ApiToCheck
api_file
string, path to the API txt file that the new API extracted from source code is checked
against. The path can be local to the module or from other module (via :module syntax).
removed_api_file
string, path to the API txt file that the new @removed API extractd from source code is
checked against. The path can be local to the module or from other module (via
:module syntax).
baseline_file
string, If not blank, path to the baseline txt file for approved API check violations.
args
string, Arguments to the apicheck tool.
⊕check_api.last_released
ApiToCheck
api_file
string, path to the API txt file that the new API extracted from source code is checked
against. The path can be local to the module or from other module (via :module syntax).
removed_api_file
string, path to the API txt file that the new @removed API extractd from source code is
checked against. The path can be local to the module or from other module (via
:module syntax).
baseline_file
string, If not blank, path to the baseline txt file for approved API check violations.
args
string, Arguments to the apicheck tool.
check_nullability_warnings
string, a file containing expected warnings produced by validation of nullability annotations.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
create_doc_stubs
bool, if set to true, allow Metalava to generate doc_stubs source files. Defaults to false.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
defaults_visibility
list of string, Controls the visibility of the defaults module itself.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
extensions_info_file
string, path or filegroup to file defining extension an SDK name <-> numerical ID mapping and
what APIs exist in which SDKs; passed to metalava via --sdk-extensions-info
filter_packages
list of string, list of package names that should actually be used. If this property is left unspecified,
all the sources from the srcs property is used.
flags
list of string, user customized droiddoc args. Not compatible with property args.
Available variables for substitution:
$(location <label>): the path to the arg_files with name <label>
$$: a literal $
generate_stubs
bool, if set to false then do not write out stubs. Defaults to true.
TODO(b/146727827): Remove capability when we do not need to generate stubs and API separately.
high_mem
bool, if set to true, provides a hint to the build system that this rule uses a lot of memory,
which can be used for scheduling purposes
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to false, don't allow this module(-docs.zip) to be exported. Defaults to true.
java_version
string, If not blank, set the java version passed to javadoc as -source
libs
list of string, list of java libraries that will be in the classpath.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
merge_annotations_dirs
list of string, a list of top-level directories containing files to merge qualifier annotations (i.e. those intended to be included in the stubs written) from.
merge_inclusion_annotations_dirs
list of string, a list of top-level directories containing Java stub files to merge show/hide annotations from.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
out
list of string, names of the output files used in args that will be generated
owner
string, vendor who owns this module
previous_api
string, user can specify the version of previous released API file in order to do compatibility check.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕product_variables.native_coverage
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
removed_api_filename
string, the generated removed API filename by Metalava, defaults to <module>_removed.txt
required
list of string, names of other modules to install if this module is installed
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
system_modules
string, When targeting 1.9 and above, override the modules to use with --system,
otherwise provides defaults libraries to add to the bootclasspath.
Defaults to "none"
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
validate_nullability_from_list
string, a file containing a list of classes to do nullability validation for.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_sdk_values
bool, if set to true, collect the values used by the Dev tools and
write them in files packaged with the SDK. Defaults to false.
systemserverclasspath_fragment
name
,
apex_available
,
arch
,
compile_multilib
,
contents
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
generate_classpaths_proto
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
owner
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.debuggable
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
standalone_contents
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
contents
list of string, List of system_server classpath jars, could be either java_library, or java_sdk_library.
The order of this list matters as it is the order that is used in the SYSTEMSERVERCLASSPATH.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
generate_classpaths_proto
bool, Whether to generated classpaths.proto config instance for the fragment. If the config is not
generated, then relevant boot jars are added to platform classpath, i.e. platform_bootclasspath
or platform_systemserverclasspath. This is useful for non-updatable APEX boot jars, to keep
them as part of dexopt on device. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
standalone_contents
list of string, List of jars that system_server loads dynamically using separate classloaders.
The order does not matter.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
tradefed_java_library_host
tradefed_java_library_factory wraps java_library and installs an additional
copy of the output jar to $HOST_OUT/tradefed.
name
,
srcs
,
exclude_srcs
,
defaults
,
aconfig_Cache_files
,
apex_available
,
arch
,
common_srcs
,
compile_data
,
compile_multilib
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
enabled
,
enforce_uses_libs
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_static_libs
,
exclude_uses_libs
,
exported_plugins
,
generated_srcjars
,
headers_only
,
hiddenapi_additional_annotations
,
host_required
,
include_srcs
,
init_rc
,
installable
,
is_stubs_module
,
jacoco
,
jarjar_prefix
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
manifest
,
multilib
,
native_bridge_supported
,
openjdk9
,
optional_uses_libs
,
owner
,
patch_module
,
permitted_packages
,
plugins
,
product_specific
,
product_variables.always_use_prebuilt_sdks
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_not_svelte
,
product_variables.native_coverage
,
product_variables.platform_sdk_version_or_codename
,
product_variables.unbundled_build
,
proprietary
,
proto
,
provides_uses_lib
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_tools_jar
,
uses_libs
,
vendor
,
vendor_ramdisk
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, list of source files used to compile the Java module. May be .java, .kt, .logtags, .proto,
or .aidl files.
exclude_srcs
list of string, list of source files that should not be used to build the Java module.
This is most useful in the arch/multilib variants to remove non-common files
defaults
list of string
aconfig_Cache_files
list of *ast.SelectorExpr, intermediate aconfig cache file tacked in by GeneratedJavaLibraryModule
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
"com.android.gki.*" matches any APEX module name with the prefix "com.android.gki.".
Default is ["//apex_available:platform"].
arch
interface
common_srcs
list of string, list Kotlin of source files containing Kotlin code that should be treated as common code in
a codebase that supports Kotlin multiplatform. See
https://kotlinlang.org/docs/reference/multiplatform.html. May be only be .kt files.
compile_data
list of string, A list of files or dependencies to make available to the build sandbox. This is
useful if source files are symlinks, the targets of the symlinks must be listed here.
Note that currently not all actions implemented by android_apps are sandboxed, so you
may only see this being necessary in lint builds.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
enforce_uses_libs
bool, If true, the list of uses_libs and optional_uses_libs modules must match the AndroidManifest.xml file. Defaults
to true if either uses_libs or optional_uses_libs is set. Will unconditionally default to true in the future.
⊕errorprone
javacflags
list of string, List of javac flags that should only be used when running errorprone.
enabled
bool, This property can be in 3 states. When set to true, errorprone will
be run during the regular build. When set to false, errorprone will
never be run. When unset, errorprone will be run when the RUN_ERROR_PRONE
environment variable is true. Setting this to false will improve build
performance more than adding -XepDisableAllChecks in javacflags.
exclude_java_resource_dirs
list of string, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of string, list of files that should be excluded from java_resources and java_resource_dirs
exclude_static_libs
list of string, list of java libraries that should not be used to build this module
exclude_uses_libs
list of string, A list of shared library names to exclude from the classpath of the APK. Adding a library here
will prevent it from being used when precompiling the APK and prevent it from being implicitly
added to the APK's manifest's <uses-library> elements.
Care must be taken when using this as it could result in runtime errors if the APK actually
uses classes provided by the library and which are not provided in any other way.
This is primarily intended for use by various CTS tests that check the runtime handling of the
android.test.base shared library (and related libraries) but which depend on some common
libraries that depend on the android.test.base library. Without this those tests will end up
with a <uses-library android:name="android.test.base"/> in their manifest which would either
render the tests worthless (as they would be testing the wrong behavior), or would break the
test altogether by providing access to classes that the tests were not expecting. Those tests
provide the android.test.base statically and use jarjar to rename them so they do not collide
with the classes provided by the android.test.base library.
exported_plugins
list of string, List of modules to export to libraries that directly depend on this library as annotation
processors. Note that if the plugins set generates_api: true this will disable the turbine
optimization on modules that depend on this module, which will reduce parallelism and cause
more recompilation.
generated_srcjars
list of *ast.SelectorExpr, Additional srcJars tacked in by GeneratedJavaLibraryModule
hiddenapi_additional_annotations
list of string, A list of java_library instances that provide additional hiddenapi annotations for the library.
host_required
list of string, names of other modules to install on host if this module is installed
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of string, init.rc files to be installed if this module is installed
installable
bool, If set to true, allow this module to be dexed and installed on devices. Has no
effect on host modules, which are always considered installable.
Default: true
is_stubs_module
bool, Property signifying whether the module compiles stubs or not.
Should be set to true when srcs of this module are stub files.
This property does not need to be set to true when the module depends on
the stubs via libs, but should be set to true when the module depends on
the stubs via static libs.
⊕jacoco
include_filter
list of string, List of classes to include for instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. If unset defaults to all
classes.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
exclude_filter
list of string, List of classes to exclude from instrumentation with jacoco to collect coverage
information at runtime when building with coverage enabled. Overrides classes selected
by the include_filter property.
Supports '*' as the last character of an entry in the list as a wildcard match.
If preceded by '.' it matches all classes in the package and subpackages, otherwise
it matches classes in the package that have the class name as a prefix.
jarjar_prefix
string, if not blank, used as prefix to generate repackage rule
jarjar_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of string, list of directories containing Java resources
java_resources
list of string, list of files to use as Java resources
java_version
string, If not blank, set the java version passed to javac as -source and -target
javac_shard_size
int64, The number of Java source entries each Javac instance can process
javacflags
list of string, list of module-specific flags that will be used for javac compiles
kotlincflags
list of string, list of module-specific flags that will be used for kotlinc compiles
libs
list of string, list of java libraries that will be in the classpath
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
manifest
string, manifest file to be included in resulting jar
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
⊕openjdk9
srcs
list of string, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of string, List of javac flags that should only be used when passing -source 1.9 or higher
optional_uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file with
required=false.
owner
string, vendor who owns this module
patch_module
string, When compiling language level 9+ .java code in packages that are part of
a system module, patch_module names the module that your sources and
dependencies should be patched into. The Android runtime currently
doesn't implement the JEP 261 module system so this option is only
supported at compile time. It should only be needed to compile tests in
packages that exist in libcore and which are inconvenient to move
elsewhere.
permitted_packages
list of string, If not empty, classes are restricted to the specified packages and their sub-packages.
This restriction is checked after applying jarjar rules and including static libs.
plugins
list of string, List of modules to use as annotation processors
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.always_use_prebuilt_sdks
⊕product_variables.arc
⊕exclude_srcs
⊕static_libs
⊕srcs
⊕product_variables.build_from_text_stub
⊕static_libs
⊕exclude_static_libs
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕srcs
⊕exclude_srcs
⊕product_variables.malloc_not_svelte
⊕static_libs
⊕exclude_static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_version_or_codename
⊕product_variables.unbundled_build
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
type
string, Proto generator type. C++: full or lite. Java: micro, nano, stream, or lite.
plugin
string, Proto plugin to use as the generator. Must be a cc_binary_host module.
include_dirs
list of string, list of directories that will be added to the protoc include paths.
local_include_dirs
list of string, list of directories relative to the bp file that will
be added to the protoc include paths.
canonical_path_from_root
bool, whether to identify the proto files from the root of the
source tree (the original method in Android, useful for
android-specific protos), or relative from where they were
specified (useful for external/third party protos).
This defaults to true today, but is expected to default to
false in the future.
output_params
list of string, List of extra options that will be passed to the proto generator.
provides_uses_lib
string, Optional name of the <uses-library> provided by this module. This is needed for non-SDK
libraries, because SDK ones are automatically picked up by Soong. The <uses-library> name
normally is the same as the module name, but there are exceptions.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of string, names of other modules to install if this module is installed
services
list of string, List of files to include in the META-INF/services folder of the resulting jar.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_kotlin_stdlib
bool, If true, package the kotlin stdlib into the jar. Defaults to true.
static_libs
list of string, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output. If not set, `name` is used.
To override a module with this property set, overriding module might need to set this as well.
Otherwise, both the overridden and the overriding modules will have the same output name, which
can cause the duplicate output error.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
uses_libs
list of string, A list of shared library modules that will be listed in uses-library tags in the AndroidManifest.xml file.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragments
list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.