Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ add option to override build_extension #562

Merged
merged 4 commits into from
Jan 21, 2024

Conversation

techouse
Copy link
Collaborator

@techouse techouse commented Jan 20, 2024

Gives the user the ability to override the generated file extension from .chopper.dart to whatever they want, i.e. .chopper.g.dart.

To use this feature you have to create a build.yaml file in your project's root directory and add the following lines

targets:
  $default:
    builders:
      chopper_generator:
        options:
          # This assumes you want the files to end with `.chopper.g.dart`
          # instead of the default `.chopper.dart`.
          build_extensions: {".dart": [".chopper.g.dart"]}

Note that using this feature means that you will also have to change the part declarations in your dart files, i.e.

from

part 'my_service.chopper.dart';

to

part 'my_service.chopper.g.dart';

Addresses #560

Copy link

codecov bot commented Jan 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (78fae30) 94.17% compared to head (ba244f2) 94.17%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #562   +/-   ##
========================================
  Coverage    94.17%   94.17%           
========================================
  Files           11       11           
  Lines          481      481           
========================================
  Hits           453      453           
  Misses          28       28           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@techouse
Copy link
Collaborator Author

@JEuler @Guldem please throw an eye on this once you can.

Copy link
Collaborator

@JEuler JEuler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool!

@techouse techouse merged commit d369217 into develop Jan 21, 2024
6 checks passed
@techouse techouse deleted the feat/custom-build-extension branch January 21, 2024 15:24
techouse added a commit that referenced this pull request Jan 21, 2024
# chopper_generator

## 7.1.1

- #562
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Customize the part directive to support generating files into .g.dart instead of .chopper.dart
2 participants