Conversation
Codecov Report
@@ Coverage Diff @@
## master #35803 +/- ##
==========================================
+ Coverage 54.86% 55.26% +0.39%
==========================================
Files 188 189 +1
Lines 17320 17376 +56
==========================================
+ Hits 9502 9602 +100
+ Misses 7818 7774 -44
Continue to review full report at Codecov.
|
jonahwilliams
left a comment
There was a problem hiding this comment.
Why does this need to implemented within the flutter tool? It seems like a lot of complexity to support something that could ultimately be accomplished with a bash/batch script that wrapped the commands.
|
@jonahwilliams |
|
I developed a aop framework aspectd available at https://github.com/alibaba-flutter/aspectd In this pr, i not only want to solve the aspectd invasion problem, but also provides a more general way to give developers chance to do some job they want. |
|
@gspencergoog |
|
@jason-simmons |
|
@kangwang1988 It looks a bit like you're using the aspectd package to plugin into the CFE. It would be great to start with a detailed issue describing a bit more how this works and what sort of transformations you are making. I think the CFE might have some APIs to do this sort of thing. We could cc the dart team and get a discussion going |
Codecov Report
@@ Coverage Diff @@
## master #35803 +/- ##
==========================================
+ Coverage 54.86% 55.26% +0.39%
==========================================
Files 188 189 +1
Lines 17320 17376 +56
==========================================
+ Hits 9502 9602 +100
+ Misses 7818 7774 -44
Continue to review full report at Codecov.
|
|
Close this issue as I think we are on the right way to have a better solution to resolve my problem, see:#36738 for more. |

This pr enable developers to add some customized hooks point into flutter tools. So that they can do some things before/after a flutter command, by specify a hooks.yaml under the root directory of their flutter project without modifying the flutter_tools.
A typical hooks.yaml is given below:
For example, 'python flutter_tools_hook_bundle.py "build bundle --target-platform=ios --target=lib/main.dart --release --depfile=build/snapshot_blob.bin.d --asset-dir=/Users/kylewong/Codes/Flutter/alibaba-flutter/flutter/examples/hello_world/ios/Flutter/App.framework/flutter_assets --precompiled" will be executed when flutter build bundle command is executed.
Tests
I added the following tests:
packages/flutter_tools/test/hooks_test.dart
It includes test logic for hooks.yaml parser, hooks execution logic.
Breaking Change