Buck: prebuilt_native_library()

prebuilt_native_library()

A prebuilt_native_library() rule is used to bundle native libraries (i.e., .so files) for Android.

Arguments

  • name (required) #

    The name of the rule.

  • native_libs (defaults to None) #

    Path to a directory containing native libraries. This directory has subdirectories for different architectures, such as armeabi and armeabi-v7a.

  • is_asset (defaults to False) #

    Normally native shared objects end up in a directory in the root of the APK named lib/. If this parameter is set to True, then these objects are placed in assets/lib/. Placing shared objects in a non-standard location prevents Android from extracting them to the device's internal storage.

  • visibility (defaults to []) #

    List of build target patterns that identify the build rules that can include this rule in its deps.

  • 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

Most of the time, a prebuilt_native_library is private to the android_library that uses it:
prebuilt_native_library(
  name = 'native_libs',
  native_libs = 'libs',
)

android_library(
  name = 'my_lib',
  srcs = glob(['*.java']),
  deps = [
    ':native_libs',
  ],
)