Skip to content

Commit

Permalink
Merge branch '1.x/master-androidx' into 1.x/master-androidx-java8
Browse files Browse the repository at this point in the history
# Conflicts:
#	.idea/misc.xml
  • Loading branch information
xiaojinzi123 committed Apr 14, 2022
2 parents 7e92163 + d7142c3 commit 9436a13
Show file tree
Hide file tree
Showing 17 changed files with 96 additions and 46 deletions.
4 changes: 2 additions & 2 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions ComponentImpl/src/main/java/com/xiaojinzi/component/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,18 @@
public class Config {

@NonNull
private Application application;
private final Application application;
@NonNull
private String defaultScheme;

private boolean isErrorCheck;
private boolean isInitRouterAsync;
private boolean isOptimizeInit;
private boolean isAutoRegisterModule;
private boolean isTipWhenUseApplication;
private boolean isUseRouteRepeatCheckInterceptor = true;
private long routeRepeatCheckDuration = 1000;
private ObjectToJsonConverter objectToJsonConverter;
private long notifyModuleChangedDelayTime;
private final String defaultScheme;
private final boolean isErrorCheck;
private final boolean isInitRouterAsync;
private final boolean isOptimizeInit;
private final boolean isAutoRegisterModule;
private final boolean isTipWhenUseApplication;
private final boolean isUseRouteRepeatCheckInterceptor;
private final long routeRepeatCheckDuration;
private final ObjectToJsonConverter objectToJsonConverter;
private final long notifyModuleChangedDelayTime;

private Config(@NonNull Builder builder) {
this.application = builder.application;
Expand Down Expand Up @@ -101,7 +100,8 @@ public static class Builder {
private String defaultScheme = "router";
// 是否进行检查, 默认是打开的, 仅在 debug 的时候有效
private boolean isErrorCheck = true;
private boolean isInitRouterAsync = false;
// 默认路由部分的初始化是异步的
private boolean isInitRouterAsync = true;
private boolean isOptimizeInit = false;
private boolean isAutoRegisterModule = false;
private boolean isTipWhenUseApplication = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ public void register(@NonNull final IComponentHostApplication moduleApp) {
if (moduleApplicationMap.containsKey(moduleApp.getHost())) {
LogUtil.loge("The module \"" + moduleApp.getHost() + "\" is already registered");
} else {
// 标记已经注册
moduleApplicationMap.put(moduleApp.getHost(), moduleApp);
// 模块的 Application 的 onCreate 执行
moduleApp.onCreate(Component.getApplication());
// 服务发现的注册. 这个不能异步, 因为有可能下一行就被用到了
ServiceCenter.getInstance().register(moduleApp.getHost());
Utils.postActionToWorkThread(new Runnable() {
// 路由的部分的注册, 可选的异步还是同步
Runnable r = new Runnable() {
@Override
public void run() {
RouterCenter.getInstance().register(moduleApp.getHost());
Expand All @@ -82,7 +86,13 @@ public void run() {
FragmentCenter.getInstance().register(moduleApp.getHost());
notifyModuleChanged();
}
});
};
// 路由是否异步初始化
if (Component.getConfig().isInitRouterAsync()) {
Utils.postActionToWorkThread(r);
} else {
r.run();
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,10 @@ public String getName() {
public void transform(TransformInvocation transformInvocation) throws TransformException, InterruptedException, IOException {
super.transform(transformInvocation);

if (!transformInvocation.isIncremental()) {
transformInvocation.getOutputProvider().deleteAll();
}

filterAllNames(transformInvocation);

// 消费型输入,可以从中获取jar包和class文件夹路径。需要输出给下一个任务
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,28 @@

[最简单的 Hello World 文档](https://github.com/xiaojinzi123/Component/wiki/%E4%B8%BB%E9%A1%B5)

## 3. Component 的功能
## 3. 完整文档

- [依赖和配置](https://github.com/xiaojinzi123/Component/wiki/%E4%BE%9D%E8%B5%96%E5%92%8C%E9%85%8D%E7%BD%AE)
- [Activity注解使用](https://github.com/xiaojinzi123/Component/wiki/RouterAnno-%E6%B3%A8%E8%A7%A3)
- [组件生命周期](https://github.com/xiaojinzi123/Component/wiki/%E4%B8%9A%E5%8A%A1%E7%BB%84%E4%BB%B6%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F)
- 跳转
- [跳转 Fragment](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%B3%E8%BD%AC-Fragment)
- [跳转-接口路由的方式](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%B3%E8%BD%AC-%E6%8E%A5%E5%8F%A3%E8%B7%AF%E7%94%B1%E7%9A%84%E6%96%B9%E5%BC%8F)
- [跳转-使用代码跳转](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%B3%E8%BD%AC-%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%A0%81%E8%B7%B3%E8%BD%AC)
- [拦截器](https://github.com/xiaojinzi123/Component/wiki/%E6%8B%A6%E6%88%AA%E5%99%A8)
- [服务发现实现跨模块调用](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%A8%E6%A8%A1%E5%9D%97%E6%9C%8D%E5%8A%A1%E8%B0%83%E7%94%A8)
- [ProxyIntent](https://github.com/xiaojinzi123/Component/wiki/ProxyIntent) 在需要使用 `Intent` 的地方使用
- [生成文档](https://github.com/xiaojinzi123/Component/wiki/%E6%96%87%E6%A1%A3%E7%94%9F%E6%88%90)
- [单独运行](https://github.com/xiaojinzi123/Component/wiki/%E4%B8%9A%E5%8A%A1%E7%BB%84%E4%BB%B6%E5%8D%95%E7%8B%AC%E8%BF%90%E8%A1%8C)
- [名词解释](https://github.com/xiaojinzi123/Component/wiki/%E5%90%8D%E8%AF%8D%E8%A7%A3%E9%87%8A)
- [基本介绍](https://github.com/xiaojinzi123/Component/wiki/%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%BB%8D%E5%92%8C%E6%9E%B6%E6%9E%84%E4%BB%8B%E7%BB%8D)
- [更新日志](./changelog.md)

**了解更多请看 [wiki](https://github.com/xiaojinzi123/Component/wiki/) 更多功能等你来发现**
**有关的文章 [到底什么是组件化](https://blog.csdn.net/u011692041/article/details/92572758) **

## 4. Component 功能介绍

组件化方案真的有很多,那么这个组件化方案优秀在哪里?相比于 `ARouter``WMRouter``ActivityRouter``CC``DDComponent`
等开源的组件化框架, 有哪些一样或者更加优秀的点
Expand Down Expand Up @@ -99,27 +120,6 @@
- [x] 如果你想单独使用这个功能, 也可以单独依赖使用, [链接是这里](https://github.com/xiaojinzi123/ActivityResultHelper)
- [ ] `注解驱动器` 不支持增量更新, 暂时不知道怎么去做
## 4. 完整文档
- [依赖和配置](https://github.com/xiaojinzi123/Component/wiki/%E4%BE%9D%E8%B5%96%E5%92%8C%E9%85%8D%E7%BD%AE)
- [Activity注解使用](https://github.com/xiaojinzi123/Component/wiki/RouterAnno-%E6%B3%A8%E8%A7%A3)
- [组件生命周期](https://github.com/xiaojinzi123/Component/wiki/%E4%B8%9A%E5%8A%A1%E7%BB%84%E4%BB%B6%E7%9A%84%E7%94%9F%E5%91%BD%E5%91%A8%E6%9C%9F)
- 跳转
- [跳转 Fragment](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%B3%E8%BD%AC-Fragment)
- [跳转-接口路由的方式](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%B3%E8%BD%AC-%E6%8E%A5%E5%8F%A3%E8%B7%AF%E7%94%B1%E7%9A%84%E6%96%B9%E5%BC%8F)
- [跳转-使用代码跳转](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%B3%E8%BD%AC-%E4%BD%BF%E7%94%A8%E4%BB%A3%E7%A0%81%E8%B7%B3%E8%BD%AC)
- [拦截器](https://github.com/xiaojinzi123/Component/wiki/%E6%8B%A6%E6%88%AA%E5%99%A8)
- [服务发现实现跨模块调用](https://github.com/xiaojinzi123/Component/wiki/%E8%B7%A8%E6%A8%A1%E5%9D%97%E6%9C%8D%E5%8A%A1%E8%B0%83%E7%94%A8)
- [ProxyIntent](https://github.com/xiaojinzi123/Component/wiki/ProxyIntent) 在需要使用 `Intent` 的地方使用
- [生成文档](https://github.com/xiaojinzi123/Component/wiki/%E6%96%87%E6%A1%A3%E7%94%9F%E6%88%90)
- [单独运行](https://github.com/xiaojinzi123/Component/wiki/%E4%B8%9A%E5%8A%A1%E7%BB%84%E4%BB%B6%E5%8D%95%E7%8B%AC%E8%BF%90%E8%A1%8C)
- [名词解释](https://github.com/xiaojinzi123/Component/wiki/%E5%90%8D%E8%AF%8D%E8%A7%A3%E9%87%8A)
- [基本介绍](https://github.com/xiaojinzi123/Component/wiki/%E5%9F%BA%E6%9C%AC%E4%BB%8B%E7%BB%8D%E5%92%8C%E6%9E%B6%E6%9E%84%E4%BB%8B%E7%BB%8D)
- [更新日志](./changelog.md)
**了解更多请看 [wiki](https://github.com/xiaojinzi123/Component/wiki/) 更多功能等你来发现**
**有关的文章 [到底什么是组件化](https://blog.csdn.net/u011692041/article/details/92572758) **
## 5. 配套的 `Idea Plugin`
`Android Studio` 中搜索插件名称:RouterGo, 即可下载对应的插件
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18095e2c7b4a216a92d8c76d7f0ce720
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1f5ddbeb8401145b7acc5fa1cd2e659fb26366b9
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xiaojinzi.component</groupId>
<artifactId>component-plugin</artifactId>
<version>1.9.2.1</version>
<dependencies>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-all</artifactId>
<version>5.2</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.android.tools.build</groupId>
<artifactId>gradle</artifactId>
<version>3.3.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.6</version>
<scope>runtime</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
87fda618a94f90be8e4606682ee24f87
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d8063b4fbdb35e5632479a14de5cda9bdbbab86d
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<groupId>com.xiaojinzi.component</groupId>
<artifactId>component-plugin</artifactId>
<versioning>
<release>1.9.2</release>
<release>1.9.2.1</release>
<versions>
<version>1.7.7.3</version>
<version>1.7.8</version>
Expand Down Expand Up @@ -33,7 +33,8 @@
<version>1.9.1-beta1</version>
<version>1.9.1-beta2</version>
<version>1.9.2</version>
<version>1.9.2.1</version>
</versions>
<lastUpdated>20210723124036</lastUpdated>
<lastUpdated>20220414024154</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d6fa990297fccba9d93e55e6dd3c118a
34adeac998d47a40eecb55af4a5db543
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7c92ab39b53ee8a7a1721fb60e7cb2b35dfcedaa
89a91666b15cabe6cc5272f01643459f763649b9
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### [v1.9.2.1](https://github.com/xiaojinzi123/Component/releases/tag/v1.9.2.1)
- 优化 Gradle Plugin 引起的 defined multiple times 的问题

#### [v1.9.2](https://github.com/xiaojinzi123/Component/releases/tag/v1.9.2)
- 统一 Kotlin 相关的版本
- 修复 v1.9.1-beta1 版本支持 scheme 改出来页面拦截器失效的问题
Expand Down
4 changes: 2 additions & 2 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ext.versions = [
constraintLayout : '2.0.4',
rxjava : '2.2.21',
rxandroid : "2.1.1",
component_version : "1.9.2",
component_plugin_upload_version : "1.9.2"
component_version : "1.9.2.1",
component_plugin_upload_version : "1.9.2.1"
]

ext.libs = [
Expand Down

0 comments on commit 9436a13

Please sign in to comment.