BuilderEntryImpl.forLibrary constructor

BuilderEntryImpl.forLibrary(
  1. String key,
  2. GeneratorFactory generator, {
  3. bool generateToCache = false,
  4. Set<String> generateFor = const <String>{},
  5. Set<String> runsBefore = const <String>{},
  6. Set<String> applies = const <String>{},
  7. Map<String, dynamic> options = const <String, dynamic>{},
  8. Map<Type, String> registeredTypes = const <Type, String>{},
  9. bool allowSyntaxErrors = false,
  10. required Set<String> outputExtensions,
})

Creates a BuilderEntryImpl with a library builder.

key A unique identifier for this builder. generator A factory function that creates the generator. generateToCache Whether outputs should be written to the build cache. generateFor Glob patterns that determine which files to process. runsBefore Builder keys that this builder should run before. applies Builder keys that this builder applies to. options Configuration options for the builder. typeRegisterMap Runtime type register map for the builder. allowSyntaxErrors Whether to generate code even if the source file has syntax errors. outputExtensions The file extensions this builder will generate.

Implementation

factory BuilderEntryImpl.forLibrary(
  String key,
  GeneratorFactory generator, {
  bool generateToCache = false,
  Set<String> generateFor = const <String>{},
  Set<String> runsBefore = const <String>{},
  Set<String> applies = const <String>{},
  Map<String, dynamic> options = const <String, dynamic>{},
  Map<Type, String> registeredTypes = const <Type, String>{},
  bool allowSyntaxErrors = false,
  required Set<String> outputExtensions,
}) {
  return BuilderEntryImpl(
    key,
    (BuilderOptions ops) => LibraryBuilder(
      generator(ops),
      allowSyntaxErrors: allowSyntaxErrors,
      outputExtensions: outputExtensions,
      options: ops,
    ),
    generateToCache: generateToCache,
    generateFor: generateFor,
    runsBefore: <String>{...runsBefore, ...applies},
    applies: applies,
    options: options,
    registeredTypes: registeredTypes,
  );
}