flutter_gen icon indicating copy to clipboard operation
flutter_gen copied to clipboard

Allow exclusion of paths and files using globs

Open kaptnkoala opened this issue 2 years ago • 1 comments

What does this change?

This pull request will add the ability to exclude directories and files, that are listed in the flutter assets section, from the code generation with flutter gen. This is needed for bigger projects, that include a massive amount of asset files that are only addressed with constructing the code paths programmatically and should not be visible as resources in the generated assets file.

This PR is a rework of this PR https://github.com/FlutterGen/flutter_gen/pull/197, which can be closed in favor of this PR. It supports the definitions of excluded paths using GLOB patterns. It short circuits the execution if paths have been defined in the exclude section of the flutter_gen config.

kaptnkoala avatar Jul 25 '22 19:07 kaptnkoala

Thank you for this PR I’ll check a few days.

wasabeef avatar Jul 26 '22 16:07 wasabeef

@kaptnkoala

Thank you. I'm thinking about change the exclude property position to asset.

  assets:
    enabled: true
    package_parameter_enabled: false
  
    exclude:
      - assets/images/chip3/*.jpg
      - pictures/chip5.jpg

wasabeef avatar Aug 21 '22 10:08 wasabeef