public class ExportFile extends AbstractBuildRule implements HasOutputName, HasRuntimeDeps, SupportsInputBasedRuleKey
BuildRules. There are several
valid ways of using export_file (all examples in a build file located at "path/to/buck/BUCK").
The most common usage of export_file is:
export_file(name = 'some-file.html')This is equivalent to:
export_file(name = 'some-file.html',
src = 'some-file.html',
out = 'some-file.html')
This results in "//path/to/buck:some-file.html" as the rule, and will export the file
"some-file.html" as "some-file.html".
export_file(
name = 'foobar.html',
src = 'some-file.html',
)
Is equivalent to:
export_file(name = 'foobar.html', src = 'some-file.html', out = 'foobar.html')
Finally, it's possible to refer to the exported file with a logical name, while controlling the
actual file name. For example:
export_file(name = 'ie-exports',
src = 'some-file.js',
out = 'some-file-ie.js',
)
As a rule of thumb, if the "out" parameter is missing, the "name" parameter is used as the name
of the file to be saved.| Constructor and Description |
|---|
ExportFile(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
SourcePathRuleFinder ruleFinder,
String name,
ExportFileDescription.Mode mode,
SourcePath src,
ExportFileDirectoryAction directoryAction) |
| Modifier and Type | Method and Description |
|---|---|
SortedSet<BuildRule> |
getBuildDeps() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
String |
getOutputName(OutputLabel outputLabel)
Returns an output name for the build target associated with the given output label.
|
java.util.stream.Stream<BuildTarget> |
getRuntimeDeps(BuildRuleResolver buildRuleResolver) |
SourcePath |
getSourcePathToOutput() |
boolean |
isCacheable()
Whether this
BuildRule can be cached. |
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, toString, updateBuildRuleResolverclone, finalize, getClass, notify, notifyAll, wait, wait, waitinputBasedRuleKeyIsEnabled, isSupportedcompareTo, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsgetTypepublic ExportFile(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, SourcePathRuleFinder ruleFinder, String name, ExportFileDescription.Mode mode, SourcePath src, ExportFileDirectoryAction directoryAction)
public SortedSet<BuildRule> getBuildDeps()
getBuildDeps in interface BuildRuledeps argument for this build rule in the build file in which it was defined.
However, there are special cases where other arguments pull in implicit dependencies
(e.g., the keystore argument in android_binary). In these cases, the
implicit dependencies are also included in the set returned by this method. The value of
the original deps argument, as defined in the build file, must be accessed via a
custom getter provided by the build rule.
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps in interface BuildRulepublic SourcePath getSourcePathToOutput()
getSourcePathToOutput in interface BuildRulepublic String getOutputName(OutputLabel outputLabel)
HasOutputNamegetOutputName in interface HasOutputNamepublic java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps in interface HasRuntimeDepspublic boolean isCacheable()
BuildRuleBuildRule can be cached.
Uncached build rules are never written out to cache, never read from cache, and does not count in cache statistics. This rule is useful for artifacts which cannot be easily normalized.
Uncached rules are not always rebuilt, however, as long as the existing on-disk
representation is up to date. This means that these rules can take advantage of SupportsInputBasedRuleKey to prevent rebuilding.
isCacheable in interface BuildEngineActionisCacheable in interface BuildRuleisCacheable in class AbstractBuildRule