Class DepsGenerator


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

      • computeDependencyCalls

        public java.lang.String computeDependencyCalls()
                                                throws java.io.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:
        java.io.IOException - Occurs upon an IO error.
      • cleanUpDuplicatedFiles

        protected void cleanUpDuplicatedFiles​(java.util.Map<java.lang.String,​DependencyInfo> depsFiles,
                                              java.util.Map<java.lang.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
      • shouldSkipDepsFile

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

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