From f7ec4503a8cbdef33c1d0189683cb28b06fbae5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A3=E7=BA=AC?= Date: Mon, 18 Dec 2017 17:15:33 +0800 Subject: [PATCH] Update version of arouter api. --- README.md | 25 ++++++++++++++++--- README_CN.md | 25 ++++++++++++++++--- .../register/launch/PluginLaunch.groovy | 2 +- build.gradle | 2 +- gradle.properties | 2 +- 5 files changed, 47 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 76393b12..d6c0eff7 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ #### 最新版本 -模块|arouter-api|arouter-compiler|arouter-annotation ----|---|---|--- -最新版本|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-api/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-compiler/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-compiler/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-annotation/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-annotation/_latestVersion) +模块|arouter-api|arouter-compiler|arouter-annotation|arouter-register +---|---|---|---|--- +最新版本|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-api/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-compiler/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-compiler/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-annotation/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-annotation/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-register/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-register/_latestVersion) #### Demo展示 @@ -31,6 +31,7 @@ 10. 支持多种方式配置转场动画 11. 支持获取Fragment 12. 完全支持Kotlin以及混编(配置见文末 其他#5) +13. **支持第三方 App 加固**(使用 arouter-register 实现自动注册) #### 二、典型应用 1. 从外部URL映射到内部页面,以及参数传递与解析 @@ -107,6 +108,24 @@ ARouter.getInstance().build("/test/1") -keep class * implements com.alibaba.android.arouter.facade.template.IProvider ``` +6. 使用 Gradle 插件实现路由表的自动加载 +```gradle +apply plugin: 'com.alibaba.arouter' + +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath "com.alibaba:arouter-register:1.0.0" + } +} +``` +可选使用,通过 ARouter 提供的注册插件进行路由表的自动加载,默认通过扫描 dex 的方式 +进行加载通过 gradle 插件进行自动注册可以缩短初始化时间解决应用加固导致无法直接访问 +dex 文件,初始化失败的问题,需要注意的是,该插件必须搭配 api 1.3.0 使用! + #### 四、进阶用法 1. 通过URL跳转 ``` java diff --git a/README_CN.md b/README_CN.md index e423aca0..d15f919e 100644 --- a/README_CN.md +++ b/README_CN.md @@ -10,9 +10,9 @@ #### 最新版本 -模块|arouter-api|arouter-compiler|arouter-annotation ----|---|---|--- -最新版本|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-api/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-compiler/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-compiler/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-annotation/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-annotation/_latestVersion) +模块|arouter-api|arouter-compiler|arouter-annotation|arouter-register +---|---|---|---|--- +最新版本|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-api/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-api/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-compiler/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-compiler/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-annotation/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-annotation/_latestVersion)|[![Download](https://api.bintray.com/packages/zhi1ong/maven/arouter-register/images/download.svg)](https://bintray.com/zhi1ong/maven/arouter-register/_latestVersion) #### Demo展示 @@ -31,6 +31,7 @@ 10. 支持多种方式配置转场动画 11. 支持获取Fragment 12. 完全支持Kotlin以及混编(配置见文末 其他#5) +13. **支持第三方 App 加固**(使用 arouter-register 实现自动注册) #### 二、典型应用 1. 从外部URL映射到内部页面,以及参数传递与解析 @@ -107,6 +108,24 @@ ARouter.getInstance().build("/test/1") -keep class * implements com.alibaba.android.arouter.facade.template.IProvider ``` +6. 使用 Gradle 插件实现路由表的自动加载 +```gradle +apply plugin: 'com.alibaba.arouter' + +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath "com.alibaba:arouter-register:1.0.0" + } +} +``` +可选使用,通过 ARouter 提供的注册插件进行路由表的自动加载,默认通过扫描 dex 的方式 +进行加载通过 gradle 插件进行自动注册可以缩短初始化时间解决应用加固导致无法直接访问 +dex 文件,初始化失败的问题,需要注意的是,该插件必须搭配 api 1.3.0 使用! + #### 四、进阶用法 1. 通过URL跳转 ``` java diff --git a/arouter-register/src/main/groovy/com/alibaba/android/arouter/register/launch/PluginLaunch.groovy b/arouter-register/src/main/groovy/com/alibaba/android/arouter/register/launch/PluginLaunch.groovy index 401cccd9..75fa3e3c 100644 --- a/arouter-register/src/main/groovy/com/alibaba/android/arouter/register/launch/PluginLaunch.groovy +++ b/arouter-register/src/main/groovy/com/alibaba/android/arouter/register/launch/PluginLaunch.groovy @@ -21,7 +21,7 @@ public class PluginLaunch implements Plugin { if (isApp) { Logger.make(project) - Logger.i('project(' + project.name + ') apply arouter-register plugin') + Logger.i('Project enable arouter-register plugin') def android = project.extensions.getByType(AppExtension) def transformImpl = new RegisterTransform(project) diff --git a/build.gradle b/build.gradle index 0186c06e..7566104b 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "com.alibaba:arouter-register:1.0.0" + classpath 'com.alibaba:arouter-register:1.0.0' } } diff --git a/gradle.properties b/gradle.properties index e54bd6cd..131b0f37 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,7 +25,7 @@ MIN_SDK_VERSION=12 TARGET_SDK_VERSION=25 arouter_compiler_version=1.1.4 -arouter_api_version=1.2.4 +arouter_api_version=1.3.0 arouter_annotation_version=1.0.4 arouter_register_version=1.0.0