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

建议移除 arouter-gradle-plugin #716

Closed
hotstu opened this issue Jul 26, 2019 · 1 comment
Closed

建议移除 arouter-gradle-plugin #716

hotstu opened this issue Jul 26, 2019 · 1 comment

Comments

@hotstu
Copy link

hotstu commented Jul 26, 2019

arouter使用arouter-gradle-plugin在app的编译期间使用transform方式在class文件中织入各个子模块的路由信息,这样有一些不好的地方: 编译速度被拖慢、配置起来太麻烦。

其实没必要单独写一个插件,因为Android gradle plugin 已经自带了一个transform叫resMergeTransform,arouter只要在使用apt输出路由信息的时候把信息作为资源文件输出到指定目录,例如arouter/config.properties
然后在app项目的build.gradle中添加

   packagingOptions {
        merge "/arouter/config.properties"
    }

这样所有模块的路由信息都被打包到一个配置文件中,运行时只要像加载类一样读取这个文件就行了

@zhi1ong
Copy link
Member

zhi1ong commented Aug 2, 2019

配置文件会暴露出你所有的路由信息

@zhi1ong zhi1ong closed this as completed Aug 2, 2019
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

2 participants