blob: 644dd7cc34270805c3fbc89dd19ec873f3c4c068 [file] [log] [blame]
* Copyright (c) Facebook, Inc. and its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* See the License for the specific language governing permissions and
* limitations under the License.
{namespace android_prebuilt_aar}
{template .soyweb}
{param title: 'android_prebuilt_aar()' /}
{param navid: 'rule_android_prebuilt_aar' /}
{param prettify: true /}
{param description}
A rule that takes an .aar file and makes it available as an Android
{param content}
{call buck.rule}
{param status: 'FROZEN' /}
{param overview}
An <code>android_prebuilt_aar()</code> rule takes an <code>.aar</code> file and
makes it available as an Android dependency. As expected,
an {call buck.android_binary /} that transitively depends on
an <code>android_prebuilt_aar()</code> will include its contents in the generated APK.
See the <a href="">
official Android documentation</a> for details about the <code>.aar</code> format.
{param args}
{call buck.name_arg /}
{call buck.arg}
{param name: 'aar' /}
{param desc}
Path to the <code>.aar</code> file. This may also be a build target to
a rule (such as a {call buck.genrule /}) whose output is
an <code>.aar</code> file.
{call buck.arg}
{param name: 'source_jar' /}
{param default : 'None' /}
{param desc}
Path to a JAR file that contains the <code>.java</code> files to create
the <code>.class</code> in the <code>aar</code>. This is frequently
provided for debugging purposes.
{call buck.arg}
{param name: 'javadoc_url' /}
{param default : 'None' /}
{param desc}
URL to the Javadoc for the <code>.class</code> files in the
{call buck.arg}
{param name: 'use_system_library_loader' /}
{param default : 'False' /}
{param desc}
If this <code>.aar</code> file contains native prebuilt <code>.so</code> libraries and the
Java code uses these libraries via a call to <code>System.loadLibrary()</code>, then many
optimizations&mdash;such as exopackage, compression, or asset packaging&mdash;may not be compatible with these prebuilt libs.
Setting this parameter to <code>True</code> causes all of these optimizations to skip the prebuilt <code>.so</code>
files originating from this <code>.aar</code> file. The <code>.so</code> files will always be packaged directly into
the main <code>.apk</code>.
{/param} // close args
{param examples}
{literal}<pre class="prettyprint lang-py">
name = 'play-services',
aar = 'play-services-4.0.30.aar',
source_jar = 'play-services-4.0.30-sources.jar',
javadoc_url = 'file:///opt/android-sdk/extras/google/google_play_services/docs/reference',
name = 'lib',
# This Java code can compile against Play services and reference its resources.
srcs = glob(['*.java']),
deps = [ ':play-services' ],
{/call} // close buck.rule