genrule
name
,
srcs
,
exclude_srcs
,
defaults
,
cmd
,
common_os_srcs
,
compile_multilib
,
debug_ramdisk
,
device_common_srcs
,
device_first_srcs
,
device_specific
,
dir_srcs
,
dist
,
dists
,
enabled
,
export_include_dirs
,
host_first_srcs
,
host_required
,
host_second_srcs
,
init_rc
,
keep_gendir
,
licenses
,
native_bridge_supported
,
no_full_install
,
odm_dlkm_specific
,
out
,
overrides
,
owner
,
product_specific
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.platform_sdk_extension_version
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_dlkm_specific
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
tool_files
,
tools
,
use_generic_config
,
use_nsjail
,
uses_order_only_build_date_file
,
uses_order_only_build_number_file
,
vendor
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
write_if_changed
name
string, The name of the module. Must be unique across all modules.
srcs
configurable list of string, list of input files
exclude_srcs
list of string, input files to exclude
defaults
list of string
cmd
configurable string, The command to run on one or more input files. Cmd supports substitution of a few variables.
Available variables for substitution:
$(location): the path to the first entry in tools or tool_files.
$(location <label>): the path to the tool, tool_file, input or output with name <label>. Use $(location) if <label> refers to a rule that outputs exactly one file.
$(locations <label>): the paths to the tools, tool_files, inputs or outputs with name <label>. Use $(locations) if <label> refers to a rule that outputs two or more files.
$(in): one or more input files.
$(out): a single output file.
$(genDir): the sandbox directory for this tool; contains $(out).
$$: a literal $
common_os_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a common_os os variation.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_common_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a device os variation and the common
arch variation. Can be used to add a dependency from a host genrule to a device module.
device_first_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a device os variation and the device's
first supported arch's variation. Can be used to add a dependency from a host genrule to
a device module.
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`.
dir_srcs
list of string, List of input directories. Can be set only when use_nsjail is true. Currently, usage of
dir_srcs is limited only to Trusty build.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_include_dirs
list of string, List of directories to export generated headers from
host_first_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via for host os variation.
host_required
list of string, names of other modules to install on host if this module is installed
host_second_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via for host 2nd arch os variation.
init_rc
configurable list of string, init.rc files to be installed if this module is installed
keep_gendir
bool, If set to true, $(genDir) is not truncated. Useful when this genrule can be incrementally
built. Can be set only when use_nsjail is true.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
out
list of string, names of the output files that will be generated
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕cmd
⊕product_variables.malloc_low_memory
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_extension_version
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕cmd
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
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
configurable list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
tool_files
list of string, Local files that are used by the tool
tools
list of string, name of the modules (if any) that produces the host executable. Leave empty for
prebuilts or scripts that do not need a module to build them.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_nsjail
bool
uses_order_only_build_date_file
bool, When set to true, an additional $(build_date_file) label will be available
to use in the cmd. This will be the location of a text file containing the
build date. The dependency on this file will be "order-only", meaning that
the genrule will not rerun when only this file changes, to avoid rerunning
the genrule every build, because the build date changes every build.
This also means that you should not attempt to consume the build date from
the result of this genrule in another build rule. If you do, the build date
in the second build rule will be stale when the second build rule rebuilds
but this genrule does not. Only certain allowlisted modules are allowed to
use this property, usages of the build date should be kept to the absolute
minimum.
uses_order_only_build_number_file
bool, When set to true, an additional $(build_number_file) label will be available
to use in the cmd. This will be the location of a text file containing the
build number. The dependency on this file will be "order-only", meaning that
the genrule will not rerun when only this file changes, to avoid rerunning
the genrule every build, because the build number changes every build.
This also means that you should not attempt to consume the build number from
the result of this genrule in another build rule. If you do, the build number
in the second build rule will be stale when the second build rule rebuilds
but this genrule does not. Only certain allowlisted modules are allowed to
use this property, usages of the build number should be kept to the absolute
minimum. Particularly no modules on the system image may include the build
number. Prefer using libbuildversion via the use_version_lib property on
cc modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_if_changed
bool, Enable restat to update the output only if the output is changed
genrule_defaults
name
,
srcs
,
exclude_srcs
,
defaults
,
host_supported
,
device_supported
,
apex_available
,
arch
,
cmd
,
common_os_srcs
,
compile_multilib
,
debug_ramdisk
,
defaults_visibility
,
device_common_srcs
,
device_first_srcs
,
device_specific
,
dir_srcs
,
dist
,
dists
,
enabled
,
export_include_dirs
,
host_first_srcs
,
host_required
,
host_second_srcs
,
init_rc
,
keep_gendir
,
licenses
,
multilib
,
native_bridge_supported
,
no_full_install
,
odm_dlkm_specific
,
out
,
overrides
,
owner
,
product_specific
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.platform_sdk_extension_version
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
tool_files
,
tools
,
use_generic_config
,
use_nsjail
,
uses_order_only_build_date_file
,
uses_order_only_build_number_file
,
vendor
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
write_if_changed
name
string, The name of the module. Must be unique across all modules.
srcs
configurable list of string, list of input files
exclude_srcs
list of string, input files to exclude
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
cmd
configurable string, The command to run on one or more input files. Cmd supports substitution of a few variables.
Available variables for substitution:
$(location): the path to the first entry in tools or tool_files.
$(location <label>): the path to the tool, tool_file, input or output with name <label>. Use $(location) if <label> refers to a rule that outputs exactly one file.
$(locations <label>): the paths to the tools, tool_files, inputs or outputs with name <label>. Use $(locations) if <label> refers to a rule that outputs two or more files.
$(in): one or more input files.
$(out): a single output file.
$(genDir): the sandbox directory for this tool; contains $(out).
$$: a literal $
common_os_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a common_os os variation.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
defaults_visibility
list of string, Controls the visibility of the defaults module itself.
device_common_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a device os variation and the common
arch variation. Can be used to add a dependency from a host genrule to a device module.
device_first_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a device os variation and the device's
first supported arch's variation. Can be used to add a dependency from a host genrule to
a device module.
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`.
dir_srcs
list of string, List of input directories. Can be set only when use_nsjail is true. Currently, usage of
dir_srcs is limited only to Trusty build.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_include_dirs
list of string, List of directories to export generated headers from
host_first_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via for host os variation.
host_required
list of string, names of other modules to install on host if this module is installed
host_second_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via for host 2nd arch os variation.
init_rc
configurable list of string, init.rc files to be installed if this module is installed
keep_gendir
bool, If set to true, $(genDir) is not truncated. Useful when this genrule can be incrementally
built. Can be set only when use_nsjail is true.
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
out
list of string, names of the output files that will be generated
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕cmd
⊕product_variables.malloc_low_memory
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_extension_version
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕cmd
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
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
configurable list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
tool_files
list of string, Local files that are used by the tool
tools
list of string, name of the modules (if any) that produces the host executable. Leave empty for
prebuilts or scripts that do not need a module to build them.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_nsjail
bool
uses_order_only_build_date_file
bool, When set to true, an additional $(build_date_file) label will be available
to use in the cmd. This will be the location of a text file containing the
build date. The dependency on this file will be "order-only", meaning that
the genrule will not rerun when only this file changes, to avoid rerunning
the genrule every build, because the build date changes every build.
This also means that you should not attempt to consume the build date from
the result of this genrule in another build rule. If you do, the build date
in the second build rule will be stale when the second build rule rebuilds
but this genrule does not. Only certain allowlisted modules are allowed to
use this property, usages of the build date should be kept to the absolute
minimum.
uses_order_only_build_number_file
bool, When set to true, an additional $(build_number_file) label will be available
to use in the cmd. This will be the location of a text file containing the
build number. The dependency on this file will be "order-only", meaning that
the genrule will not rerun when only this file changes, to avoid rerunning
the genrule every build, because the build number changes every build.
This also means that you should not attempt to consume the build number from
the result of this genrule in another build rule. If you do, the build number
in the second build rule will be stale when the second build rule rebuilds
but this genrule does not. Only certain allowlisted modules are allowed to
use this property, usages of the build number should be kept to the absolute
minimum. Particularly no modules on the system image may include the build
number. Prefer using libbuildversion via the use_version_lib property on
cc modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_if_changed
bool, Enable restat to update the output only if the output is changed
gensrcs
name
,
srcs
,
exclude_srcs
,
defaults
,
cmd
,
common_os_srcs
,
compile_multilib
,
data
,
debug_ramdisk
,
device_common_srcs
,
device_first_srcs
,
device_specific
,
dist
,
dists
,
enabled
,
export_include_dirs
,
host_first_srcs
,
host_required
,
host_second_srcs
,
init_rc
,
licenses
,
native_bridge_supported
,
no_full_install
,
odm_dlkm_specific
,
output_extension
,
overrides
,
owner
,
product_specific
,
product_variables.arc
,
product_variables.debuggable
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.platform_sdk_extension_version
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
shard_size
,
soc_specific
,
system_dlkm_specific
,
system_ext_specific
,
target.android
,
target.host
,
target_required
,
team
,
tool_files
,
tools
,
trim_extension
,
use_generic_config
,
uses_order_only_build_date_file
,
uses_order_only_build_number_file
,
vendor
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
write_if_changed
name
string, The name of the module. Must be unique across all modules.
srcs
configurable list of string, list of input files
exclude_srcs
list of string, input files to exclude
defaults
list of string
cmd
configurable string, The command to run on one or more input files. Cmd supports substitution of a few variables.
Available variables for substitution:
$(location): the path to the first entry in tools or tool_files.
$(location <label>): the path to the tool, tool_file, input or output with name <label>. Use $(location) if <label> refers to a rule that outputs exactly one file.
$(locations <label>): the paths to the tools, tool_files, inputs or outputs with name <label>. Use $(locations) if <label> refers to a rule that outputs two or more files.
$(in): one or more input files.
$(out): a single output file.
$(genDir): the sandbox directory for this tool; contains $(out).
$$: a literal $
common_os_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a common_os os variation.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
data
list of string, Additional files needed for build that are not tooling related.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_common_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a device os variation and the common
arch variation. Can be used to add a dependency from a host genrule to a device module.
device_first_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via a device os variation and the device's
first supported arch's variation. Can be used to add a dependency from a host genrule to
a device module.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_include_dirs
list of string, List of directories to export generated headers from
host_first_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via for host os variation.
host_required
list of string, names of other modules to install on host if this module is installed
host_second_srcs
configurable list of string, Same as srcs, but will add dependencies on modules via for host 2nd arch os variation.
init_rc
configurable list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
output_extension
string, extension that will be substituted for each output file
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕srcs
⊕exclude_srcs
⊕cmd
⊕product_variables.malloc_low_memory
⊕product_variables.native_coverage
⊕product_variables.platform_sdk_extension_version
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕cmd
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
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
configurable list of string, names of other modules to install if this module is installed
shard_size
int64, maximum number of files that will be passed on a single command line.
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_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
tool_files
list of string, Local files that are used by the tool
tools
list of string, name of the modules (if any) that produces the host executable. Leave empty for
prebuilts or scripts that do not need a module to build them.
trim_extension
string, Trim the matched extension for each input file, and it should start with ".".
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
uses_order_only_build_date_file
bool, When set to true, an additional $(build_date_file) label will be available
to use in the cmd. This will be the location of a text file containing the
build date. The dependency on this file will be "order-only", meaning that
the genrule will not rerun when only this file changes, to avoid rerunning
the genrule every build, because the build date changes every build.
This also means that you should not attempt to consume the build date from
the result of this genrule in another build rule. If you do, the build date
in the second build rule will be stale when the second build rule rebuilds
but this genrule does not. Only certain allowlisted modules are allowed to
use this property, usages of the build date should be kept to the absolute
minimum.
uses_order_only_build_number_file
bool, When set to true, an additional $(build_number_file) label will be available
to use in the cmd. This will be the location of a text file containing the
build number. The dependency on this file will be "order-only", meaning that
the genrule will not rerun when only this file changes, to avoid rerunning
the genrule every build, because the build number changes every build.
This also means that you should not attempt to consume the build number from
the result of this genrule in another build rule. If you do, the build number
in the second build rule will be stale when the second build rule rebuilds
but this genrule does not. Only certain allowlisted modules are allowed to
use this property, usages of the build number should be kept to the absolute
minimum. Particularly no modules on the system image may include the build
number. Prefer using libbuildversion via the use_version_lib property on
cc modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
write_if_changed
bool, Enable restat to update the output only if the output is changed