|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.core.ext.Linker
public abstract class Linker
Defines a linker for the GWT compiler. Each Linker must be annotated with a
LinkerOrder
annotation to determine
the relative ordering of the Linkers. Exact order of Linker execution will be
determined by the order of add-linker
tags in the module
configuration. Each Linker should also be annotated with Shardable
;
non-shardable linkers are deprecated and will eventually not be supported.
A new instance of a linker is created each time a module is compiled or
during hosted mode when a module first loads (or is refreshed). During a
compile, link(TreeLogger, LinkerContext, ArtifactSet)
is called
exactly once on each non-shardable linker, and the artifact set will contain
any and all generated artifacts. For shardable linkers,
link(TreeLogger, LinkerContext, ArtifactSet, boolean)
is called once
for each compiled permutation and once after all compiles are finished. The
precise artifacts supplied differ with each call and are described in the
method's documentation.
When hosted mode starts for a module, it calls
link(TreeLogger, LinkerContext, ArtifactSet)
for non-shardable
linkers and link(TreeLogger, LinkerContext, ArtifactSet, boolean)
for shardable ones, passing false
as the
onePermutation
argument. If any artifacts are subsequently
generated during the course of running hosted mode,
relink(TreeLogger, LinkerContext, ArtifactSet)
will be called with
the new artifacts.
Constructor Summary | |
---|---|
Linker()
|
Method Summary | |
---|---|
abstract java.lang.String |
getDescription()
Returns a human-readable String describing the Linker. |
boolean |
isShardable()
Check whether this class is considered a shardable linker. |
ArtifactSet |
link(TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts)
This method is invoked for linkers not annotated with Shardable . |
ArtifactSet |
link(TreeLogger logger,
LinkerContext context,
ArtifactSet artifacts,
boolean onePermutation)
This method is invoked for linkers annotated with Shardable . |
ArtifactSet |
relink(TreeLogger logger,
LinkerContext context,
ArtifactSet newArtifacts)
Re-invoke the Linker with newly generated artifacts. |
boolean |
supportsDevModeInJunit(LinkerContext context)
Returns true if this linker supports DevMode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Linker()
Method Detail |
---|
public abstract java.lang.String getDescription()
public final boolean isShardable()
Shardable
annotation or it
has a field named gwtIsShardable
. If such a field is present,
it doesn't matter what value the field holds. The latter mechanism is only
intended to support linkers that must compile against older versions of
GWT.
public ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts) throws UnableToCompleteException
Shardable
. It
sees all artifacts across the whole compile and can modify them
arbitrarily. This method is only called if the linker is not annotated with
Shardable
.
logger
- the TreeLogger to record tocontext
- provides access to the Linker's environmentartifacts
- an unmodifiable view of the artifacts to link
UnableToCompleteException
- if compilation violates assumptions made
by the Linker or for errors encountered by the Linkerpublic ArtifactSet link(TreeLogger logger, LinkerContext context, ArtifactSet artifacts, boolean onePermutation) throws UnableToCompleteException
This method is invoked for linkers annotated with Shardable
. It is
called at two points during compilation: after the compile of each
permutation, and after all compilation has finished. The
onePermutation
is true
for a per-permutation call
and false
for a global final-link call.
For one-permutation calls, this method is passed all artifacts generated for just the one permutation. For the global call at the end of compilation, this method sees artifacts for the whole compilation, but with two modifications intended to support builds on computer clusters:
Transferable
have been discarded.
logger
- the TreeLogger to record tocontext
- provides access to the Linker's environmentartifacts
- an unmodifiable view of the artifacts to linkonePermutation
- true for a one-permutation call
UnableToCompleteException
- if compilation violates assumptions made
by the Linker or for errors encountered by the Linkerpublic ArtifactSet relink(TreeLogger logger, LinkerContext context, ArtifactSet newArtifacts) throws UnableToCompleteException
link(TreeLogger, LinkerContext, ArtifactSet)
should retain a copy
of the original artifact set in an instance variable.
logger
- the TreeLogger to record tocontext
- provides access to the Linker's environmentnewArtifacts
- an unmodifiable view of the newly generated artifacts
UnableToCompleteException
- if compilation violates assumptions made
by the Linker or for errors encountered by the Linkerpublic boolean supportsDevModeInJunit(LinkerContext context)
true
if this linker supports DevMode.
context
- a LinkerContext
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |