Package com.google.javascript.jscomp.deps

# 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().

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`DepsGenerator.InclusionStrategy`

## Constructor Summary

Constructors
Constructor
Description
`DepsGenerator(Collection<SourceFile> deps, Collection<SourceFile> srcs, DepsGenerator.InclusionStrategy mergeStrategy, String closurePathAbs, ErrorManager errorManager)`
Creates a new DepsGenerator.

## Method Summary

Modifier and Type
Method
Description
`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
`String`
`computeDependencyCalls()`
Performs the parsing inputs and writing of outputs.
`protected DepsFileParser`
`createDepsFileParser()`
`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.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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

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.