com.google.javascript.jscomp
Class DependencyOptions

java.lang.Object
  extended by com.google.javascript.jscomp.DependencyOptions
All Implemented Interfaces:
Serializable

public class DependencyOptions
extends Object
implements Serializable

Options for how to manage dependencies between input files. Dependency information is usually pulled out from the JS code by looking for primitive dependency functions (like Closure Library's goog.provide/goog.require). Analysis of this dependency information is controlled by CodingConvention, which lets you define those dependency primitives. This options class determines how we use that dependency information to change how code is built.

See Also:
Serialized Form

Constructor Summary
DependencyOptions()
           
 
Method Summary
 void setDependencyPruning(boolean enabled)
          Enables or disables dependency pruning mode.
 void setDependencySorting(boolean enabled)
          Enables or disables dependency sorting mode.
 void setEntryPoints(Collection<String> symbols)
          Adds a collection of symbols to always keep.
 void setMoocherDropping(boolean enabled)
          Enables or disables moocher dropping mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DependencyOptions

public DependencyOptions()
Method Detail

setDependencySorting

public void setDependencySorting(boolean enabled)
Enables or disables dependency sorting mode. If true, we will sort the input files based on dependency information in them. Otherwise, we will use the order of files specified on the command-line.


setDependencyPruning

public void setDependencyPruning(boolean enabled)
Enables or disables dependency pruning mode. In dependency pruning mode, we will look for all files that provide a symbol. Unless that file is a transitive dependency of a file that we're using, we will remove it from the compilation job. This does not affect how we handle files that do not provide symbols. See setMoocherDropping for information on how these are handled.


setMoocherDropping

public void setMoocherDropping(boolean enabled)
Enables or disables moocher dropping mode. A 'moocher' is a file that does not provide any symbols (though they may require symbols). This is usually because they don't want to tie themselves to a particular dependency system (e.g., Closure's goog.provide, CommonJS modules). So they rely on other people to manage dependencies on them. If true, we drop these files when we prune dependencies. If false, we always keep these files an anything they depend on. The default is false. Notice that this option only makes sense if dependency pruning is on, and a set of entry points is specified.


setEntryPoints

public void setEntryPoints(Collection<String> symbols)
Adds a collection of symbols to always keep. In dependency pruning mode, we will automatically keep all the transitive dependencies of these symbols. The syntactic form of a symbol depends on the type of dependency primitives we're using. For example, goog.provide('foo.bar') provides the symbol 'foo.bar'.