|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.javascript.jscomp.JSModuleGraph
public class JSModuleGraph
A JSModule
dependency graph that assigns a depth to each module and
can answer depth-related queries about them. For the purposes of this class,
a module's depth is defined as the number of hops in the longest path from
the module to a module with no dependencies.
Nested Class Summary | |
---|---|
protected static class |
JSModuleGraph.ModuleDependenceException
|
Constructor Summary | |
---|---|
JSModuleGraph(JSModule[] modulesInDepOrder)
Creates a module graph from a list of modules in dependency order. |
|
JSModuleGraph(List<JSModule> modulesInDepOrder)
Creates a module graph from a list of modules in dependency order. |
Method Summary | |
---|---|
void |
coalesceDuplicateFiles()
Replaces any files that are found multiple times with a single instance in the closest parent module that is common to all modules where it appears. |
boolean |
dependsOn(JSModule src,
JSModule m)
Determines whether this module depends on a given module. |
JSModule |
getDeepestCommonDependencyInclusive(Collection<JSModule> modules)
Returns the deepest common dependency of the given modules. |
JSModule |
getDeepestCommonDependencyInclusive(JSModule m1,
JSModule m2)
Finds the deepest common dependency of two modules, including the modules themselves. |
List<CompilerInput> |
manageDependencies(DependencyOptions depOptions,
List<CompilerInput> inputs)
Apply the dependency options to the list of sources, returning a new source list re-ordering and dropping files as necessary. |
List<CompilerInput> |
manageDependencies(List<String> entryPoints,
List<CompilerInput> inputs)
Applies a DependencyOptions in "dependency sorting" and "dependency pruning" mode to the given list of inputs. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSModuleGraph(JSModule[] modulesInDepOrder)
public JSModuleGraph(List<JSModule> modulesInDepOrder)
Method Detail |
---|
public boolean dependsOn(JSModule src, JSModule m)
public JSModule getDeepestCommonDependencyInclusive(JSModule m1, JSModule m2)
m1
- A module in this graphm2
- A module in this graph
m1
and m2
, or null if
they have no common dependenciespublic JSModule getDeepestCommonDependencyInclusive(Collection<JSModule> modules)
public void coalesceDuplicateFiles()
public List<CompilerInput> manageDependencies(List<String> entryPoints, List<CompilerInput> inputs) throws SortedDependencies.CircularDependencyException, SortedDependencies.MissingProvideException
manageDependencies(DependencyOptions, List<CompilerInput>)
.
entryPoints
- The entry points into the program.
Expressed as JS symbols.inputs
- The original list of sources. Used to ensure that the sort
is stable.
SortedDependencies.CircularDependencyException
- if there is a circular dependency
between the provides and requires.
SortedDependencies.MissingProvideException
- if an entry point was not provided
by any of the inputs.for more info on how this works.
public List<CompilerInput> manageDependencies(DependencyOptions depOptions, List<CompilerInput> inputs) throws SortedDependencies.CircularDependencyException, SortedDependencies.MissingProvideException
inputs
- The original list of sources. Used to ensure that the sort
is stable.
SortedDependencies.CircularDependencyException
- if there is a circular dependency
between the provides and requires.
SortedDependencies.MissingProvideException
- if an entry point was not provided
by any of the inputs.for more info on how this works.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |