三、添加 编译时注解 和 注解处理器 依赖库依赖
在主应用 " app " 中 , 依赖上述 annotation 编译时注解 依赖库 和 annotation-compiler 注解处理器 依赖库 ;
右键点击应用 , 选择 " Open Modules Settings " 选项 ,
在 " Project Structure " 对话框中选择 " Dependencies " 选项卡 , 选择主应用 " app " , 点击 " + " 按钮 , 选择添加 " Module Dependency " 依赖库 ,
将 annotation 编译时注解 依赖库 和 annotation-compiler 注解处理器 依赖库 添加到主应用 " app " 的依赖中 ;
添加依赖完成 ;
点击 " OK " 按钮后 , 在 build.gradle 构建脚本中自动生成的依赖 :
dependencies { implementation project(path: ':annotation-compiler') implementation project(path: ':annotation') }
注意 : 对于 annotation-compiler 注解处理器 依赖库 不能使用 implementation , 必须使用 annotationProcessor ,
dependencies { annotationProcessor project(path: ':annotation-compiler') implementation project(path: ':annotation') }
四、博客资源
博客源码 :
GitHub : https://github.com/han1202012/APT
CSDN : https://download.csdn.net/download/han1202012/18883878



