Repository navigation
Enable code generation features in tool (via opt-in) - #29399
Merged
Merged
Conversation
jonahwilliams
marked this pull request as ready for review
March 19, 2019 00:34
Contributor
Author
|
cc @yjbanov |
yjbanov
approved these changes
Mar 20, 2019
| const KernelCompilerFactory(); | ||
|
|
||
| Future<KernelCompiler> create(FlutterProject flutterProject) async { | ||
| if (flutterProject == null || !flutterProject.hasBuilders) { |
Contributor
There was a problem hiding this comment.
Is it possible for a project to go from not having builders to having some while a flutter command is running? If so, is this case handled? IOW, would the factory be rerun to get the code-generating compiler?
Contributor
Author
There was a problem hiding this comment.
Yes, we won't be able to switch them currently. This does fall under the umbrella for "hot reload literally everything" that I am working on.
The solution is to: 1) always run with build_runner enabled and 2) use manifest invalidation as triggers to update the build script
However, that is a much bigger change. I don't think it should block letting people use the feature
9 of 10 tasks
yjbanov
approved these changes
Mar 21, 2019
| const KernelCompilerFactory(); | ||
|
|
||
| Future<KernelCompiler> create(FlutterProject flutterProject) async { | ||
| if (flutterProject == null || !flutterProject.hasBuilders) { |
This was referenced Mar 22, 2019
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Allows usage of build_runner builders as an integrated part of flutter's test, hot reload, and build workflows. This feature is a developer preview, I expect that there will be follow up fixes and bugs required, and their may need to be changes to configuration or versions accepted.
Example: to use json_serializable in a project:
pubspec.yaml
After
flutter runorflutter generate, the generated code will appear in the build cache. The editor may need to be restarted if this is the first run of code generation.Currently we only support building to cache for the sake of our hot reload integration. We'll need to revisit this and provide guidance for package publishing.
Related Issues
#27141
Requires #28152
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?