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

几个建议 #5

Open
timbobo opened this issue Jan 7, 2019 · 2 comments
Open

几个建议 #5

timbobo opened this issue Jan 7, 2019 · 2 comments

Comments

@timbobo
Copy link

timbobo commented Jan 7, 2019

  1. AspectJ本身在移动端已经属于重量级AOP框架了,建议用ASM

  2. 插件AOP织入我看到是通过javaCompile去织入,这样有个问题就是不同Module需要每次都依赖插件,因为javaCompile只会编译单个Module起效,建议在Gradle插件中通过Transform将字节码用AspectJ去切,这样只需要在APP Module中Apply插件即可

@xuexiangjys
Copy link
Owner

  1. AspectJ本身在移动端已经属于重量级AOP框架了,建议用ASM
  2. 插件AOP织入我看到是通过javaCompile去织入,这样有个问题就是不同Module需要每次都依赖插件,因为javaCompile只会编译单个Module起效,建议在Gradle插件中通过Transform将字节码用AspectJ去切,这样只需要在APP Module中Apply插件即可

感谢你提的建议,使用AspectJ本身就是因为其写起来方便,当时也并没有考虑到性能的问题,只是受JakeWharton的hugo启发才写的这个,当然后续也可以写一个ASM版本的。

@zhaolijunstar
Copy link

大佬,写了ASM版本了吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants