public class PrebuiltNativeLibrary extends AbstractBuildRuleWithDeclaredAndExtraDeps implements NativeLibraryBuildRule, AndroidPackageable
Suppose this were a rule defined in src/com/facebook/feed/BUILD
:
prebuilt_native_library( name = 'face_dot_com', native_libs = 'nativeLibs', )
Modifier | Constructor and Description |
---|---|
protected |
PrebuiltNativeLibrary(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams params,
Path nativeLibsDirectory,
boolean isAsset,
com.google.common.collect.ImmutableSortedSet<? extends SourcePath> librarySources) |
Modifier and Type | Method and Description |
---|---|
void |
addToCollector(AndroidPackageableCollector collector)
Add concrete resources to the given collector.
|
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
Path |
getLibraryPath()
Returns the path to the directory containing
.so files organized by target CPU
architecture. |
Iterable<AndroidPackageable> |
getRequiredPackageables(BuildRuleResolver ruleResolver)
Get the set of packagables that need to be included in any package that includes this object.
|
SourcePath |
getSourcePathToOutput() |
boolean |
isAsset() |
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDeps
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toString, updateBuildRuleResolver
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
compareTo, getFullyQualifiedName, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution
protected PrebuiltNativeLibrary(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams params, Path nativeLibsDirectory, boolean isAsset, com.google.common.collect.ImmutableSortedSet<? extends SourcePath> librarySources)
public boolean isAsset()
isAsset
in interface NativeLibraryBuildRule
.so
files in the directory returned by NativeLibraryBuildRule.getLibraryPath()
should be included in the assets
folder in the APK.public Path getLibraryPath()
NativeLibraryBuildRule
.so
files organized by target CPU
architecture. This often contains subdirectories such as:
armeabi
armeabi-v7a
getLibraryPath
in interface NativeLibraryBuildRule
@Nullable public SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
public Iterable<AndroidPackageable> getRequiredPackageables(BuildRuleResolver ruleResolver)
AndroidPackageable
For example, an android_library will need all of its Java deps (except provided_deps), its resource deps, and its native library deps (even though it doesn't need the native library as a build-time dependency). An android_resource might need an android_library that declares a custom view that it references, as well as other android_resource rules that it references directly.
TODO(natthu): Once build rules and buildables are merged, replace this method with another
interface that lets an AndroidPackageable
override the default set which is all deps of
the type AndroidPackageable
.
getRequiredPackageables
in interface AndroidPackageable
AndroidPackageable
s that must be included along with this one.public void addToCollector(AndroidPackageableCollector collector)
AndroidPackageable
Implementations should call methods on the collector specify what concrete content must be included in an Android package that includes this object. For example, an android_library will add Java classes, an ndk_library will add native libraries, and android_resource will add resource directories.
addToCollector
in interface AndroidPackageable
collector
- The AndroidPackageableCollector
that will receive the content.