1 Star 0 Fork 7

x-gitee / CC

forked from 齐翊 / CC 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
cc-settings-demo-b.gradle 2.17 KB
一键复制 编辑 原始数据 按行查看 历史
//------------------------------------------------
//
// demo使用的自定义cc-settings文件
// 主要是为了自动注册组件B的processor
//
//------------------------------------------------
apply from: rootProject.file('cc-settings.gradle')
//apply from: 'https://raw.githubusercontent.com/luckybilly/CC/master/cc-settings.gradle'
dependencies {
//这里是为了示例给跨app组件调用添加权限验证
compile project(':component_protect_demo')
}
//auto register extension:
// 源码地址:https://github.com/luckybilly/AutoRegister
// 功能介绍:
// 在编译期扫描将打到apk包中的所有类
// 将 scanInterface的实现类 或 scanSuperClasses的子类
// 并在 codeInsertToClassName 类的 codeInsertToMethodName 方法中生成如下代码:
// codeInsertToClassName.registerMethodName(scanInterface)
// 要点:
// 1. codeInsertToMethodName 若未指定,则默认为static块
// 2. codeInsertToMethodName 与 registerMethodName 需要同为static或非static
// 自动生成的代码示例:
/*
在com.billy.app_lib_interface.CategoryManager.class文件中
static
{
register(new CategoryA()); //scanInterface的实现类
register(new CategoryB()); //scanSuperClass的子类
}
*/
autoregister {
registerInfo = [
//自动注册所有组件类(com.billy.cc.core.component.IComponent接口的实现类)
[
'scanInterface' : 'com.billy.cc.core.component.IComponent'
, 'codeInsertToClassName' : 'com.billy.cc.core.component.ComponentManager'
, 'registerMethodName' : 'registerComponent'
, 'exclude' : [//排除的类,支持正则表达式(包分隔符需要用/表示,不能用.)
'com.billy.cc.core.component.'.replaceAll("\\.", "/") + ".*"
]
],
//自动注册组件B的processor
[
'scanInterface' : 'com.billy.cc.demo.component.b.processor.IActionProcessor'
, 'codeInsertToClassName' : 'com.billy.cc.demo.component.b.ComponentB'
, 'codeInsertToMethodName' : 'initProcessors'
, 'registerMethodName' : 'add'
]
]
}
Java
1
https://gitee.com/x-gitee/CC.git
git@gitee.com:x-gitee/CC.git
x-gitee
CC
CC
master

搜索帮助