Class 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.