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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
{namespace android_prebuilt_aar}
/***/
{template .soyweb}
{call buck.page}
{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
dependency.
{/param}
{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.
<p>
<p>
See the <a href="https://developer.android.com/studio/projects/android-library#aar-contents">
official Android documentation</a> for details about the <code>.aar</code> format.
{/param}
{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.
{/param}
{/call}
{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.
{/param}
{/call}
{call buck.arg}
{param name: 'javadoc_url' /}
{param default : 'None' /}
{param desc}
URL to the Javadoc for the <code>.class</code> files in the
{sp}<code>aar</code>.
{/param}
{/call}
{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}
{/call}
{/param} // close args
{param examples}
{literal}<pre class="prettyprint lang-py">
android_prebuilt_aar(
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',
)
android_library(
name = 'lib',
# This Java code can compile against Play services and reference its resources.
srcs = glob(['*.java']),
deps = [ ':play-services' ],
)</pre>{/literal}
{/param}
{/call} // close buck.rule
{/param}
{/call}
{/template}