public final class JsBundleGenrule extends BaseGenrule<com.facebook.buck.features.js.JsBundleGenrule.Buildable> implements AndroidPackageable, HasRuntimeDeps, JsBundleOutputs, JsDependenciesOutputs
JsBundleGenrule produces four outputs:
Bundles can rewrite the misc, source map, and deps file outputs with the
rewriteSourcemap rewriteMisc, and rewriteDepsFile arguments.
Doing so causes this genrule to create these files and folders in the output directory; otherwise
the outputs will be exported verbatim from the bundles that this bundle depends on.
JS_DIR_NAME| Constructor and Description |
|---|
JsBundleGenrule(BuildTarget buildTarget,
ProjectFilesystem projectFilesystem,
BuildRuleResolver resolver,
SandboxExecutionStrategy sandboxExecutionStrategy,
JsBundleGenruleDescriptionArg args,
Optional<Arg> cmd,
Optional<Arg> bash,
Optional<Arg> cmdExe,
Optional<String> environmentExpansionSeparator,
Optional<AndroidTools> androidTools,
JsBundleOutputs jsBundle,
JsDependenciesOutputs jsDependencies,
String bundleName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addToCollector(AndroidPackageableCollector collector)
Add concrete resources to the given collector.
|
String |
getBundleName() |
JsDependenciesOutputs |
getJsDependenciesOutputs(ActionGraphBuilder graphBuilder) |
Iterable<AndroidPackageable> |
getRequiredPackageables(BuildRuleResolver ruleResolver)
Get the set of packagables that need to be included in any package that includes this object.
|
java.util.stream.Stream<BuildTarget> |
getRuntimeDeps(BuildRuleResolver buildRuleResolver) |
SourcePath |
getSourcePathToDepsFile() |
SourcePath |
getSourcePathToMisc() |
SourcePath |
getSourcePathToOutput()
Returns the output defined in 'out'.
|
SourcePath |
getSourcePathToResources() |
SourcePath |
getSourcePathToSourceMap() |
getOutputLabels, getOutputName, getSourcePathToOutput, getType, isCacheablecompareTo, getBuildable, getBuildCellPathFactory, getBuildDeps, getBuildSteps, getOutputPathResolver, getSetupStepsForBuildable, getSourcePath, getSourcePaths, injectFieldsIfNecessary, inputBasedRuleKeyIsEnabled, recordOutputs, recordOutputs, recordOutputs, stepsForBuildable, stepsForBuildable, updateBuildRuleResolverequals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, hasBuildSteps, hashCode, injectFields, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcompareTo, getBuildDeps, getBuildSteps, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, isCacheable, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString, updateBuildRuleResolvergetDependencies, getSourcePathOutputsgetTypeisSupportedpublic JsBundleGenrule(BuildTarget buildTarget, ProjectFilesystem projectFilesystem, BuildRuleResolver resolver, SandboxExecutionStrategy sandboxExecutionStrategy, JsBundleGenruleDescriptionArg args, Optional<Arg> cmd, Optional<Arg> bash, Optional<Arg> cmdExe, Optional<String> environmentExpansionSeparator, Optional<AndroidTools> androidTools, JsBundleOutputs jsBundle, JsDependenciesOutputs jsDependencies, String bundleName)
public SourcePath getSourcePathToOutput()
BaseGenruleBaseGenrule.getSourcePathToOutput(OutputLabel) instead.getSourcePathToOutput in interface HasMultipleOutputsgetSourcePathToOutput in interface BuildRulegetSourcePathToOutput in interface JsBundleOutputsgetSourcePathToOutput in class BaseGenrule<com.facebook.buck.features.js.JsBundleGenrule.Buildable>SourcePath to the directory containing the built JavaScript.public SourcePath getSourcePathToSourceMap()
getSourcePathToSourceMap in interface JsBundleOutputsSourcePath to a source map belonging to the built JavaScript. Typically a
single file.public SourcePath getSourcePathToResources()
getSourcePathToResources in interface JsBundleOutputsSourcePath to a directory containing the resources (or assets) used by the
bundled JavaScript source code.public SourcePath getSourcePathToMisc()
getSourcePathToMisc in interface JsBundleOutputsSourcePath to a directory containing various metadata that can be used by
dependent rules but are not meant to be shipped with the application.public SourcePath getSourcePathToDepsFile()
getSourcePathToDepsFile in interface JsDependenciesOutputsSourcePath to a dependencies graph file associated with a built JavaScript.public Iterable<AndroidPackageable> getRequiredPackageables(BuildRuleResolver ruleResolver)
AndroidPackageableFor 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 AndroidPackageableAndroidPackageables that must be included along with this one.public void addToCollector(AndroidPackageableCollector collector)
AndroidPackageableImplementations 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 AndroidPackageablecollector - The AndroidPackageableCollector that will receive the content.public String getBundleName()
getBundleName in interface JsBundleOutputspublic java.util.stream.Stream<BuildTarget> getRuntimeDeps(BuildRuleResolver buildRuleResolver)
getRuntimeDeps in interface HasRuntimeDepspublic JsDependenciesOutputs getJsDependenciesOutputs(ActionGraphBuilder graphBuilder)
getJsDependenciesOutputs in interface JsBundleOutputsJsDependenciesOutputs rule which is responsible for building the
dependencies file.