Class DepsGenerator
java.lang.Object
com.google.javascript.jscomp.deps.DepsGenerator
Generates deps.js files by scanning JavaScript files for
calls to goog.provide(), goog.require() and goog.addDependency().
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionDepsGenerator
(Collection<SourceFile> deps, Collection<SourceFile> srcs, DepsGenerator.InclusionStrategy mergeStrategy, String closurePathAbs, ErrorManager errorManager) Creates a new DepsGenerator. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanUpDuplicatedFiles
(Map<String, DependencyInfo> depsFiles, Map<String, DependencyInfo> jsFiles) Removes duplicated depsInfo from jsFiles if this info already present in some of the parsed deps.jsPerforms the parsing inputs and writing of outputs.protected DepsFileParser
protected String
formatPathToDepsFile
(String path) Format the deps file path so that it can be included in the output file.protected boolean
shouldSkipDepsFile
(SourceFile file) Returns whether we should ignore dependency info in the given deps file.
-
Constructor Details
-
DepsGenerator
public DepsGenerator(Collection<SourceFile> deps, Collection<SourceFile> srcs, DepsGenerator.InclusionStrategy mergeStrategy, String closurePathAbs, ErrorManager errorManager) Creates a new DepsGenerator.
-
-
Method Details
-
computeDependencyCalls
Performs the parsing inputs and writing of outputs.- Returns:
- Returns a String of goog.addDependency calls that will build the dependency graph. Returns null if there was an error.
- Throws:
IOException
- Occurs upon an IO error.
-
cleanUpDuplicatedFiles
protected void cleanUpDuplicatedFiles(Map<String, DependencyInfo> depsFiles, Map<String, DependencyInfo> jsFiles) Removes duplicated depsInfo from jsFiles if this info already present in some of the parsed deps.js- Parameters:
depsFiles
- DepsInfo from deps.js dependenciesjsFiles
- DepsInfo from some of jsSources
-
createDepsFileParser
-
shouldSkipDepsFile
Returns whether we should ignore dependency info in the given deps file. -
formatPathToDepsFile
Format the deps file path so that it can be included in the output file.
-