public class LegacyToolchainRuleDescription extends Object implements RuleDescription<LegacyToolchainDescriptionArg>, ImplicitDepsInferringDescription<LegacyToolchainDescriptionArg>
'legacy' toolchains are ones that may do extra work behind the scenes in a way that is not
directly able to be represented by Rule Analysis. This might be something like looking at the
local environment, finding executables on the system path, etc. They are also used to minimmize
the amount of porting work that has to be done up-front. Old rules can continue to use old
toolchain retreival methods like ToolchainProvider.getByName(String,
TargetConfiguration)
, whereas new UDR/RAG rules can have a clean interface where Provider
instances do all necessary communication about
toolchains.
We expose these currently so that new rules can use existing compilers, tools, etc. However in the future, these should be discarded in favor of proper build rules that only exist in RAG/UDR.
Constructor and Description |
---|
LegacyToolchainRuleDescription(ToolchainProvider toolchainProvider) |
Modifier and Type | Method and Description |
---|---|
void |
findDepsForTargetFromConstructorArgs(BuildTarget buildTarget,
CellNameResolver cellRoots,
LegacyToolchainDescriptionArg constructorArg,
com.google.common.collect.ImmutableCollection.Builder<BuildTarget> extraDepsBuilder,
com.google.common.collect.ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder) |
Class<LegacyToolchainDescriptionArg> |
getConstructorArgType()
The type of the constructor argument that is used by this description to create a rule
|
ProviderInfoCollection |
ruleImpl(RuleAnalysisContext context,
BuildTarget target,
LegacyToolchainDescriptionArg args)
Runs the rule implementation during the analysis phase.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
producesCacheableSubgraph
getConfigurationDeps
public LegacyToolchainRuleDescription(ToolchainProvider toolchainProvider)
public ProviderInfoCollection ruleImpl(RuleAnalysisContext context, BuildTarget target, LegacyToolchainDescriptionArg args) throws ActionCreationException, RuleAnalysisException
RuleDescription
Provider
s and corresponding
InfoInterface
s, and register its corresponding
actions.ruleImpl
in interface RuleDescription<LegacyToolchainDescriptionArg>
context
- a RuleAnalysisContext
containing all the information usable by this rule
for it's analysis and constructive of its corresponding Provider
and BuildRule
graph.target
- the BuildTarget
of this ruleargs
- The args of type T
that this rule uses to rule its analysisProviderInfoCollection
that contains all the Provider
and the corresponding InfoInterface
to be propagated by this rule.ActionCreationException
- If an action cannot be created correctlyRuleAnalysisException
- If the rule implementation could not run as expected. e.g. if the
implementation method of a User Defined Rule fails to evalpublic Class<LegacyToolchainDescriptionArg> getConstructorArgType()
BaseDescription
getConstructorArgType
in interface BaseDescription<LegacyToolchainDescriptionArg>
public void findDepsForTargetFromConstructorArgs(BuildTarget buildTarget, CellNameResolver cellRoots, LegacyToolchainDescriptionArg constructorArg, com.google.common.collect.ImmutableCollection.Builder<BuildTarget> extraDepsBuilder, com.google.common.collect.ImmutableCollection.Builder<BuildTarget> targetGraphOnlyDepsBuilder)
findDepsForTargetFromConstructorArgs
in interface ImplicitDepsInferringDescription<LegacyToolchainDescriptionArg>