请问ARouter框架是不是没有汇总这个步骤

来源:6-9 实战:规划目标类的结构【生成汇总映射表】

彩色的沙漠

2021-03-23

翻了几次源码,它初始化的时候把生成的类都创建出来就相当于加载到内存,没有找到把相关映射表汇总的代码,还需要继续学习理顺ARouter的思路。ARouter前面的标记注解和收集注解生产java类和我们课程的思路一样,学习这个课程就能把ARouter编译器相关的源码看明白。

写回答

1回答

allenfeng

2021-03-23

关于映射表汇总,可以参考 arouter-register。

Using the custom gradle plugin to autoload the routing table

apply plugin: 'com.alibaba.arouter'

buildscript {
repositories {
jcenter()
}

dependencies {
// Replace with the latest version
classpath "com.alibaba:arouter-register:?"
}
}

Optional, use the registration plugin provided by the ARouter to automatically load the routing table(power by AutoRegister). By default, the ARouter will scanned the dex files . Performing an auto-registration via the gradle plugin can shorten the initialization time , it should be noted that the plugin must be used with api above 1.3.0!

1
1
彩色的沙漠
没有配置自动注册的插件的时候,会走ARouter.init去扫描收集看了几遍,里面只有扫描创建,没找到汇总,随后在研究一下
2021-03-23
共1条回复

Android 应用程序构建实战+原理精讲

深度掌握 Gradle 使用,系统性学习 Android 应用构建知识

450 学习 · 116 问题

查看课程