-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
This issue is related to #35803
Recently, I've developed a package aiming at implement the AOP(aspect oriented programming) feature for dart based on kernel-to-kernel transformation which is available at: https://github.com/alibaba-flutter/aspectd
A design diagram is given below:
Though it is expected to do aop without invasion, there is still one invasion point.
Given an app package(where original codes is given), aspectd requires a new aop package where aop codes are written, so that when compiling the aop package, both app and aop codes can be all compiled into the app.dill.
Henceforth, a hook is needed in the app building process(flutter_tools) so that aop package can be compiled when app package is compiled successfully, both in jit/aot mode.
After the aop package is compiled into dill successfully, a dill transformer is needed to extract the annotations and transform the component object so that aop feature can be implemented as expected.
More generally, different from gradle, design of flutter_tools make it hard for developers if they want to do inject some customized hooks before/after running flutter commands.
It would be better if a generalized way is provided.
Current patching logic to flutter_tools is given below:
a. build_aot.dart
c.aspectd.dart
Not a problem as totally new.

