public class SwiftCompile extends AbstractBuildRule implements SupportsInputBasedRuleKey
Modifier and Type | Method and Description |
---|---|
com.google.common.collect.ImmutableList<Arg> |
getAstLinkArgs() |
SortedSet<BuildRule> |
getBuildDeps() |
com.google.common.collect.ImmutableList<Step> |
getBuildSteps(BuildContext context,
BuildableContext buildableContext) |
String |
getModuleName() |
String |
getObjCGeneratedHeaderFileName() |
SourcePath |
getObjCGeneratedHeaderPath() |
com.google.common.collect.ImmutableList<SourcePath> |
getObjectPaths() |
SourcePath |
getOutputPath() |
SourcePath |
getSourcePathToOutput() |
SourcePath |
getSwiftModuleOutputPath() |
boolean |
isCacheable()
Whether this
BuildRule can be cached. |
void |
updateBuildRuleResolver(BuildRuleResolver ruleResolver)
Updates the BuildRuleResolver and associated objects for this build rule.
|
equals, getBuildTarget, getDependencies, getProjectFilesystem, getSourcePathOutputs, getType, hasBuildSteps, hashCode, injectFields, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
inputBasedRuleKeyIsEnabled, isSupported
compareTo, getBuildTarget, getFullyQualifiedName, getProjectFilesystem, hasBuildSteps, outputFileCanBeCopied, shouldRespectInputSizeLimitForRemoteExecution, toString
getDependencies, getSourcePathOutputs
getType
public boolean isCacheable()
BuildRule
BuildRule
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 BuildEngineAction
isCacheable
in interface BuildRule
isCacheable
in class AbstractBuildRule
public SortedSet<BuildRule> getBuildDeps()
getBuildDeps
in interface BuildRule
deps
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 void updateBuildRuleResolver(BuildRuleResolver ruleResolver)
BuildRule
Build rules sometimes hold field references to build rule resolvers. If this build rule is to be cached, it must update its BuildRuleResolver when a new action graph is constructed to avoid leaking the entire action graph it was originally associated with.
updateBuildRuleResolver
in interface BuildRule
updateBuildRuleResolver
in class AbstractBuildRule
public com.google.common.collect.ImmutableList<Step> getBuildSteps(BuildContext context, BuildableContext buildableContext)
getBuildSteps
in interface BuildRule
public SourcePath getSourcePathToOutput()
getSourcePathToOutput
in interface BuildRule
public com.google.common.collect.ImmutableList<Arg> getAstLinkArgs()
public String getModuleName()
public com.google.common.collect.ImmutableList<SourcePath> getObjectPaths()
SourcePath
to the output object file(s) (i.e., .o file)public String getObjCGeneratedHeaderFileName()
public SourcePath getObjCGeneratedHeaderPath()
SourcePath
of the Objective-C Generated Interface Header.public SourcePath getOutputPath()
SourcePath
to the directory containing outputs from the compilation process
(object files, Swift module metadata, etc).public SourcePath getSwiftModuleOutputPath()
SourcePath
to the .swiftmodule output from the compilation process. A
swiftmodule file contains the public interface for a module, and is basically a binary file
format equivalent to header files for a C framework or library.
A swiftmodule file contains serialized ASTs (and possibly SIL), it conforms to
Swift Binary Serialization Format, more details about this binary format can be found here:
https://github.com/apple/swift/blob/7e6d62dae4bae4eb3737a6f76c0e51534c1bcca3/docs/Serialization.rst.