public class ModuleDef extends Object implements DepsInfoProvider
Modifier and Type | Class and Description |
---|---|
static class |
ModuleDef.ModuleType
Marks a module in a way that can be used to calculate the effective bounds of a library module
in a module tree.
|
Modifier and Type | Field and Description |
---|---|
protected ResourceOracleImpl |
lazyPublicOracle
All resources found on the public path, specified by
|
Constructor and Description |
---|
ModuleDef(String name) |
ModuleDef(String name,
ResourceLoader resources) |
ModuleDef(String name,
ResourceLoader resources,
boolean monolithic,
boolean mergePathPrefixes)
Constructs a ModuleDef.
|
Modifier and Type | Method and Description |
---|---|
void |
addDirectDependency(String currentModuleName,
String dependencyModuleName)
Register a
dependencyModuleName as a directDependency of currentModuleName |
void |
addEntryPointTypeName(String typeName) |
void |
addFileset(String filesetModuleName)
Registers a module as a fileset.
|
void |
addGwtXmlFile(File xmlFile) |
void |
addLinker(String name) |
void |
addPublicPackage(String publicPackage,
String[] includeList,
String[] excludeList,
String[] skipList,
boolean defaultExcludes,
boolean caseSensitive) |
void |
addResourcePath(String resourcePath) |
void |
addRule(Rule rule) |
void |
addSourcePackage(String sourcePackage,
String[] includeList,
String[] excludeList,
String[] skipList,
boolean defaultExcludes,
boolean caseSensitive) |
void |
addSourcePackageImpl(String sourcePackage,
String[] includeList,
String[] excludeList,
String[] skipList,
boolean defaultExcludes,
boolean caseSensitive,
boolean isSuperSource) |
void |
addSuperSourcePackage(String superSourcePackage,
String[] includeList,
String[] excludeList,
String[] skipList,
boolean defaultExcludes,
boolean caseSensitive) |
void |
clear()
Free up memory no longer needed in later compile stages.
|
void |
clearEntryPoints() |
boolean |
deactivateLinker(String linkerName)
Deactivate a linker by name.
|
void |
defineLinker(TreeLogger logger,
String name,
Class<? extends Linker> linker)
Associate a Linker class with a symbolic name.
|
void |
enterModule(ModuleDef.ModuleType moduleType,
String canonicalModuleName)
Called as module tree parsing enters and exits individual module file of various types and so
provides the ModuleDef with an opportunity to keep track of what context it is currently
operating.
At the moment the ModuleDef uses it's monolithic property in combination with the entering modules ModuleType to updates its idea of attribute source. |
void |
exitModule() |
Resource |
findPublicFile(String partialPath) |
String |
findServletForPath(String actual) |
Resource |
findSourceFile(String partialPath)
Returns the Resource for a source file if it is found;
null
otherwise. |
Set<String> |
getActiveLinkerNames() |
Set<Class<? extends Linker>> |
getActiveLinkers() |
Class<? extends Linker> |
getActivePrimaryLinker() |
Collection<URL> |
getAllCompilationUnitArchiveURLs()
Returns URLs to fetch archives of precompiled compilation units.
|
String[] |
getAllSourceFiles()
Strictly for statistics gathering.
|
ResourceOracle |
getBuildResourceOracle() |
String |
getCanonicalName()
Returns the physical name for the module by which it can be found in the
classpath.
|
CompilationState |
getCompilationState(TreeLogger logger,
CompilerContext compilerContext) |
Collection<String> |
getDirectDependencies(String libraryModuleName)
The module names for its direct non fileset dependents.
|
String[] |
getEntryPointTypeNames() |
Set<String> |
getExternalLibraryCanonicalModuleNames()
Returns the names of free-standing compilable library modules that are depended upon by this
module.
|
List<String> |
getFileSetPathBetween(String fromModuleName,
String toModuleName) |
String |
getFunctionName() |
List<Rule> |
getGeneratorRules() |
String |
getGwtXmlFilePath(String moduleName)
Returns the .gwt.xml file path for the given module referenced by name.
|
int |
getInputFilenameHash()
Calculates a hash of the filenames of all the input files for the GWT compiler.
|
Class<? extends Linker> |
getLinker(String name) |
Map<String,Class<? extends Linker>> |
getLinkers() |
String |
getName() |
Properties |
getProperties()
The properties that have been defined.
|
ResourceOracleImpl |
getPublicResourceOracle() |
long |
getResourceLastModified() |
Set<Resource> |
getResourcesNewerThan(long modificationTime) |
Rules |
getRules()
Gets a reference to the internal rules for this module def.
|
Scripts |
getScripts()
Gets a reference to the internal scripts list for this module def.
|
String[] |
getServletPaths() |
Set<String> |
getSourceModuleNames(String typeSourceName)
Returns a set of the names of modules that source included the given type referenced by name.
|
ResourceOracle |
getSourceResourceOracle() |
Styles |
getStyles()
Gets a reference to the internal styles list for this module def.
|
Set<String> |
getTargetLibraryCanonicalModuleNames()
Returns the names of non-independently-compilable modules (mostly filesets) that together make
up the current module.
|
Set<String> |
getTransitiveDepModuleNames(String libraryModuleName)
Returns a set of the names of modules in the transitive dependency tree for the given module
referenced by name.
|
boolean |
isGwtXmlFileStale() |
boolean |
isInherited(String moduleName) |
static boolean |
isValidModuleName(String moduleName) |
long |
lastModified() |
void |
mapServlet(String path,
String servletClassName)
For convenience in unit tests, servlets can be automatically loaded and
mapped in the embedded web server.
|
void |
printOverlappingSourceWarnings(TreeLogger logger) |
void |
recordModuleGwtXmlFile(String moduleName,
String fileSourcePath) |
void |
refresh() |
void |
setCollapseAllProperties(boolean collapse)
Mainly for testing and decreasing compile times.
|
void |
setNameOverride(String nameOverride)
Override the module's apparent name.
|
protected ResourceOracleImpl lazyPublicOracle
public ModuleDef(String name)
public ModuleDef(String name, ResourceLoader resources)
public ModuleDef(String name, ResourceLoader resources, boolean monolithic, boolean mergePathPrefixes)
public static boolean isValidModuleName(String moduleName)
public void addDirectDependency(String currentModuleName, String dependencyModuleName)
dependencyModuleName
as a directDependency of currentModuleName
public void addEntryPointTypeName(String typeName)
public void addFileset(String filesetModuleName)
public void addGwtXmlFile(File xmlFile)
public void addLinker(String name)
public void addPublicPackage(String publicPackage, String[] includeList, String[] excludeList, String[] skipList, boolean defaultExcludes, boolean caseSensitive)
public void addResourcePath(String resourcePath)
public void addRule(Rule rule)
public void addSourcePackage(String sourcePackage, String[] includeList, String[] excludeList, String[] skipList, boolean defaultExcludes, boolean caseSensitive)
public void addSourcePackageImpl(String sourcePackage, String[] includeList, String[] excludeList, String[] skipList, boolean defaultExcludes, boolean caseSensitive, boolean isSuperSource)
public void addSuperSourcePackage(String superSourcePackage, String[] includeList, String[] excludeList, String[] skipList, boolean defaultExcludes, boolean caseSensitive)
public void clear()
ensureResourcesScanned()
will restore them.public void clearEntryPoints()
public boolean deactivateLinker(String linkerName)
public void defineLinker(TreeLogger logger, String name, Class<? extends Linker> linker) throws UnableToCompleteException
UnableToCompleteException
public void enterModule(ModuleDef.ModuleType moduleType, String canonicalModuleName)
public void exitModule()
public Resource findSourceFile(String partialPath)
null
otherwise.partialPath
- the partial path of the source filepublic Collection<URL> getAllCompilationUnitArchiveURLs()
CompileModule
public String[] getAllSourceFiles()
public ResourceOracle getBuildResourceOracle()
public String getCanonicalName()
public CompilationState getCompilationState(TreeLogger logger, CompilerContext compilerContext) throws UnableToCompleteException
UnableToCompleteException
public Collection<String> getDirectDependencies(String libraryModuleName)
public String[] getEntryPointTypeNames()
public Set<String> getExternalLibraryCanonicalModuleNames()
public List<String> getFileSetPathBetween(String fromModuleName, String toModuleName)
public String getFunctionName()
public String getGwtXmlFilePath(String moduleName)
DepsInfoProvider
getGwtXmlFilePath
in interface DepsInfoProvider
public int getInputFilenameHash()
This is needed because the list of files could change without affecting the timestamp. For example, consider a glob that matches fewer files than before because a file was deleted.
public String getName()
public Properties getProperties()
public ResourceOracleImpl getPublicResourceOracle()
public long getResourceLastModified()
public Rules getRules()
public Scripts getScripts()
public String[] getServletPaths()
public Set<String> getSourceModuleNames(String typeSourceName)
DepsInfoProvider
getSourceModuleNames
in interface DepsInfoProvider
public ResourceOracle getSourceResourceOracle()
public Styles getStyles()
public Set<String> getTargetLibraryCanonicalModuleNames()
public Set<String> getTransitiveDepModuleNames(String libraryModuleName)
DepsInfoProvider
getTransitiveDepModuleNames
in interface DepsInfoProvider
public boolean isGwtXmlFileStale()
public boolean isInherited(String moduleName)
public long lastModified()
public void mapServlet(String path, String servletClassName)
path
- the url path at which the servlet residesservletClassName
- the name of the servlet to publishpublic void printOverlappingSourceWarnings(TreeLogger logger)
public void refresh()
public void setCollapseAllProperties(boolean collapse)
public void setNameOverride(String nameOverride)
nullwill disable the name override.
Copyright © 2018. All rights reserved.