Class DepsGenerator

java.lang.Object
com.google.javascript.jscomp.deps.DepsGenerator

public class DepsGenerator extends Object
Generates deps.js files by scanning JavaScript files for calls to goog.provide(), goog.require() and goog.addDependency().
  • Constructor Details

  • Method Details

    • computeDependencyCalls

      public String computeDependencyCalls() throws IOException
      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 dependencies
      jsFiles - DepsInfo from some of jsSources
    • createDepsFileParser

      protected DepsFileParser createDepsFileParser()
    • shouldSkipDepsFile

      protected boolean shouldSkipDepsFile(SourceFile file)
      Returns whether we should ignore dependency info in the given deps file.
    • formatPathToDepsFile

      protected String formatPathToDepsFile(String path)
      Format the deps file path so that it can be included in the output file.