From fb604c99e43874e62a739b568cb4a33d5da8c6f1 Mon Sep 17 00:00:00 2001 From: Cao Dongping Date: Mon, 27 Mar 2017 12:20:20 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20annotationProcessor=20?= =?UTF-8?q?=E9=9B=86=E6=88=90=E6=96=B9=E5=BC=8F=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4f763f2..43fb704 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,19 @@ ![image](https://raw.githubusercontent.com/mzule/ActivityRouter/master/gif/http.gif) ## 集成 + +请根据项目的历史情况选择合适的集成方式 + +### 1. annotaitonProcessor 方式 + +``` groovy +dependencies { + compile 'com.github.mzule.activityrouter:activityrouter:1.2.2' + annotationProcessor 'com.github.mzule.activityrouter:compiler:1.1.7' +} +``` + +### 2. apt 方式 根目录 build.gradle ``` groovy @@ -26,8 +39,8 @@ buildscript { apply plugin: 'android-apt' dependencies { - compile 'com.github.mzule.activityrouter:activityrouter:1.2.2' - apt 'com.github.mzule.activityrouter:compiler:1.1.7' + compile 'com.github.mzule.activityrouter:activityrouter:1.2.2' + apt 'com.github.mzule.activityrouter:compiler:1.1.7' } ``` From ea64efba75fe549add224166e44615c0f2e847b4 Mon Sep 17 00:00:00 2001 From: Cao Dongping Date: Mon, 27 Mar 2017 12:24:35 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20annotationProcessor=20?= =?UTF-8?q?=E9=9B=86=E6=88=90=E6=96=B9=E5=BC=8F=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 43fb704..ffdc067 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,11 @@ ## 集成 +### 1. 添加引用 + 请根据项目的历史情况选择合适的集成方式 -### 1. annotaitonProcessor 方式 +#### 1.1 annotaitonProcessor 方式 ``` groovy dependencies { @@ -23,7 +25,7 @@ dependencies { } ``` -### 2. apt 方式 +#### 1.2 apt 方式 根目录 build.gradle ``` groovy @@ -44,6 +46,7 @@ dependencies { } ``` +### 2. 集成 在`AndroidManifest.xml`配置 From 7e55fae49b5184f503294bd5a35055e80ed9921b Mon Sep 17 00:00:00 2001 From: hych Date: Tue, 28 Mar 2017 15:54:30 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E8=A7=A3=E5=86=B3Demo=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E9=9D=99=E6=80=81=E6=96=B9=E6=B3=95=E6=B2=A1=E6=9C=89=E5=93=8D?= =?UTF-8?q?=E5=BA=94=E5=90=90=E5=8F=B8=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/activity_launch.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/res/layout/activity_launch.xml b/app/src/main/res/layout/activity_launch.xml index f816ce6..a1e75e0 100644 --- a/app/src/main/res/layout/activity_launch.xml +++ b/app/src/main/res/layout/activity_launch.xml @@ -59,9 +59,9 @@ + android:text="router://logout"/> + android:text="router://upload"/> From fd9e0870c86319a7c867bc5752942b1787be6a9d Mon Sep 17 00:00:00 2001 From: "troy.tang" Date: Fri, 28 Apr 2017 14:30:56 +0800 Subject: [PATCH 4/5] 1. Replace android-apt by annotation processor 2. Upgrade to gradle 2.2.3 --- activityrouter/build.gradle | 1 - app/build.gradle | 3 +-- app_module/build.gradle | 3 +-- build.gradle | 3 +-- compiler/build.gradle | 4 ++-- 5 files changed, 5 insertions(+), 9 deletions(-) diff --git a/activityrouter/build.gradle b/activityrouter/build.gradle index e485466..1ab6971 100644 --- a/activityrouter/build.gradle +++ b/activityrouter/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'com.neenbedankt.android-apt' sourceCompatibility = 1.7 targetCompatibility = 1.7 diff --git a/app/build.gradle b/app/build.gradle index fe44043..725d235 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.application' -apply plugin: 'com.neenbedankt.android-apt' sourceCompatibility = 1.7 targetCompatibility = 1.7 @@ -32,5 +31,5 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile project(':app_module') - apt project(':compiler') + annotationProcessor project(':compiler') } diff --git a/app_module/build.gradle b/app_module/build.gradle index a01738e..2c2ce05 100644 --- a/app_module/build.gradle +++ b/app_module/build.gradle @@ -1,5 +1,4 @@ apply plugin: 'com.android.library' -apply plugin: 'com.neenbedankt.android-apt' android { compileSdkVersion 24 @@ -30,5 +29,5 @@ dependencies { compile 'com.android.support:appcompat-v7:24.2.1' testCompile 'junit:junit:4.12' compile project(':activityrouter') - apt project(':compiler') + annotationProcessor project(':compiler') } diff --git a/build.gradle b/build.gradle index f4c2818..03aec8e 100644 --- a/build.gradle +++ b/build.gradle @@ -5,10 +5,9 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.0' + classpath 'com.android.tools.build:gradle:2.2.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1' - classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/compiler/build.gradle b/compiler/build.gradle index 569987f..2e9ed2d 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -28,8 +28,8 @@ ext { } dependencies { - compile 'com.google.auto.service:auto-service:1.0-rc2' - compile 'com.squareup:javapoet:1.6.1' + compile 'com.squareup:javapoet:1.8.0' + compile 'com.google.auto.service:auto-service:1.0-rc3' compile 'com.github.mzule.activityrouter:annotation:1.1.5' } From 2f39508cce35674d0aa34f21ca9979eec2af5172 Mon Sep 17 00:00:00 2001 From: Cao Dongping Date: Mon, 19 Jun 2017 18:25:46 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=9A=E6=A8=A1?= =?UTF-8?q?=E5=9D=97=E6=94=AF=E6=8C=81=E8=AF=B4=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index ffdc067..a649dad 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,10 @@ public static void logout(Context context, Bundle bundle) { ### 支持多模块 +* 每个包含 activity 的 module 都要添加 apt 依赖 +* 每个 module(包含主项目) 都要添加一个 @Module(name) 的注解在任意类上面,name 是项目的名称 +* 主项目要添加一个 @Modules({name0, name1, name2}) 的注解,指定所有的 module 名称集合 + ## 混淆配置 ``` groovy