diff --git a/ComponentCompiler/src/main/java/com/xiaojinzi/component/RouterApiProcessor.java b/ComponentCompiler/src/main/java/com/xiaojinzi/component/RouterApiProcessor.java index d79126f7..faf1a24d 100644 --- a/ComponentCompiler/src/main/java/com/xiaojinzi/component/RouterApiProcessor.java +++ b/ComponentCompiler/src/main/java/com/xiaojinzi/component/RouterApiProcessor.java @@ -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 + ")?"); + } } } } diff --git a/ComponentImpl/src/main/java/com/xiaojinzi/component/Component.java b/ComponentImpl/src/main/java/com/xiaojinzi/component/Component.java index 0e2943bb..32a9b1ac 100644 --- a/ComponentImpl/src/main/java/com/xiaojinzi/component/Component.java +++ b/ComponentImpl/src/main/java/com/xiaojinzi/component/Component.java @@ -37,7 +37,6 @@ public class Component { */ private static Config mConfig = null; - private Component() { } @@ -186,5 +185,4 @@ private static void inject(@NonNull Object target, @Nullable Bundle bundle, LogUtil.log("class '" + target.getClass().getName() + "' inject fail"); } } - } diff --git a/ComponentImpl/src/main/java/com/xiaojinzi/component/impl/application/ModuleManager.java b/ComponentImpl/src/main/java/com/xiaojinzi/component/impl/application/ModuleManager.java index 3e741500..54d5a204 100644 --- a/ComponentImpl/src/main/java/com/xiaojinzi/component/impl/application/ModuleManager.java +++ b/ComponentImpl/src/main/java/com/xiaojinzi/component/impl/application/ModuleManager.java @@ -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; @@ -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() { diff --git a/ComponentImpl/src/main/java/com/xiaojinzi/component/support/ASMUtil.java b/ComponentImpl/src/main/java/com/xiaojinzi/component/support/ASMUtil.java index 4d37398c..ab597338 100644 --- a/ComponentImpl/src/main/java/com/xiaojinzi/component/support/ASMUtil.java +++ b/ComponentImpl/src/main/java/com/xiaojinzi/component/support/ASMUtil.java @@ -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; @@ -42,7 +43,7 @@ * 对于有些人觉得这个时间无所谓, 其实我也这么觉得. 但是就是有人受不了这么多次的反射. 那么怎么办呢? *

* 现在初始化的时候获取实现需要用户选择使用 ASM 还是 反射的方式. - * {@link com.xiaojinzi.component.Config.Builder#optimizeInit(boolean)} 可以设置是否使用 ASM 的方式 + * {@link Config.Builder#optimizeInit(boolean)} 可以设置是否使用 ASM 的方式 * 具体的示例代码可以参看 {@link ModuleManager#findModuleApplication(String)}. * 所以这个类有啥用呢?简单点说就是我们会利用插件, 在编译之后对此类的空方法填上一些代码. 让他是以正常的 new 对象 * 的方式返回的, 而不是反射. 而抽取出这个类, 是为了字节码改动的范围尽可能的小. diff --git a/ModuleBase/src/main/java/com/xiaojinzi/base/router/SampleApi.java b/ModuleBase/src/main/java/com/xiaojinzi/base/router/SampleApi.java index 1c9673d2..b0677f9c 100644 --- a/ModuleBase/src/main/java/com/xiaojinzi/base/router/SampleApi.java +++ b/ModuleBase/src/main/java/com/xiaojinzi/base/router/SampleApi.java @@ -122,6 +122,12 @@ NavigationDisposable test7(Context context, Single 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 callback); + @NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK) @PathAnno(ModuleConfig.Module1.TEST) NavigationDisposable test8(Context context, @@ -135,11 +141,23 @@ Single 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 callback); + + @NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK) + @PathAnno(ModuleConfig.Module1.TEST) + NavigationDisposable test10_disposable(Context context, BiCallback callback); @NavigateAnno(forIntent = true, resultCodeMatch = Activity.RESULT_OK) @PathAnno(ModuleConfig.Module1.TEST) - Single test10(Context context); + Single test10_rx(Context context); @PathAnno(ModuleConfig.Module1.TEST) Completable test11(Context context); diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar new file mode 100644 index 00000000..0aa1b5f6 Binary files /dev/null and b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar differ diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar.md5 b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar.md5 new file mode 100644 index 00000000..487daa2e --- /dev/null +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar.md5 @@ -0,0 +1 @@ +b4d48c27e1219b827ed232b9887e4bc5 \ No newline at end of file diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar.sha1 b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar.sha1 new file mode 100644 index 00000000..6ad504c6 --- /dev/null +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.jar.sha1 @@ -0,0 +1 @@ +5220f832e3042b4dd55fd0092019631a6e8d656d \ No newline at end of file diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom new file mode 100644 index 00000000..a557acf4 --- /dev/null +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom @@ -0,0 +1,28 @@ + + + 4.0.0 + com.xiaojinzi.component + component-plugin + 1.8.3.2 + + + org.ow2.asm + asm-all + 5.2 + runtime + + + com.android.tools.build + gradle + 3.3.0 + runtime + + + com.google.code.gson + gson + 2.8.6 + runtime + + + diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom.md5 b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom.md5 new file mode 100644 index 00000000..5a3349c0 --- /dev/null +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom.md5 @@ -0,0 +1 @@ +c5a7ca1038be2150faf5c03871fc64f7 \ No newline at end of file diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom.sha1 b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom.sha1 new file mode 100644 index 00000000..80b4b4d1 --- /dev/null +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/1.8.3.2/component-plugin-1.8.3.2.pom.sha1 @@ -0,0 +1 @@ +d0c5f83bd06f319b37dda7e6cd48166a7d582487 \ No newline at end of file diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml b/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml index 85176d64..085632d7 100644 --- a/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml @@ -3,7 +3,7 @@ com.xiaojinzi.component component-plugin - 1.8.3.1 + 1.8.3.2 1.7.7.3 1.7.8 @@ -18,7 +18,8 @@ 1.8.2.3 1.8.3 1.8.3.1 + 1.8.3.2 - 20200730021928 + 20200805142303 diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.md5 b/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.md5 index 3b67709f..cda8aa59 100644 --- a/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.md5 +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.md5 @@ -1 +1 @@ -9474cf824818b923699019de365052aa \ No newline at end of file +a4cf46c1ec57b65a0939bc37600e555d \ No newline at end of file diff --git a/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.sha1 b/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.sha1 index 537d40d3..a680c083 100644 --- a/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.sha1 +++ b/RepoComponent/com/xiaojinzi/component/component-plugin/maven-metadata.xml.sha1 @@ -1 +1 @@ -28925c51dfa07db61cf0b7b9d0ac1a22dac2dd42 \ No newline at end of file +375ae8e06c10e7bb354345fbc1b135636ffb6cf9 \ No newline at end of file diff --git a/app/src/main/java/com/xiaojinzi/componentdemo/App.java b/app/src/main/java/com/xiaojinzi/componentdemo/App.java index ba468c29..f0fdc4b3 100644 --- a/app/src/main/java/com/xiaojinzi/componentdemo/App.java +++ b/app/src/main/java/com/xiaojinzi/componentdemo/App.java @@ -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; @@ -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() ); diff --git a/changelog.md b/changelog.md index 57625fbc..9224db42 100644 --- a/changelog.md +++ b/changelog.md @@ -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 接口来接受模块的生命周期的回调 diff --git a/dependencies.gradle b/dependencies.gradle index 7db22673..2682497d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -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 = [