android_aar()
android_aar()
rule is used to generate an Android AAR.See the official Android documentation for details about the .aar
format.
Arguments
name
(required) #The short name for this build target.
manifest_skeleton
(required) #The skeleton manifest file used to generate the final
AndroidManifest.xml
. May either be a file or aandroid_manifest
target.build_config_values
(defaults to[]
) #See the documentation on the values argument for
android_build_config
.include_build_config_class
(defaults toFalse
) #Whether to include the
BuildConfig
class files in the final .aar file. Needs to be set toTrue
if any build_config_values are specified. This is normally only needed if the build tool that is consuming the .aar file does not generateBuildConfig
classes. Note: the AAR format does not specify a way to pass defaults that should be injected into the finalBuildConfig
class, therefore that information might need to be replicated manually in the build that's consuming the .aar file.deps
(defaults to[]
) #List of build targets whose corresponding compiled Java code, Android resources, and native libraries will be included in the AAR along with their transitive dependencies. For compile time deps which should not be included in the final AAR, use
provided_deps
instead.android_library()
Will be included in the finalclasses.jar
android_resource()
Will be included in the finalR.txt
,res/
andassets/
android_build_config()
Will be included in the finalclasses.jar
ifinclude_build_config_class
is Truegroovy_library()
Will be included in the finalclasses.jar
java_library()
Will be included in the finalclasses.jar
prebuilt_jar()
Will be included in the finalclasses.jar
ndk_library()
Will be included in the finaljni/
orassets/
ifis_asset
is Trueprebuilt_native_library()
Will be included in the finaljni/
orassets/
ifis_asset
is True
visibility
(defaults to[]
) #List of build target patterns that identify the build rules that can include this rule as a dependency, for example, by listing it in their
deps
orexported_deps
attributes. For more information, see visibility.licenses
(defaults to[]
) #Set of license files for this library. To get the list of license files for a given build rule and all of its dependencies, you can use
buck query
.labels
(defaults to[]
) #Set of arbitrary strings which allow you to annotate a build rule with tags that can be searched for over an entire dependency tree using
buck query attrfilter()
.
Examples
android_resource( name = 'res', res = 'res', assets = 'assets', package = 'com.example', ) android_library( name = 'lib', srcs = glob(['**/*.java']), ) android_aar( name = 'app', manifest_skeleton = 'AndroidManifestSkeleton.xml', deps = [ ':res', ':lib', ], )