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_manifesttarget.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
BuildConfigclass files in the final .aar file. Needs to be set toTrueif any build_config_values are specified. This is normally only needed if the build tool that is consuming the .aar file does not generateBuildConfigclasses. Note: the AAR format does not specify a way to pass defaults that should be injected into the finalBuildConfigclass, 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_depsinstead.android_library()Will be included in the finalclasses.jarandroid_resource()Will be included in the finalR.txt,res/andassets/android_build_config()Will be included in the finalclasses.jarifinclude_build_config_classis Truegroovy_library()Will be included in the finalclasses.jarjava_library()Will be included in the finalclasses.jarprebuilt_jar()Will be included in the finalclasses.jarndk_library()Will be included in the finaljni/orassets/ifis_assetis Trueprebuilt_native_library()Will be included in the finaljni/orassets/ifis_assetis 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
depsorexported_depsattributes. 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',
],
)