diff --git a/README.md b/README.md index a649dad..4f763f2 100644 --- a/README.md +++ b/README.md @@ -11,21 +11,6 @@ ![image](https://raw.githubusercontent.com/mzule/ActivityRouter/master/gif/http.gif) ## 集成 - -### 1. 添加引用 - -请根据项目的历史情况选择合适的集成方式 - -#### 1.1 annotaitonProcessor 方式 - -``` groovy -dependencies { - compile 'com.github.mzule.activityrouter:activityrouter:1.2.2' - annotationProcessor 'com.github.mzule.activityrouter:compiler:1.1.7' -} -``` - -#### 1.2 apt 方式 根目录 build.gradle ``` groovy @@ -41,12 +26,11 @@ 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' } ``` -### 2. 集成 在`AndroidManifest.xml`配置 @@ -230,10 +214,6 @@ public static void logout(Context context, Bundle bundle) { ### 支持多模块 -* 每个包含 activity 的 module 都要添加 apt 依赖 -* 每个 module(包含主项目) 都要添加一个 @Module(name) 的注解在任意类上面,name 是项目的名称 -* 主项目要添加一个 @Modules({name0, name1, name2}) 的注解,指定所有的 module 名称集合 - ## 混淆配置 ``` groovy diff --git a/activityrouter/build.gradle b/activityrouter/build.gradle index 1ab6971..e485466 100644 --- a/activityrouter/build.gradle +++ b/activityrouter/build.gradle @@ -1,4 +1,5 @@ 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 725d235..fe44043 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'com.neenbedankt.android-apt' sourceCompatibility = 1.7 targetCompatibility = 1.7 @@ -31,5 +32,5 @@ dependencies { testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.2.1' compile project(':app_module') - annotationProcessor project(':compiler') + apt project(':compiler') } diff --git a/app/src/main/res/layout/activity_launch.xml b/app/src/main/res/layout/activity_launch.xml index a1e75e0..f816ce6 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="mzule://logout"/> + android:text="mzule://upload"/> diff --git a/app_module/build.gradle b/app_module/build.gradle index 2c2ce05..a01738e 100644 --- a/app_module/build.gradle +++ b/app_module/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply plugin: 'com.neenbedankt.android-apt' android { compileSdkVersion 24 @@ -29,5 +30,5 @@ dependencies { compile 'com.android.support:appcompat-v7:24.2.1' testCompile 'junit:junit:4.12' compile project(':activityrouter') - annotationProcessor project(':compiler') + apt project(':compiler') } diff --git a/build.gradle b/build.gradle index 03aec8e..f4c2818 100644 --- a/build.gradle +++ b/build.gradle @@ -5,9 +5,10 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.2.3' + classpath 'com.android.tools.build:gradle:2.2.0' 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 2e9ed2d..569987f 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -28,8 +28,8 @@ ext { } dependencies { - compile 'com.squareup:javapoet:1.8.0' - compile 'com.google.auto.service:auto-service:1.0-rc3' + compile 'com.google.auto.service:auto-service:1.0-rc2' + compile 'com.squareup:javapoet:1.6.1' compile 'com.github.mzule.activityrouter:annotation:1.1.5' }