Repository: FlutterGen/flutter_gen

Issue:
[BUG] build.yaml configuration instead of pubspec.yaml
build.yaml intended for generators configuration.
So could be nice to use build.yaml configuration instead of pubspec.yaml configuration.

❌ **Bad**  
```dart
pubspec.yaml
```

⭕️ **Good**  
```dart
build.yaml
```


Discussion: You can specify the yaml file via:
```
fluttergen -c path/to/your/yaml/flie.yaml
```
@lcdsmao here build_runner documentation 
> Builders are configured with a build.yaml

https://pub.dev/packages/build_runner
@zs-dima 
What's your use case here?
Can you give some examples?
@lcdsmao I mean default way to configure builders libraries.

Here your documentation:


## Configuration file

[FlutterGen] generates dart files based on the key **`flutter`** and **`flutter_gen`** of [`pubspec.yaml`](https://dart.dev/tools/pub/pubspec).  
Default configuration can be found [here](#default-settings). 

```yaml
# pubspec.yaml
# ...

flutter_gen:
```

but it have to be:

## Configuration file

[FlutterGen] generates dart files based on the key **`flutter_gen`** of `build.yaml`.  
Default configuration can be found `here`. 

```yaml
# build.yaml
# ...
    builders:
# ...
      flutter_gen:
# ...
```


> @zs-dima What's your use case here? Can you give some examples?

I'm guessing to be able to aggregate all codegen builders in the same command via: ```flutter pub run build_runner watch --delete-conflicting-outputs``` rather than individually running ```flutter packages pub run build_runner build``` or ```fluttergen``` and other packages. Since in build.yaml you can specify the commands for each builder like: 
```
targets:
  $default:
    builders:
      slang_build_runner:
        options:
      flutter_gen:
        options:
      etc....
```
> > @zs-dima What's your use case here? Can you give some examples?
> 
> I'm guessing to be able to aggregate all codegen builders in the same command via: ```flutter pub run build_runner watch --delete-conflicting-outputs``` rather than individually running ```flutter packages pub run build_runner build``` or ```fluttergen``` and other packages. Since in build.yaml you can specify the commands for each builder like: 
> ```
> targets:
>   $default:
>     builders:
>       slang_build_runner:
>         options:
>       flutter_gen:
>         options:
>       etc....
> ```



To move builders configurations out of the pubspec.yaml
Any plans to support this setup approach?

Fix patch:
diff --git a/README.md b/README.md
index 523cef6ee..771014cff 100644
--- a/README.md
+++ b/README.md
@@ -169,6 +169,24 @@ flutter:
           style: italic
 ```
 
+### build.yaml
+
+You can also configure generate options in the `build.yaml`, it will be read before the `pubspec.yaml` if it exists.
+
+
+```yaml
+# build.yaml
+# ...
+
+targets:
+  $default:
+    builders:
+      flutter_gen:
+        options: 
+          output: lib/build_gen/ # Optional (default: lib/gen/)
+          line_length: 120 # Optional (default: 80)
+```
+
 ## Available Parsers
 
 ### Assets
diff --git a/packages/command/bin/flutter_gen_command.dart b/packages/command/bin/flutter_gen_command.dart
index 3ed33f6d6..cee70e644 100644
--- a/packages/command/bin/flutter_gen_command.dart
+++ b/packages/command/bin/flutter_gen_command.dart
@@ -14,6 +14,13 @@ void main(List<String> args) {
     defaultsTo: 'pubspec.yaml',
   );
 
+  parser.addOption(
+    'build',
+    abbr: 'b',
+    help: 'Set the path of build.yaml.',
+    defaultsTo: 'build.yaml',
+  );
+
   parser.addFlag(
     'help',
     abbr: 'h',
@@ -45,5 +52,10 @@ void main(List<String> args) {
   }
 
   final pubspecPath = safeCast<String>(results['config']);
-  FlutterGenerator(File(pubspecPath!).absolute).build();
+  final pubspecFile = File(pubspecPath!).absolute;
+
+  final buildPath = safeCast<String>(results['build']);
+  final buildFile = File(buildPath!).absolute;
+
+  FlutterGenerator(pubspecFile, buildFile: buildFile).build();
 }
diff --git a/packages/core/lib/flutter_generator.dart b/packages/core/lib/flutter_generator.dart
index c683e8af0..ec35cd09e 100644
--- a/packages/core/lib/flutter_generator.dart
+++ b/packages/core/lib/flutter_generator.dart
@@ -11,18 +11,20 @@ import 'package:path/path.dart';
 class FlutterGenerator {
   const FlutterGenerator(
     this.pubspecFile, {
+    this.buildFile,
     this.assetsName = 'assets.gen.dart',
     this.colorsName = 'colors.gen.dart',
     this.fontsName = 'fonts.gen.dart',
   });
 
   final File pubspecFile;
+  final File? buildFile;
   final String assetsName;
   final String colorsName;
   final String fontsName;
 
   Future<void> build({Config? config, FileWriter? writer}) async {
-    config ??= loadPubspecConfigOrNull(pubspecFile);
+    config ??= loadPubspecConfigOrNull(pubspecFile, buildFile: buildFile);
     if (config == null) return;
 
     final flutter = config.pubspec.flutter;
diff --git a/packages/core/lib/settings/config.dart b/packages/core/lib/settings/config.dart
index b9018e885..0ede412c6 100644
--- a/packages/core/lib/settings/config.dart
+++ b/packages/core/lib/settings/config.dart
@@ -15,23 +15,49 @@ class Config {
   final File pubspecFile;
 }
 
-Config loadPubspecConfig(File pubspecFile) {
-  stdout.writeln('$flutterGenVersion Loading ... '
-      '${normalize(join(
-    basename(pubspecFile.parent.path),
-    basename(pubspecFile.path),
-  ))}');
-  final content = pubspecFile.readAsStringSync();
-  final userMap = loadYaml(content) as Map?;
+Config loadPubspecConfig(File pubspecFile, {File? buildFile}) {
+  final pubspecLocaleHint = normalize(
+    join(basename(pubspecFile.parent.path), basename(pubspecFile.path)),
+  );
+  final buildLocaleHint = buildFile != null && buildFile.existsSync()
+      ? join(basename(buildFile.parent.path), basename(buildFile.path))
+      : '';
+
+  stdout.writeln(
+    '$flutterGenVersion Loading ...',
+  );
+
   final defaultMap = loadYaml(configDefaultYamlContent) as Map?;
-  final mergedMap = mergeMap([defaultMap, userMap]);
+
+  final pubspecContent = pubspecFile.readAsStringSync();
+  final pubspecMap = loadYaml(pubspecContent) as Map?;
+
+  var mergedMap = mergeMap([defaultMap, pubspecMap]);
+  stdout.writeln(
+    'Reading FlutterGen options from $pubspecLocaleHint',
+  );
+
+  if (buildFile != null && buildFile.existsSync()) {
+    final buildContent = buildFile.readAsStringSync();
+    final rawMap = loadYaml(buildContent) as Map?;
+    final optionBuildMap = rawMap?['targets']?[r'$default']?['builders']?['flutter_gen']?['options'];
+
+    if (optionBuildMap != null) {
+      final buildMap = {'flutter_gen': optionBuildMap};
+      mergedMap = mergeMap([mergedMap, buildMap]);
+      stdout.writeln(
+        'Reading FlutterGen options from $buildLocaleHint',
+      );
+    }
+  }
+
   final pubspec = Pubspec.fromJson(mergedMap);
   return Config._(pubspec: pubspec, pubspecFile: pubspecFile);
 }
 
-Config? loadPubspecConfigOrNull(File pubspecFile) {
+Config? loadPubspecConfigOrNull(File pubspecFile, {File? buildFile}) {
   try {
-    return loadPubspecConfig(pubspecFile);
+    return loadPubspecConfig(pubspecFile, buildFile: buildFile);
   } on FileSystemException catch (e) {
     stderr.writeln(e.message);
   } on InvalidSettingsException catch (e) {
diff --git a/packages/runner/lib/flutter_gen_runner.dart b/packages/runner/lib/flutter_gen_runner.dart
index 47c085fdb..ace44a0cb 100644
--- a/packages/runner/lib/flutter_gen_runner.dart
+++ b/packages/runner/lib/flutter_gen_runner.dart
@@ -21,8 +21,15 @@ class FlutterGenBuilder extends Builder {
     );
   }
 
-  final generator = FlutterGenerator(File('pubspec.yaml'));
-  late final _config = loadPubspecConfigOrNull(generator.pubspecFile);
+  final generator = FlutterGenerator(
+    File('pubspec.yaml'),
+    buildFile: File('build.yaml'),
+  );
+
+  late final _config = loadPubspecConfigOrNull(
+    generator.pubspecFile,
+    buildFile: generator.buildFile,
+  );
   _FlutterGenBuilderState? _currentState;
 
   @override


Test patch:
diff --git a/packages/core/test/assets_gen_test.dart b/packages/core/test/assets_gen_test.dart
index 32519cc4b..ac1181a19 100644
--- a/packages/core/test/assets_gen_test.dart
+++ b/packages/core/test/assets_gen_test.dart
@@ -213,6 +213,15 @@ void main() {
       final names = got.map((e) => e.name);
       expect(names.sorted(), tests.values.sorted());
     });
+
+    test('Assets on pubspec_assets.yaml and override with build_assets.yaml ', () async {
+      const pubspec = 'test_resources/pubspec_assets.yaml';
+      const build = 'test_resources/build_assets.yaml';
+      const fact = 'test_resources/actual_data/build_assets.gen.dart';
+      const generated = 'test_resources/lib/build_gen/assets.gen.dart';
+
+      await expectedAssetsGen(pubspec, generated, fact, build: build);
+    });
   });
 
   group('Test generatePackageNameForConfig', () {
diff --git a/packages/core/test/flutter_gen_test.dart b/packages/core/test/flutter_gen_test.dart
index 623f25baa..4b269d963 100644
--- a/packages/core/test/flutter_gen_test.dart
+++ b/packages/core/test/flutter_gen_test.dart
@@ -179,5 +179,27 @@ void main() {
       expect(File('test_resources/lib/gen/$fonts').existsSync(), false);
       expect(File('test_resources/lib/gen/$colors').existsSync(), false);
     });
+
+    test('With build_output.yaml', () async {
+      const pubspec = 'test_resources/pubspec_normal.yaml';
+      const build = 'test_resources/build_output.yaml';
+      const assets = 'build_assets.gen.dart';
+      const colors = 'build_colors.gen.dart';
+      const fonts = 'build_fonts.gen.dart';
+
+      await FlutterGenerator(
+        File(pubspec),
+        buildFile: File(build),
+        assetsName: assets,
+        colorsName: colors,
+        fontsName: fonts,
+      ).build();
+      expect(File('test_resources/lib/build_gen/$assets').readAsStringSync(),
+          isNotEmpty);
+      expect(File('test_resources/lib/build_gen/$fonts').readAsStringSync(),
+          isNotEmpty);
+      expect(File('test_resources/lib/build_gen/$colors').readAsStringSync(),
+          isNotEmpty);
+    });
   });
 }
diff --git a/packages/core/test/gen_test_helper.dart b/packages/core/test/gen_test_helper.dart
index 104dd8afd..cf7c51459 100644
--- a/packages/core/test/gen_test_helper.dart
+++ b/packages/core/test/gen_test_helper.dart
@@ -14,15 +14,21 @@ Future<void> clearTestResults() async {}
 Future<List<String>> runAssetsGen(
   String pubspec,
   String generated,
-  String fact,
-) async {
+  String fact, {
+  String? build,
+}) async {
+  final pubspecFile = File(pubspec);
+
+  File? buildFile;
+  if (build != null) buildFile = File(build);
+
   await FlutterGenerator(
-    File(pubspec),
+    pubspecFile,
+    buildFile: buildFile,
     assetsName: p.basename(generated),
   ).build();
 
-  final pubspecFile = File(pubspec);
-  final config = loadPubspecConfig(pubspecFile);
+  final config = loadPubspecConfig(pubspecFile, buildFile: buildFile);
   final formatter = DartFormatter(
     pageWidth: config.pubspec.flutterGen.lineLength,
     lineEnding: '\n',
@@ -42,9 +48,10 @@ Future<List<String>> runAssetsGen(
 Future<void> expectedAssetsGen(
   String pubspec,
   String generated,
-  String fact,
-) async {
-  final results = await runAssetsGen(pubspec, generated, fact);
+  String fact, {
+  String? build,
+}) async {
+  final results = await runAssetsGen(pubspec, generated, fact, build: build);
   final actual = results.first, expected = results.last;
   expect(
     File(generated).readAsStringSync(),
diff --git a/packages/core/test_resources/actual_data/build_assets.gen.dart b/packages/core/test_resources/actual_data/build_assets.gen.dart
new file mode 100644
index 000000000..c660a51ea
--- /dev/null
+++ b/packages/core/test_resources/actual_data/build_assets.gen.dart
@@ -0,0 +1,439 @@
+/// GENERATED CODE - DO NOT MODIFY BY HAND
+/// *****************************************************
+///  FlutterGen
+/// *****************************************************
+
+// coverage:ignore-file
+// ignore_for_file: type=lint
+// ignore_for_file: directives_ordering,unnecessary_import,implicit_dynamic_list_literal,deprecated_member_use
+
+import 'package:flare_flutter/flare_actor.dart'
+    as _flare_actor;
+import 'package:flare_flutter/flare_controller.dart'
+    as _flare_controller;
+import 'package:flutter/services.dart';
+import 'package:flutter/widgets.dart';
+import 'package:flutter_svg/flutter_svg.dart'
+    as _svg;
+import 'package:vector_graphics/vector_graphics.dart'
+    as _vg;
+
+class $PicturesGen {
+  const $PicturesGen();
+
+  /// File path: pictures/chip5.jpg
+  AssetGenImage get chip5 =>
+      const AssetGenImage(
+          'pictures/chip5.jpg');
+
+  /// List of all assets
+  List<AssetGenImage> get values =>
+      [chip5];
+}
+
+class $AssetsFlareGen {
+  const $AssetsFlareGen();
+
+  /// File path: assets/flare/Penguin.flr
+  FlareGenImage get penguin =>
+      const FlareGenImage(
+          'assets/flare/Penguin.flr');
+
+  /// List of all assets
+  List<FlareGenImage> get values =>
+      [penguin];
+}
+
+class $AssetsImagesGen {
+  const $AssetsImagesGen();
+
+  /// File path: assets/images/chip1.jpg
+  AssetGenImage get chip1 =>
+      const AssetGenImage(
+          'assets/images/chip1.jpg');
+
+  /// File path: assets/images/chip2.jpg
+  AssetGenImage get chip2 =>
+      const AssetGenImage(
+          'assets/images/chip2.jpg');
+
+  /// Directory path: assets/images/chip3
+  $AssetsImagesChip3Gen get chip3 =>
+      const $AssetsImagesChip3Gen();
+
+  /// Directory path: assets/images/chip4
+  $AssetsImagesChip4Gen get chip4 =>
+      const $AssetsImagesChip4Gen();
+
+  /// Directory path: assets/images/icons
+  $AssetsImagesIconsGen get icons =>
+      const $AssetsImagesIconsGen();
+
+  /// File path: assets/images/logo.png
+  AssetGenImage get logo =>
+      const AssetGenImage(
+          'assets/images/logo.png');
+
+  /// File path: assets/images/profile.jpg
+  AssetGenImage get profileJpg =>
+      const AssetGenImage(
+          'assets/images/profile.jpg');
+
+  /// File path: assets/images/profile.png
+  AssetGenImage get profilePng =>
+      const AssetGenImage(
+          'assets/images/profile.png');
+
+  /// List of all assets
+  List<AssetGenImage> get values => [
+        chip1,
+        chip2,
+        logo,
+        profileJpg,
+        profilePng
+      ];
+}
+
+class $AssetsJsonGen {
+  const $AssetsJsonGen();
+
+  /// File path: assets/json/list.json
+  String get list =>
+      'assets/json/list.json';
+
+  /// File path: assets/json/map.json
+  String get map =>
+      'assets/json/map.json';
+
+  /// List of all assets
+  List<String> get values =>
+      [list, map];
+}
+
+class $AssetsMovieGen {
+  const $AssetsMovieGen();
+
+  /// File path: assets/movie/the_earth.mp4
+  String get theEarth =>
+      'assets/movie/the_earth.mp4';
+
+  /// List of all assets
+  List<String> get values => [theEarth];
+}
+
+class $AssetsUnknownGen {
+  const $AssetsUnknownGen();
+
+  /// File path: assets/unknown/unknown_mime_type.bk
+  String get unknownMimeType =>
+      'assets/unknown/unknown_mime_type.bk';
+
+  /// List of all assets
+  List<String> get values =>
+      [unknownMimeType];
+}
+
+class $AssetsImagesChip3Gen {
+  const $AssetsImagesChip3Gen();
+
+  /// File path: assets/images/chip3/chip3.jpg
+  AssetGenImage get chip3 =>
+      const AssetGenImage(
+          'assets/images/chip3/chip3.jpg');
+
+  /// List of all assets
+  List<AssetGenImage> get values =>
+      [chip3];
+}
+
+class $AssetsImagesChip4Gen {
+  const $AssetsImagesChip4Gen();
+
+  /// File path: assets/images/chip4/chip4.jpg
+  AssetGenImage get chip4 =>
+      const AssetGenImage(
+          'assets/images/chip4/chip4.jpg');
+
+  /// List of all assets
+  List<AssetGenImage> get values =>
+      [chip4];
+}
+
+class $AssetsImagesIconsGen {
+  const $AssetsImagesIconsGen();
+
+  /// File path: assets/images/icons/dart@test.svg
+  SvgGenImage get dartTest =>
+      const SvgGenImage(
+          'assets/images/icons/dart@test.svg');
+
+  /// File path: assets/images/icons/fuchsia.svg
+  SvgGenImage get fuchsia =>
+      const SvgGenImage(
+          'assets/images/icons/fuchsia.svg');
+
+  /// File path: assets/images/icons/kmm.svg
+  SvgGenImage get kmm =>
+      const SvgGenImage(
+          'assets/images/icons/kmm.svg');
+
+  /// File path: assets/images/icons/paint.svg
+  SvgGenImage get paint =>
+      const SvgGenImage(
+          'assets/images/icons/paint.svg');
+
+  /// List of all assets
+  List<SvgGenImage> get values =>
+      [dartTest, fuchsia, kmm, paint];
+}
+
+class Assets {
+  Assets._();
+
+  static const String changelog =
+      'CHANGELOG.md';
+  static const $AssetsFlareGen flare =
+      $AssetsFlareGen();
+  static const $AssetsImagesGen images =
+      $AssetsImagesGen();
+  static const $AssetsJsonGen json =
+      $AssetsJsonGen();
+  static const $AssetsMovieGen movie =
+      $AssetsMovieGen();
+  static const $AssetsUnknownGen
+      unknown = $AssetsUnknownGen();
+  static const $PicturesGen pictures =
+      $PicturesGen();
+
+  /// List of all assets
+  static List<String> get values =>
+      [changelog];
+}
+
+class AssetGenImage {
+  const AssetGenImage(
+    this._assetName, {
+    this.size,
+    this.flavors = const {},
+  });
+
+  final String _assetName;
+
+  final Size? size;
+  final Set<String> flavors;
+
+  Image image({
+    Key? key,
+    AssetBundle? bundle,
+    ImageFrameBuilder? frameBuilder,
+    ImageErrorWidgetBuilder?
+        errorBuilder,
+    String? semanticLabel,
+    bool excludeFromSemantics = false,
+    double? scale,
+    double? width,
+    double? height,
+    Color? color,
+    Animation<double>? opacity,
+    BlendMode? colorBlendMode,
+    BoxFit? fit,
+    AlignmentGeometry alignment =
+        Alignment.center,
+    ImageRepeat repeat =
+        ImageRepeat.noRepeat,
+    Rect? centerSlice,
+    bool matchTextDirection = false,
+    bool gaplessPlayback = false,
+    bool isAntiAlias = false,
+    String? package,
+    FilterQuality filterQuality =
+        FilterQuality.low,
+    int? cacheWidth,
+    int? cacheHeight,
+  }) {
+    return Image.asset(
+      _assetName,
+      key: key,
+      bundle: bundle,
+      frameBuilder: frameBuilder,
+      errorBuilder: errorBuilder,
+      semanticLabel: semanticLabel,
+      excludeFromSemantics:
+          excludeFromSemantics,
+      scale: scale,
+      width: width,
+      height: height,
+      color: color,
+      opacity: opacity,
+      colorBlendMode: colorBlendMode,
+      fit: fit,
+      alignment: alignment,
+      repeat: repeat,
+      centerSlice: centerSlice,
+      matchTextDirection:
+          matchTextDirection,
+      gaplessPlayback: gaplessPlayback,
+      isAntiAlias: isAntiAlias,
+      package: package,
+      filterQuality: filterQuality,
+      cacheWidth: cacheWidth,
+      cacheHeight: cacheHeight,
+    );
+  }
+
+  ImageProvider provider({
+    AssetBundle? bundle,
+    String? package,
+  }) {
+    return AssetImage(
+      _assetName,
+      bundle: bundle,
+      package: package,
+    );
+  }
+
+  String get path => _assetName;
+
+  String get keyName => _assetName;
+}
+
+class SvgGenImage {
+  const SvgGenImage(
+    this._assetName, {
+    this.size,
+    this.flavors = const {},
+  }) : _isVecFormat = false;
+
+  const SvgGenImage.vec(
+    this._assetName, {
+    this.size,
+    this.flavors = const {},
+  }) : _isVecFormat = true;
+
+  final String _assetName;
+  final Size? size;
+  final Set<String> flavors;
+  final bool _isVecFormat;
+
+  _svg.SvgPicture svg({
+    Key? key,
+    bool matchTextDirection = false,
+    AssetBundle? bundle,
+    String? package,
+    double? width,
+    double? height,
+    BoxFit fit = BoxFit.contain,
+    AlignmentGeometry alignment =
+        Alignment.center,
+    bool allowDrawingOutsideViewBox =
+        false,
+    WidgetBuilder? placeholderBuilder,
+    String? semanticsLabel,
+    bool excludeFromSemantics = false,
+    _svg.SvgTheme? theme,
+    ColorFilter? colorFilter,
+    Clip clipBehavior = Clip.hardEdge,
+    @deprecated Color? color,
+    @deprecated
+    BlendMode colorBlendMode =
+        BlendMode.srcIn,
+    @deprecated
+    bool cacheColorFilter = false,
+  }) {
+    final _svg.BytesLoader loader;
+    if (_isVecFormat) {
+      loader = _vg.AssetBytesLoader(
+        _assetName,
+        assetBundle: bundle,
+        packageName: package,
+      );
+    } else {
+      loader = _svg.SvgAssetLoader(
+        _assetName,
+        assetBundle: bundle,
+        packageName: package,
+        theme: theme,
+      );
+    }
+    return _svg.SvgPicture(
+      loader,
+      key: key,
+      matchTextDirection:
+          matchTextDirection,
+      width: width,
+      height: height,
+      fit: fit,
+      alignment: alignment,
+      allowDrawingOutsideViewBox:
+          allowDrawingOutsideViewBox,
+      placeholderBuilder:
+          placeholderBuilder,
+      semanticsLabel: semanticsLabel,
+      excludeFromSemantics:
+          excludeFromSemantics,
+      colorFilter: colorFilter ??
+          (color == null
+              ? null
+              : ColorFilter.mode(color,
+                  colorBlendMode)),
+      clipBehavior: clipBehavior,
+      cacheColorFilter:
+          cacheColorFilter,
+    );
+  }
+
+  String get path => _assetName;
+
+  String get keyName => _assetName;
+}
+
+class FlareGenImage {
+  const FlareGenImage(
+    this._assetName, {
+    this.flavors = const {},
+  });
+
+  final String _assetName;
+  final Set<String> flavors;
+
+  _flare_actor.FlareActor flare({
+    String? boundsNode,
+    String? animation,
+    BoxFit fit = BoxFit.contain,
+    Alignment alignment =
+        Alignment.center,
+    bool isPaused = false,
+    bool snapToEnd = false,
+    _flare_controller.FlareController?
+        controller,
+    _flare_actor.FlareCompletedCallback?
+        callback,
+    Color? color,
+    bool shouldClip = true,
+    bool sizeFromArtboard = false,
+    String? artboard,
+    bool antialias = true,
+  }) {
+    return _flare_actor.FlareActor(
+      _assetName,
+      boundsNode: boundsNode,
+      animation: animation,
+      fit: fit,
+      alignment: alignment,
+      isPaused: isPaused,
+      snapToEnd: snapToEnd,
+      controller: controller,
+      callback: callback,
+      color: color,
+      shouldClip: shouldClip,
+      sizeFromArtboard:
+          sizeFromArtboard,
+      artboard: artboard,
+      antialias: antialias,
+    );
+  }
+
+  String get path => _assetName;
+
+  String get keyName => _assetName;
+}
diff --git a/packages/core/test_resources/build_assets.yaml b/packages/core/test_resources/build_assets.yaml
new file mode 100644
index 000000000..ccd360fdc
--- /dev/null
+++ b/packages/core/test_resources/build_assets.yaml
@@ -0,0 +1,9 @@
+name: test
+
+targets:
+  $default:
+    builders:
+      flutter_gen:
+        options:
+          output: lib/build_gen/
+          line_length: 120