public class AndroidResource extends AbstractBuildRuleWithDeclaredAndExtraDeps implements AndroidPackageable, HasAndroidResourceDeps, HasClasspathDeps, InitializableFromDisk<String>, SupportsInputBasedRuleKey
Suppose this were a rule defined in src/com/facebook/feed/BUCK
:
android_resources( name = 'res', res = 'res', assets = 'buck-assets', deps = [ '//first-party/orca/lib-ui:lib-ui', ], )
Constructor and Description |
---|
AndroidResource(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams buildRuleParams,
SourcePathRuleFinder ruleFinder,
com.google.common.collect.ImmutableSortedSet<BuildRule> deps,
SourcePath res,
com.google.common.collect.ImmutableSortedMap<Path,SourcePath> resSrcs,
String rDotJavaPackageArgument,
SourcePath assets,
com.google.common.collect.ImmutableSortedMap<Path,SourcePath> assetsSrcs,
SourcePath manifestFile,
boolean hasWhitelistedStrings) |
AndroidResource(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams buildRuleParams,
SourcePathRuleFinder ruleFinder,
com.google.common.collect.ImmutableSortedSet<BuildRule> deps,
SourcePath res,
com.google.common.collect.ImmutableSortedMap<Path,SourcePath> resSrcs,
String rDotJavaPackageArgument,
SourcePath assets,
com.google.common.collect.ImmutableSortedMap<Path,SourcePath> assetsSrcs,
SourcePath manifestFile,
boolean hasWhitelistedStrings,
boolean resourceUnion,
boolean isGrayscaleImageProcessingEnabled) |
AndroidResource(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleParams buildRuleParams,
SourcePathRuleFinder ruleFinder,
com.google.common.collect.ImmutableSortedSet<BuildRule> deps,
SourcePath res,
com.google.common.collect.ImmutableSortedMap<Path,SourcePath> resSrcs,
String rDotJavaPackageArgument,
SourcePath assets,
com.google.common.collect.ImmutableSortedMap<Path,SourcePath> assetsSrcs,
SourcePath manifestFile,
java.util.function.Supplier<com.google.common.collect.ImmutableSortedSet<? extends SourcePath>> symbolFilesFromDeps,
boolean hasWhitelistedStrings,
boolean resourceUnion,
boolean isGrayscaleImageProcessingEnabled) |
Modifier and Type | Method and Description |
---|---|
void |
addToCollector(AndroidPackageableCollector collector)
Add concrete resources to the given collector.
|
SourcePath |
getAssets() |
BuildOutputInitializer<String> |
getBuildOutputInitializer() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
Set<BuildRule> |
getDepsForTransitiveClasspathEntries() |
SourcePath |
getManifestFile() |
SourcePath |
getPathToRDotJavaPackageFile() |
SourcePath |
getPathToTextSymbolsFile() |
String |
getRDotJavaPackage() |
Iterable<AndroidPackageable> |
getRequiredPackageables(BuildRuleResolver ruleResolver)
Get the set of packagables that need to be included in any package that includes this object.
|
SourcePath |
getRes() |
SourcePath |
getSourcePathToOutput() |
String |
initializeFromDisk(SourcePathResolverAdapter pathResolver) |
deprecatedGetExtraDeps, getBuildDeps, getDeclaredDeps, getTargetGraphOnlyDeps
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, isCacheable, toString, updateBuildRuleResolver
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getBuildTarget
invalidateInitializeFromDiskState
inputBasedRuleKeyIsEnabled, isSupported
compareTo, getBuildDeps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolver
getDependencies, getSourcePathOutputs
getType
public AndroidResource(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams buildRuleParams, SourcePathRuleFinder ruleFinder, com.google.common.collect.ImmutableSortedSet<BuildRule> deps, @Nullable SourcePath res, com.google.common.collect.ImmutableSortedMap<Path,SourcePath> resSrcs, @Nullable String rDotJavaPackageArgument, @Nullable SourcePath assets, com.google.common.collect.ImmutableSortedMap<Path,SourcePath> assetsSrcs, @Nullable SourcePath manifestFile, java.util.function.Supplier<com.google.common.collect.ImmutableSortedSet<? extends SourcePath>> symbolFilesFromDeps, boolean hasWhitelistedStrings, boolean resourceUnion, boolean isGrayscaleImageProcessingEnabled)
public AndroidResource(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams buildRuleParams, SourcePathRuleFinder ruleFinder, com.google.common.collect.ImmutableSortedSet<BuildRule> deps, @Nullable SourcePath res, com.google.common.collect.ImmutableSortedMap<Path,SourcePath> resSrcs, @Nullable String rDotJavaPackageArgument, @Nullable SourcePath assets, com.google.common.collect.ImmutableSortedMap<Path,SourcePath> assetsSrcs, @Nullable SourcePath manifestFile, boolean hasWhitelistedStrings)
public AndroidResource(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleParams buildRuleParams, SourcePathRuleFinder ruleFinder, com.google.common.collect.ImmutableSortedSet<BuildRule> deps, @Nullable SourcePath res, com.google.common.collect.ImmutableSortedMap<Path,SourcePath> resSrcs, @Nullable String rDotJavaPackageArgument, @Nullable SourcePath assets, com.google.common.collect.ImmutableSortedMap<Path,SourcePath> assetsSrcs, @Nullable SourcePath manifestFile, boolean hasWhitelistedStrings, boolean resourceUnion, boolean isGrayscaleImageProcessingEnabled)
@Nullable public SourcePath getRes()
getRes
in interface HasAndroidResourceDeps
@Nullable public SourcePath getAssets()
getAssets
in interface HasAndroidResourceDeps
@Nullable public SourcePath getManifestFile()
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
@Nullable public SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
public SourcePath getPathToTextSymbolsFile()
getPathToTextSymbolsFile
in interface HasAndroidResourceDeps
public SourcePath getPathToRDotJavaPackageFile()
getPathToRDotJavaPackageFile
in interface HasAndroidResourceDeps
public String getRDotJavaPackage()
getRDotJavaPackage
in interface HasAndroidResourceDeps
public String initializeFromDisk(SourcePathResolverAdapter pathResolver)
initializeFromDisk
in interface InitializableFromDisk<String>
public BuildOutputInitializer<String> getBuildOutputInitializer()
getBuildOutputInitializer
in interface InitializableFromDisk<String>
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.public Set<BuildRule> getDepsForTransitiveClasspathEntries()
getDepsForTransitiveClasspathEntries
in interface HasClasspathDeps