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 java.lang.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 Constructor Description ChunkGraphAwareLicenseTracker(AbstractCompiler compiler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableSet<java.lang.String>
emitLicenses()
void
setCurrentChunkContext(JSChunk chunk)
void
setLogFile(LogFile file)
void
trackLicensesForNode(Node node)
-
-
-
Constructor Detail
-
ChunkGraphAwareLicenseTracker
public ChunkGraphAwareLicenseTracker(AbstractCompiler compiler)
-
-
Method Detail
-
setLogFile
public void setLogFile(LogFile file)
-
setCurrentChunkContext
public void setCurrentChunkContext(JSChunk chunk)
-
trackLicensesForNode
public void trackLicensesForNode(Node node)
- Specified by:
trackLicensesForNode
in interfaceCodePrinter.LicenseTracker
-
emitLicenses
public com.google.common.collect.ImmutableSet<java.lang.String> emitLicenses()
- Specified by:
emitLicenses
in interfaceCodePrinter.LicenseTracker
-
-