["//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/+/master/README.md#visibility for
more details.
wrapper
string, installable script to execute the resulting jar
java_defaults
name
,
srcs
,
host_supported
,
device_supported
,
aapt_include_all_resources
,
aaptflags
,
aars
,
additional_certificates
,
additional_manifests
,
aidl
,
annotations_enabled
,
apex_available
,
api_dir
,
api_lint
,
api_only
,
api_packages
,
arch
,
asset_dirs
,
certificate
,
compile_dex
,
compile_multilib
,
core_lib
,
default_to_stubs
,
defaults
,
defaults_visibility
,
device_specific
,
dex_preopt
,
dist
,
dont_merge_manifests
,
droiddoc_option_files
,
droiddoc_options
,
dxflags
,
embed_notices
,
enabled
,
errorprone
,
exclude_dirs
,
exclude_files
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_srcs
,
export_package_resources
,
exported_plugins
,
hidden_api_packages
,
host_required
,
hostdex
,
impl_library_visibility
,
include_srcs
,
init_rc
,
installable
,
instrumentation_for
,
instrumentation_target_package
,
jacoco
,
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
,
manifest
,
merge_annotations_dirs
,
merge_inclusion_annotations_dirs
,
min_sdk_version
,
module_lib
,
multilib
,
naming_scheme
,
native_bridge_supported
,
notice
,
openjdk9
,
optimize
,
overrides
,
owner
,
package_name
,
package_splits
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
privileged
,
product_specific
,
proprietary
,
proto
,
public
,
ramdisk
,
recovery
,
required
,
resource_dirs
,
resource_libs
,
resource_zips
,
sdk_version
,
services
,
shared_library
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
stl
,
stub_only_libs
,
stubs_library_visibility
,
stubs_source_visibility
,
system
,
system_ext_specific
,
system_modules
,
system_server
,
target
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
test
,
theme
,
uncompress_dex
,
updatable
,
use_embedded_dex
,
use_embedded_native_libs
,
use_tools_jar
,
v4_signature
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
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 strings, flags passed to aapt when creating the apk
aars
list of strings
additional_certificates
list of strings, Names of extra android_app_certificate modules to sign the apk with in the form ":module".
additional_manifests
list of strings, paths to additional manifest files to merge with main manifest.
⊕aidl
include_dirs
list of strings, Top level directories to pass to aidl tool
local_include_dirs
list of strings, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of strings, 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.
annotations_enabled
bool, is set to true, Metalava will allow framework SDK to contain annotations.
apex_available
list of strings, 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".
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.
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 is shared_library: false, was set.
api_packages
list of strings, 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.
arch
interface
asset_dirs
list of strings, 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.
certificate
string, the name of a certificate in the default certificate directory or an android_app_certificate
module name in the form ":module".
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
core_lib
bool, If set to true, the path of dist files is apistubs/core. Defaults to false.
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
list of strings
defaults_visibility
list of strings, 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
targets
list of strings, 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).
dont_merge_manifests
bool, do not include AndroidManifest from dependent libraries
droiddoc_option_files
list of strings, local files that are used within user customized droiddoc options.
droiddoc_options
list of strings, additional droiddoc options
Available variables for substitution:
$(location <label>): the path to the droiddoc_option_files with name <label>
dxflags
list of strings, 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.
⊕errorprone
javacflags
list of strings, List of javac flags that should only be used when running errorprone.
exclude_dirs
list of strings, List of directories to remove from the jar file(s)
exclude_files
list of strings, List of files to remove from the jar file(s)
exclude_java_resource_dirs
list of strings, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of strings, list of files that should be excluded from java_resources and java_resource_dirs
exclude_srcs
list of strings, 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
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 strings, List of modules to export to libraries that directly depend on this library as annotation processors
hidden_api_packages
list of strings, list of package names that must be hidden from the API
host_required
list of strings, 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 strings, Visibility for impl library module. If not specified then defaults to the
visibility property.
include_srcs
bool, If set to true, include sources used to compile the module in to the final jar
init_rc
list of strings, init.rc files to be installed if this module is installed
installable
bool
instrumentation_for
string
instrumentation_target_package
string, if specified, the instrumentation target package name in the manifest is overwritten by it.
⊕jacoco
include_filter
list of strings, 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 strings, 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_rules
string, if not blank, run jarjar using the specified rules file
jars
list of strings
java_resource_dirs
list of strings, list of directories containing Java resources
java_resources
list of strings, 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 strings, list of module-specific flags that will be used for javac compiles
jetifier
bool, if set to true, run Jetifier against .aar file. Defaults to false.
jni_libs
list of strings, 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 strings, list of module-specific flags that will be used for kotlinc compiles
libs
list of strings
licenses
list of strings, Names of the licenses that apply to this module.
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 strings, Flags to pass to the Android Lint tool.
fatal_checks
list of strings, Checks that should be treated as fatal.
error_checks
list of strings, Checks that should be treated as errors.
warning_checks
list of strings, Checks that should be treated as warnings.
disabled_checks
list of strings, Checks that should be skipped.
logging_parent
string, the logging parent of this app.
manifest
string, manifest file to be included in resulting jar
merge_annotations_dirs
list of strings, 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 strings, a list of top-level directories containing Java stub files to merge show/hide annotations from.
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.
module_lib
ApiScopeProperties, The properties specific to the module-lib api scope
Unless explicitly specified by using test.enabled the module-lib api scope is
disabled by default.
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". The other allowable value is
"framework-modules" which matches the scheme currently used by framework modules
for the equivalent components represented as separate Soong modules.
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 architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
⊕openjdk9
srcs
list of strings, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of strings, 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
modules, false for java_library and java_test modules.
enabledByDefault
bool, True if the module containing this has it set by default.
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.
proguard_flags
list of strings, Flags to pass to proguard.
proguard_flags_files
list of strings, Specifies the locations of files containing proguard flags.
overrides
list of strings, 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 strings, 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 strings, 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.
plugins
list of strings, List of modules to use as annotation processors
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).
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of strings, 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 strings, list of directories that will be added to the protoc include paths.
local_include_dirs
list of strings, 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.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of strings, names of other modules to install if this module is installed
resource_dirs
list of strings, 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 strings, list of android_app modules whose resources are extracted and linked against
resource_zips
list of strings, 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 compiling against the current platform.
services
list of strings, 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 strings, list of java libraries that will be compiled into the resulting jar
stem
string, set the name of the output
stl
string, STL library to use for JNI libraries.
stub_only_libs
list of strings, List of Java libraries that will be in the classpath when building stubs
stubs_library_visibility
list of strings, Visibility for stubs library modules. If not specified then defaults to the
visibility property.
stubs_source_visibility
list of strings, 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.
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 test.enabled the module-lib api scope is
disabled by default.
target
interface
⊕target.host, target.android
⊕target.hostdex
required
list of strings, Additional required dependencies to add to -hostdex modules.
target_required
list of strings, 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.
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.
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.
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_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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/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
,
arch
,
compile_multilib
,
defaults
,
device_specific
,
dist
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
notice
,
owner
,
product_specific
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.host
,
target_required
,
vendor
,
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
defaults
list of strings
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
targets
list of strings, 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).
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 strings, names of other modules to install on host if this module is installed
init_rc
list of strings, init.rc files to be installed if this module is installed
libs
list of strings, List of modules whose contents will be visible to modules that depend on this module.
licenses
list of strings, Names of the licenses that apply to this module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
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).
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 strings, 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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/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 dependencie sand 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
,
host_supported
,
device_supported
,
arch
,
cmd
,
compile_multilib
,
depfile
,
device_specific
,
dist
,
enabled
,
exclude_srcs
,
export_include_dirs
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
notice
,
out
,
owner
,
product_specific
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.host
,
target_required
,
tool_files
,
tools
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of input files
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
(the actual substitution is implemented in GenerateAndroidBuildActions below)
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>
$(in): one or more input files
$(out): a single output file
$(depfile): a file to which dependencies will be written, if the depfile property is set to true
$(genDir): the sandbox directory for this tool; contains $(out)
$$: a literal $
All files used must be declared as inputs (to ensure proper up-to-date checks).
Use "$(in)" directly in Cmd to ensure that all inputs used are declared.
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
depfile
bool, Enable reading a file containing dependencies in gcc format after the command completes
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
targets
list of strings, 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).
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_srcs
list of strings, input files to exclude
export_include_dirs
list of strings, List of directories to export generated headers from
host_required
list of strings, names of other modules to install on host if this module is installed
init_rc
list of strings, init.rc files to be installed if this module is installed
licenses
list of strings, Names of the licenses that apply to this module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
out
list of strings, 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).
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 strings, 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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
tool_files
list of strings, Local file that is used as the tool
tools
list of strings, 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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/README.md#visibility for
more details.
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
,
arch
,
cmd
,
compile_multilib
,
depfile
,
device_specific
,
dist
,
enabled
,
exclude_srcs
,
export_include_dirs
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
notice
,
out
,
owner
,
product_specific
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.host
,
target_required
,
tool_files
,
tools
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of input files
arch
interface
cmd
string, The command to run on one or more input files. Cmd supports substitution of a few variables
(the actual substitution is implemented in GenerateAndroidBuildActions below)
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>
$(in): one or more input files
$(out): a single output file
$(depfile): a file to which dependencies will be written, if the depfile property is set to true
$(genDir): the sandbox directory for this tool; contains $(out)
$$: a literal $
All files used must be declared as inputs (to ensure proper up-to-date checks).
Use "$(in)" directly in Cmd to ensure that all inputs used are declared.
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
depfile
bool, Enable reading a file containing dependencies in gcc format after the command completes
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
targets
list of strings, 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).
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_srcs
list of strings, input files to exclude
export_include_dirs
list of strings, List of directories to export generated headers from
host_required
list of strings, names of other modules to install on host if this module is installed
init_rc
list of strings, init.rc files to be installed if this module is installed
licenses
list of strings, Names of the licenses that apply to this module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
out
list of strings, 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).
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 strings, 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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
tool_files
list of strings, Local file that is used as the tool
tools
list of strings, 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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/README.md#visibility for
more details.
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
,
arch
,
compile_multilib
,
defaults
,
device_specific
,
dist
,
enabled
,
host_required
,
init_rc
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
notice
,
owner
,
product_specific
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_ext_specific
,
target
,
target.host
,
target_required
,
vendor
,
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
defaults
list of strings
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
targets
list of strings, 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).
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 strings, names of other modules to install on host if this module is installed
init_rc
list of strings, init.rc files to be installed if this module is installed
libs
list of strings, List of modules whose contents will be visible to modules that depend on this module.
licenses
list of strings, Names of the licenses that apply to this module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
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).
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 strings, 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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/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
,
host_supported
,
device_supported
,
apex_available
,
arch
,
compile_multilib
,
defaults
,
device_specific
,
dist
,
enabled
,
exclude_dirs
,
exclude_files
,
host_required
,
init_rc
,
installable
,
jars
,
jetifier
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
notice
,
owner
,
prefer
,
product_specific
,
proprietary
,
ramdisk
,
recovery
,
required
,
sdk_member_name
,
sdk_version
,
soc_specific
,
stem
,
system_ext_specific
,
target
,
target.host
,
target_required
,
vendor
,
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.
apex_available
list of strings, 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".
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
defaults
list of strings
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
targets
list of strings, 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).
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 strings, List of directories to remove from the jar file(s)
exclude_files
list of strings, List of files to remove from the jar file(s)
host_required
list of strings, names of other modules to install on host if this module is installed
init_rc
list of strings, init.rc files to be installed if this module is installed
installable
bool
jars
list of strings
jetifier
bool, if set to true, run Jetifier against .jar file. Defaults to false.
libs
list of strings, List of shared java libs that this module has dependencies to
licenses
list of strings, Names of the licenses that apply to this module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
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).
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 strings, names of other modules to install if this module is installed
sdk_member_name
string, Name of the module that this sdk member is representing
sdk_version
string
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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/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
,
apex_available
,
arch
,
compile_multilib
,
defaults
,
device_specific
,
dist
,
enabled
,
exclude_dirs
,
exclude_files
,
host_required
,
init_rc
,
installable
,
jars
,
jetifier
,
libs
,
licenses
,
multilib
,
native_bridge_supported
,
notice
,
owner
,
prefer
,
product_specific
,
proprietary
,
ramdisk
,
recovery
,
required
,
sdk_version
,
soc_specific
,
stem
,
system_ext_specific
,
target
,
target.host
,
target_required
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
apex_available
list of strings, 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".
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
defaults
list of strings
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
targets
list of strings, 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).
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 strings, List of directories to remove from the jar file(s)
exclude_files
list of strings, List of files to remove from the jar file(s)
host_required
list of strings, names of other modules to install on host if this module is installed
init_rc
list of strings, init.rc files to be installed if this module is installed
installable
bool
jars
list of strings
jetifier
bool, if set to true, run Jetifier against .jar file. Defaults to false.
libs
list of strings, List of shared java libs that this module has dependencies to
licenses
list of strings, Names of the licenses that apply to this module.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
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).
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 strings, names of other modules to install if this module is installed
sdk_version
string
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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/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
,
host_supported
,
device_supported
,
aidl
,
apex_available
,
arch
,
compile_dex
,
compile_multilib
,
defaults
,
device_specific
,
dex_preopt
,
dist
,
dxflags
,
enabled
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_srcs
,
exported_plugins
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
jacoco
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
manifest
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
notice
,
openjdk9
,
optimize
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
proprietary
,
proto
,
ramdisk
,
recovery
,
required
,
sdk_member_name
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
uncompress_dex
,
use_tools_jar
,
v4_signature
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
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 strings, Top level directories to pass to aidl tool
local_include_dirs
list of strings, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of strings, 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.
apex_available
list of strings, 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".
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
defaults
list of strings
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
targets
list of strings, 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).
tag
string, The tag of the output of this module that should be output.
dxflags
list of strings, 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.
⊕errorprone
javacflags
list of strings, List of javac flags that should only be used when running errorprone.
exclude_java_resource_dirs
list of strings, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of strings, list of files that should be excluded from java_resources and java_resource_dirs
exclude_srcs
list of strings, 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
exported_plugins
list of strings, List of modules to export to libraries that directly depend on this library as annotation processors
host_required
list of strings, 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 strings, 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.
⊕jacoco
include_filter
list of strings, 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 strings, 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_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of strings, list of directories containing Java resources
java_resources
list of strings, 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 strings, list of module-specific flags that will be used for javac compiles
kotlincflags
list of strings, list of module-specific flags that will be used for kotlinc compiles
libs
list of strings, list of of java libraries that will be in the classpath
licenses
list of strings, Names of the licenses that apply to this 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 strings, Flags to pass to the Android Lint tool.
fatal_checks
list of strings, Checks that should be treated as fatal.
error_checks
list of strings, Checks that should be treated as errors.
warning_checks
list of strings, Checks that should be treated as warnings.
disabled_checks
list of strings, Checks that should be skipped.
manifest
string, manifest file to be included in resulting jar
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 architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
⊕openjdk9
srcs
list of strings, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of strings, 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
modules, false for java_library and java_test modules.
enabledByDefault
bool, True if the module containing this has it set by default.
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.
proguard_flags
list of strings, Flags to pass to proguard.
proguard_flags_files
list of strings, Specifies the locations of files containing proguard flags.
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 strings, 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.
plugins
list of strings, 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).
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of strings, 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 strings, list of directories that will be added to the protoc include paths.
local_include_dirs
list of strings, 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.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of strings, names of other modules to install if this module is installed
sdk_member_name
string, Name of the module that this sdk member is representing
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
services
list of strings, 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 strings, list of java libraries that will be compiled into the resulting jar
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).
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.host, target.android
⊕target.hostdex
required
list of strings, Additional required dependencies to add to -hostdex modules.
target_required
list of strings, 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.
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
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/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
,
apex_available
,
arch
,
compile_multilib
,
defaults
,
device_specific
,
dist
,
enabled
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_srcs
,
exported_plugins
,
host_required
,
include_srcs
,
init_rc
,
installable
,
jacoco
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
manifest
,
multilib
,
native_bridge_supported
,
notice
,
openjdk9
,
owner
,
patch_module
,
permitted_packages
,
plugins
,
product_specific
,
proprietary
,
proto
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
system_ext_specific
,
target
,
target.host
,
target_required
,
use_tools_jar
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
apex_available
list of strings, 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".
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
defaults
list of strings
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
targets
list of strings, 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).
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.
⊕errorprone
javacflags
list of strings, List of javac flags that should only be used when running errorprone.
exclude_java_resource_dirs
list of strings, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of strings, list of files that should be excluded from java_resources and java_resource_dirs
exclude_srcs
list of strings, 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
exported_plugins
list of strings, List of modules to export to libraries that directly depend on this library as annotation processors
host_required
list of strings, 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 strings, 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
⊕jacoco
include_filter
list of strings, 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 strings, 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_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of strings, list of directories containing Java resources
java_resources
list of strings, 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 strings, list of module-specific flags that will be used for javac compiles
kotlincflags
list of strings, list of module-specific flags that will be used for kotlinc compiles
libs
list of strings, list of of java libraries that will be in the classpath
licenses
list of strings, Names of the licenses that apply to this module.
manifest
string, manifest file to be included in resulting jar
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
⊕openjdk9
srcs
list of strings, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of strings, List of javac flags that should only be used when passing -source 1.9 or higher
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 strings, 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 strings, 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).
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of strings, 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 strings, list of directories that will be added to the protoc include paths.
local_include_dirs
list of strings, 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.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of strings, names of other modules to install if this module is installed
services
list of strings, 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 strings, list of java libraries that will be compiled into the resulting jar
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.host, target.android
target_required
list of strings, names of other modules to install on target if this module is installed
use_tools_jar
bool, Add host jdk tools.jar to bootclasspath
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/README.md#visibility for
more details.
java_library_static
java_library_static is an obsolete alias for java_library.
name
,
srcs
,
host_supported
,
device_supported
,
aidl
,
apex_available
,
arch
,
compile_dex
,
compile_multilib
,
defaults
,
device_specific
,
dex_preopt
,
dist
,
dxflags
,
enabled
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_srcs
,
exported_plugins
,
host_required
,
hostdex
,
include_srcs
,
init_rc
,
installable
,
jacoco
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
lint
,
manifest
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
notice
,
openjdk9
,
optimize
,
owner
,
patch_module
,
permitted_packages
,
platform_apis
,
plugins
,
product_specific
,
proprietary
,
proto
,
ramdisk
,
recovery
,
required
,
sdk_member_name
,
sdk_version
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
stem
,
system_ext_specific
,
system_modules
,
target
,
target.host
,
target.hostdex
,
target_required
,
target_sdk_version
,
uncompress_dex
,
use_tools_jar
,
v4_signature
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
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 strings, Top level directories to pass to aidl tool
local_include_dirs
list of strings, Directories rooted at the Android.bp file to pass to aidl tool
export_include_dirs
list of strings, 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.
apex_available
list of strings, 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".
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
defaults
list of strings
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
targets
list of strings, 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).
tag
string, The tag of the output of this module that should be output.
dxflags
list of strings, 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.
⊕errorprone
javacflags
list of strings, List of javac flags that should only be used when running errorprone.
exclude_java_resource_dirs
list of strings, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of strings, list of files that should be excluded from java_resources and java_resource_dirs
exclude_srcs
list of strings, 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
exported_plugins
list of strings, List of modules to export to libraries that directly depend on this library as annotation processors
host_required
list of strings, 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 strings, 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.
⊕jacoco
include_filter
list of strings, 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 strings, 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_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of strings, list of directories containing Java resources
java_resources
list of strings, 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 strings, list of module-specific flags that will be used for javac compiles
kotlincflags
list of strings, list of module-specific flags that will be used for kotlinc compiles
libs
list of strings, list of of java libraries that will be in the classpath
licenses
list of strings, Names of the licenses that apply to this 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 strings, Flags to pass to the Android Lint tool.
fatal_checks
list of strings, Checks that should be treated as fatal.
error_checks
list of strings, Checks that should be treated as errors.
warning_checks
list of strings, Checks that should be treated as warnings.
disabled_checks
list of strings, Checks that should be skipped.
manifest
string, manifest file to be included in resulting jar
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 architecures (also known as native bridge binary)
notice
string, relative path to a file to include in the list of notices for the device
⊕openjdk9
srcs
list of strings, List of source files that should only be used when passing -source 1.9 or higher
javacflags
list of strings, 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
modules, false for java_library and java_test modules.
enabledByDefault
bool, True if the module containing this has it set by default.
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.
proguard_flags
list of strings, Flags to pass to proguard.
proguard_flags_files
list of strings, Specifies the locations of files containing proguard flags.
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 strings, 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.
plugins
list of strings, 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).
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
⊕proto
output_params
list of strings, 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 strings, list of directories that will be added to the protoc include paths.
local_include_dirs
list of strings, 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.
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
list of strings, names of other modules to install if this module is installed
sdk_member_name
string, Name of the module that this sdk member is representing
sdk_version
string, if not blank, set to the version of the sdk to compile against.
Defaults to compiling against the current platform.
services
list of strings, 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 strings, list of java libraries that will be compiled into the resulting jar
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).
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.host, target.android
⊕target.hostdex
required
list of strings, Additional required dependencies to add to -hostdex modules.
target_required
list of strings, 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.
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
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.
vintf_fragments
list of strings, VINTF manifest fragments to be installed if this module is installed
visibility
list of strings, 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/+/master/README.md#visibility for
more details.
java_plugin
A java_plugin module describes a host java library that will be used by javac as an annotation processor.
name
,
srcs
,
arch
,
compile_multilib
,
defaults
,
device_specific
,
dist
,
enabled
,
errorprone
,
exclude_java_resource_dirs
,
exclude_java_resources
,
exclude_srcs
,
exported_plugins
,
generates_api
,
host_required
,
include_srcs
,
init_rc
,
installable
,
jacoco
,
jarjar_rules
,
java_resource_dirs
,
java_resources
,
java_version
,
javac_shard_size
,
javacflags
,
kotlincflags
,
libs
,
licenses
,
manifest
,
multilib
,
native_bridge_supported
,
notice
,
openjdk9
,
owner
,
patch_module
,
permitted_packages
,
plugins
,
processor_class
,
product_specific
,
proprietary
,
proto
,
ramdisk
,
recovery
,
required
,
services
,
soc_specific
,
static_kotlin_stdlib
,
static_libs
,
system_ext_specific
,
target
,
target.host
,
target_required
,
use_tools_jar
,
vendor
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
srcs
list of strings, list of source files used to compile the Java module. May be .java, .logtags, .proto,
or .aidl files.
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
defaults
list of strings
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
targets
list of strings, 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).
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.
⊕errorprone
javacflags
list of strings, List of javac flags that should only be used when running errorprone.
exclude_java_resource_dirs
list of strings, list of directories that should be excluded from java_resource_dirs
exclude_java_resources
list of strings, list of files that should be excluded from java_resources and java_resource_dirs
exclude_srcs
list of strings, 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
exported_plugins
list of strings, List of modules to export to libraries that directly depend on this library as annotation processors
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.
host_required
list of strings, 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 strings, 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.
⊕jacoco
include_filter
list of strings, 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 strings, 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_rules
string, if not blank, run jarjar using the specified rules file
java_resource_dirs
list of strings, list of directories containing Java resources
java_resources
list of strings, 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 strings, list of module-specific flags that will be used for javac compiles
kotlincflags
list of strings, list of module-specific flags that will be used for kotlinc compiles
libs
list of strings, list of of java libraries that will be in the classpath
licenses
list of strings, Names of the licenses that apply to this module.
manifest
string, manifest file to be included in resulting jar
multilib
interface