apply function

BuilderApplication apply(
  1. String builderKey,
  2. List<BuilderFactory> builderFactories,
  3. PackageFilter filter, {
  4. bool isOptional = false,
  5. bool hideOutput = true,
  6. InputSet defaultGenerateFor = const InputSet(),
  7. BuilderOptions defaultOptions = BuilderOptions.empty,
  8. BuilderOptions? defaultDevOptions,
  9. BuilderOptions? defaultReleaseOptions,
  10. Iterable<String> appliesBuilders = const [],
})

Apply each builder from builderFactories to the packages matching filter.

If the builder should only run on a subset of files within a target pass globs to defaultGenerateFor. This can be overridden by any target which configured the builder manually.

If isOptional is true the builder will only run if one of its outputs is read by a later builder, or is used as a primary input to a later builder. If no build actions read the output of an optional action, then it will never run.

Any existing Builders which match a key in appliesBuilders will automatically be applied to any target which runs this Builder, whether because it matches filter or because it was enabled manually.

Implementation

BuilderApplication apply(String builderKey,
        List<BuilderFactory> builderFactories, PackageFilter filter,
        {bool isOptional = false,
        bool hideOutput = true,
        InputSet defaultGenerateFor = const InputSet(),
        BuilderOptions defaultOptions = BuilderOptions.empty,
        BuilderOptions? defaultDevOptions,
        BuilderOptions? defaultReleaseOptions,
        Iterable<String> appliesBuilders = const []}) =>
    BuilderApplication.forBuilder(
      builderKey,
      builderFactories,
      filter,
      isOptional: isOptional,
      hideOutput: hideOutput,
      defaultGenerateFor: defaultGenerateFor,
      defaultOptions: defaultOptions,
      defaultDevOptions: defaultDevOptions,
      defaultReleaseOptions: defaultReleaseOptions,
      appliesBuilders: appliesBuilders,
    );