Package com.google.javascript.jscomp
Class Compiler.ChunkGraphAwareLicenseTracker
java.lang.Object
com.google.javascript.jscomp.Compiler.ChunkGraphAwareLicenseTracker
- All Implemented Interfaces:
CodePrinter.LicenseTracker
- Enclosing class:
Compiler
public static class Compiler.ChunkGraphAwareLicenseTracker
extends Object
implements CodePrinter.LicenseTracker
An implementation of a license tracker to be used when licenses can be de-duped among Chunks
(because licenses might be loaded by a chunk's transitive dependencies. This tracker has a
specific lifecycle to function correctly:
- all chunks must be processed in dependency-order
- setCurrentChunkContext must be called before any nodes in a Chunk are processed
- emitLicenses can either be called once per chunk, or once per input file in the chunk. Each call to emitLicenses will push all newly-seen licenses into tracker-internal storage, and those licenses won't be emitted again until setCurrentChunkContext resets this internal state.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableSet
<String> void
setCurrentChunkContext
(JSChunk chunk) void
setLogFile
(LogFile file) void
trackLicensesForNode
(Node node)
-
Constructor Details
-
ChunkGraphAwareLicenseTracker
-
-
Method Details
-
setLogFile
-
setCurrentChunkContext
-
trackLicensesForNode
- Specified by:
trackLicensesForNode
in interfaceCodePrinter.LicenseTracker
-
emitLicenses
- Specified by:
emitLicenses
in interfaceCodePrinter.LicenseTracker
-