public class StandardLinkerContext extends Linker implements LinkerContext
LinkerContext
that is initialized from a
ModuleDef
.Modifier and Type | Field and Description |
---|---|
static Comparator<ConfigurationProperty> |
CONFIGURATION_PROPERTY_COMPARATOR |
Constructor and Description |
---|
StandardLinkerContext(TreeLogger logger,
ModuleDef module,
JJSOptions jjsOptions) |
Modifier and Type | Method and Description |
---|---|
boolean |
allLinkersAreShardable() |
List<Linker> |
findUnshardableLinkers()
Find all linkers that are not updated to support running generators on
compilations shards.
|
ArtifactSet |
getArtifactsForPublicResources(TreeLogger logger,
ModuleDef module)
Convert all static resources in the specified module to artifacts.
|
SortedSet<ConfigurationProperty> |
getConfigurationProperties()
Returns all configuration properties defined in the module.
|
String |
getDescription()
Returns a human-readable String describing the Linker.
|
String |
getExtraPathForLinker(Class<? extends Linker> linkerType,
String partialPath)
Return the full path for an artifact produced by
linkertype
that has the specified partial path. |
String |
getModuleFunctionName()
Returns the name of the module's bootstrap function.
|
long |
getModuleLastModified()
Returns the time at which the module being compiled was last modified.
|
String |
getModuleName()
Returns the name of the module being compiled.
|
SortedSet<SelectionProperty> |
getProperties()
Returns all deferred binding properties defined in the module.
|
StandardSelectionProperty |
getProperty(String name) |
ArtifactSet |
invokeFinalLink(TreeLogger logger,
ArtifactSet artifacts) |
ArtifactSet |
invokeLegacyLinkers(TreeLogger logger,
ArtifactSet artifacts)
Run linkers that have not been updated for the shardable API.
|
ArtifactSet |
invokeLinkForOnePermutation(TreeLogger logger,
StandardCompilationResult permResult,
ArtifactSet permArtifacts)
Invoke the shardable linkers on one permutation result.
|
ArtifactSet |
invokeRelink(TreeLogger logger,
ArtifactSet newlyGeneratedArtifacts) |
boolean |
isOutputCompact()
Returns
true if the output should be as compact is possible
and false if the output should be human-readable. |
ArtifactSet |
link(TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts)
This method is invoked for linkers not annotated with
Shardable . |
String |
optimizeJavaScript(TreeLogger logger,
String program)
Applies optimizations to a JavaScript program.
|
void |
produceOutput(TreeLogger logger,
ArtifactSet artifacts,
EmittedArtifact.Visibility visibility,
OutputFileSet out)
Emit EmittedArtifacts artifacts onto
out . |
isShardable, link, relink, supportsDevModeInJunit
public static final Comparator<ConfigurationProperty> CONFIGURATION_PROPERTY_COMPARATOR
public StandardLinkerContext(TreeLogger logger, ModuleDef module, JJSOptions jjsOptions) throws UnableToCompleteException
UnableToCompleteException
public boolean allLinkersAreShardable()
public List<Linker> findUnshardableLinkers()
public ArtifactSet getArtifactsForPublicResources(TreeLogger logger, ModuleDef module)
public SortedSet<ConfigurationProperty> getConfigurationProperties()
LinkerContext
getConfigurationProperties
in interface LinkerContext
public String getDescription()
Linker
getDescription
in class Linker
public String getExtraPathForLinker(Class<? extends Linker> linkerType, String partialPath)
linkertype
that has the specified partial path. The full path will be the linker's
short name, as defined in the module file, followed by the given partial
path.public String getModuleFunctionName()
LinkerContext
getModuleFunctionName
in interface LinkerContext
public long getModuleLastModified()
LinkerContext
getModuleLastModified
in interface LinkerContext
public String getModuleName()
LinkerContext
getModuleName
in interface LinkerContext
public SortedSet<SelectionProperty> getProperties()
LinkerContext
getProperties
in interface LinkerContext
public StandardSelectionProperty getProperty(String name)
public ArtifactSet invokeFinalLink(TreeLogger logger, ArtifactSet artifacts) throws UnableToCompleteException
UnableToCompleteException
public ArtifactSet invokeLegacyLinkers(TreeLogger logger, ArtifactSet artifacts) throws UnableToCompleteException
UnableToCompleteException
public ArtifactSet invokeLinkForOnePermutation(TreeLogger logger, StandardCompilationResult permResult, ArtifactSet permArtifacts) throws UnableToCompleteException
UnableToCompleteException
public ArtifactSet invokeRelink(TreeLogger logger, ArtifactSet newlyGeneratedArtifacts) throws UnableToCompleteException
UnableToCompleteException
public boolean isOutputCompact()
LinkerContext
true
if the output should be as compact is possible
and false
if the output should be human-readable.isOutputCompact
in interface LinkerContext
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts)
Linker
public String optimizeJavaScript(TreeLogger logger, String program) throws UnableToCompleteException
LinkerContext
optimizeJavaScript
in interface LinkerContext
UnableToCompleteException
public void produceOutput(TreeLogger logger, ArtifactSet artifacts, EmittedArtifact.Visibility visibility, OutputFileSet out) throws UnableToCompleteException
out
. Does not close
out
.logger
- where to log progressartifacts
- the artifacts to emitvisibility
- the level of visibility of artifacts to outputout
- where to emit the artifact contentsUnableToCompleteException
Copyright © 2018. All rights reserved.