Skip to content

Commit

Permalink
Merge branch 'master' into master-java8
Browse files Browse the repository at this point in the history
  • Loading branch information
keepactive committed Aug 5, 2020
2 parents 08740a8 + f191f6f commit 49bc3ed
Show file tree
Hide file tree
Showing 17 changed files with 72 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,9 @@ private void implementInterfaceMethod(TypeSpec.Builder typeSpecBuilder, Executab
} else {
// 说明是想匹配 resultCode
if (navigateAnnotation.resultCodeMatch() != Integer.MIN_VALUE) {
throw new ProcessException("do you forget to add parameter(" + ComponentConstants.CALLBACK_CLASS_NAME + ") to you method(" + methodPath + ")?");
if (callBackParameter == null) {
throw new ProcessException("do you forget to add parameter(" + ComponentConstants.CALLBACK_CLASS_NAME + ") to you method(" + methodPath + ")?");
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public class Component {
*/
private static Config mConfig = null;


private Component() {
}

Expand Down Expand Up @@ -186,5 +185,4 @@ private static void inject(@NonNull Object target, @Nullable Bundle bundle,
LogUtil.log("class '" + target.getClass().getName() + "' inject fail");
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import android.support.annotation.Nullable;

import com.xiaojinzi.component.Component;
import com.xiaojinzi.component.Config;
import com.xiaojinzi.component.ComponentUtil;
import com.xiaojinzi.component.application.IComponentCenterApplication;
import com.xiaojinzi.component.application.IComponentHostApplication;
Expand Down Expand Up @@ -80,7 +81,7 @@ public void register(@NonNull String host) {
}

/**
* 自动注册, 需要开启 {@link com.xiaojinzi.component.Config.Builder#optimizeInit(boolean)}
* 自动注册, 需要开启 {@link Config.Builder#optimizeInit(boolean)}
* 表示使用 Gradle 插件优化初始化
*/
public void autoRegister() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.xiaojinzi.component.Config;
import com.xiaojinzi.component.anno.support.CheckClassNameAnno;
import com.xiaojinzi.component.application.IComponentHostApplication;
import com.xiaojinzi.component.fragment.IComponentHostFragment;
Expand Down Expand Up @@ -42,7 +43,7 @@
* 对于有些人觉得这个时间无所谓, 其实我也这么觉得. 但是就是有人受不了这么多次的反射. 那么怎么办呢?
* <p>
* 现在初始化的时候获取实现需要用户选择使用 ASM 还是 反射的方式.
* {@link com.xiaojinzi.component.Config.Builder#optimizeInit(boolean)} 可以设置是否使用 ASM 的方式
* {@link Config.Builder#optimizeInit(boolean)} 可以设置是否使用 ASM 的方式
* 具体的示例代码可以参看 {@link ModuleManager#findModuleApplication(String)}.
* 所以这个类有啥用呢?简单点说就是我们会利用插件, 在编译之后对此类的空方法填上一些代码. 让他是以正常的 new 对象
* 的方式返回的, 而不是反射. 而抽取出这个类, 是为了字节码改动的范围尽可能的小.
Expand Down
22 changes: 20 additions & 2 deletions ModuleBase/src/main/java/com/xiaojinzi/base/router/SampleApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ NavigationDisposable test7(Context context,
Single<Integer> test7Rx(Context context,
@ParameterAnno("data") String data);

@NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
void test8_void(Context context,
@ParameterAnno("data") String data,
BiCallback<Intent> callback);

@NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
NavigationDisposable test8(Context context,
Expand All @@ -135,11 +141,23 @@ Single<Intent> test8Rx(Context context,

@NavigateAnno(resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
Completable test9(Context context);
void test9(Context context, Callback callback);

@NavigateAnno(resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
Completable test9_rx(Context context);

@NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
void test10(Context context, BiCallback<Intent> callback);

@NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
NavigationDisposable test10_disposable(Context context, BiCallback<Intent> callback);

@NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK)
@PathAnno(ModuleConfig.Module1.TEST)
Single<Intent> test10(Context context);
Single<Intent> test10_rx(Context context);

@PathAnno(ModuleConfig.Module1.TEST)
Completable test11(Context context);
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
b4d48c27e1219b827ed232b9887e4bc5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5220f832e3042b4dd55fd0092019631a6e8d656d
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.8.3.2</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 @@
c5a7ca1038be2150faf5c03871fc64f7
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d0c5f83bd06f319b37dda7e6cd48166a7d582487
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.8.3.1</release>
<release>1.8.3.2</release>
<versions>
<version>1.7.7.3</version>
<version>1.7.8</version>
Expand All @@ -18,7 +18,8 @@
<version>1.8.2.3</version>
<version>1.8.3</version>
<version>1.8.3.1</version>
<version>1.8.3.2</version>
</versions>
<lastUpdated>20200730021928</lastUpdated>
<lastUpdated>20200805142303</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9474cf824818b923699019de365052aa
a4cf46c1ec57b65a0939bc37600e555d
Original file line number Diff line number Diff line change
@@ -1 +1 @@
28925c51dfa07db61cf0b7b9d0ac1a22dac2dd42
375ae8e06c10e7bb354345fbc1b135636ffb6cf9
3 changes: 1 addition & 2 deletions app/src/main/java/com/xiaojinzi/componentdemo/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import android.app.Application;

import com.google.gson.Gson;
import com.xiaojinzi.component.Component;
import com.xiaojinzi.component.Config;
import com.xiaojinzi.component.impl.application.ModuleManager;
Expand Down Expand Up @@ -32,7 +31,7 @@ public void onCreate() {
// 自动加载所有模块, 依赖上面的 optimizeInit(true)
.autoRegisterModule(true)
// demo 测试, 线上并没有, 请勿配置
.objectToJsonConverter(obj -> new Gson().toJson(obj))
// .objectToJsonConverter(obj -> new Gson().toJson(obj))
// 执行构建
.build()
);
Expand Down
5 changes: 4 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

#### [v1.8.3](https://github.com/xiaojinzi123/Component/releases/tag/v1.8.2.3)
#### [v1.8.3.2](https://github.com/xiaojinzi123/Component/releases/tag/v1.8.3.2)
- 修复 void method(Context context, Callback callback); 这中 Api 接口方法生成代码失败的问题

#### [v1.8.3.1](https://github.com/xiaojinzi123/Component/releases/tag/v1.8.3.1)
- 增加 java8 的发布维度
- 支持属性注入多个属性. 主要用于兼容如果想变动 key 的问题.
- 支持 @ServiceAnno 标记的服务实现类, 可以可选的实现 IServiceLifecycle 接口来接受模块的生命周期的回调
Expand Down
6 changes: 3 additions & 3 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ ext.versions = [
version_name : "1.0",
support_lib : "28.0.0",
// 第三方控件的版本号
constraintLayout : '2.0.0-beta8',
constraintLayout : '2.0.0-rc1',
rxjava : '2.2.19',
rxandroid : "2.1.1",
component_version : "1.8.3.1",
component_plugin_upload_version: "1.8.3.1"
component_version : "1.8.3.2",
component_plugin_upload_version: "1.8.3.2"
]

ext.libs = [
Expand Down

0 comments on commit 49bc3ed

Please sign in to comment.