Skip to content

Commit

Permalink
更新说明文档
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexiangjys committed Oct 25, 2020
1 parent c28d31e commit e5e29ea
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 21 deletions.
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

## 1、演示(请star支持)

![](https://github.com/xuexiangjys/XAOP/blob/master/img/aop.gif)
![aop.gif](https://img.rruu.net/image/5f9551baed9a7)

## 2、如何使用
目前支持主流开发工具AndroidStudio的使用,直接配置build.gradle,增加依赖即可.
Expand All @@ -69,7 +69,7 @@ buildscript {
···
dependencies {
···
classpath 'com.github.xuexiangjys.XAOP:xaop-plugin:1.0.5'
classpath 'com.github.xuexiangjys.XAOP:xaop-plugin:1.1.0'
}
}
```
Expand All @@ -81,13 +81,14 @@ apply plugin: 'com.xuexiang.xaop' //引用xaop插件
dependencies {
···
//添加依赖
//如果是androidx项目,使用1.1.0版本及以上
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.1.0'
//如果是support项目,请使用1.0.5版本
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.0.5'
//如果你升级到androidx,请使用下面依赖
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.0.5x'
}
```

4.在Application中进行初始化

```
Expand Down Expand Up @@ -146,7 +147,7 @@ buildscript {
···
dependencies {
···
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.4'
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'
}
}
```
Expand All @@ -156,6 +157,10 @@ buildscript {
```
apply plugin: 'android-aspectjx' //引用aspectjx插件
aspectjx {
include '项目的applicationId'
}
```

详细使用可参见kotlin-test项目进行使用.
Expand Down Expand Up @@ -342,10 +347,8 @@ private String hello(String name, String cardId) {

> 你的打赏是我维护的动力,我将会列出所有打赏人员的清单在下方作为凭证,打赏前请留下打赏项目的备注!
![](https://github.com/xuexiangjys/Resource/blob/master/img/pay/alipay.jpeg)   ![](https://github.com/xuexiangjys/Resource/blob/master/img/pay/weixinpay.jpeg)
![pay.png](https://img.rruu.net/image/5f871d00045da)

## 联系方式

[![](https://img.shields.io/badge/点击一键加入QQ群-602082750-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=9922861ef85c19f1575aecea0e8680f60d9386080a97ed310c971ae074998887)

![](https://github.com/xuexiangjys/XPage/blob/master/img/qq_group.jpg)
![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)
51 changes: 45 additions & 6 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ buildscript {
···
dependencies {
···
classpath 'com.github.xuexiangjys.XAOP:xaop-plugin:1.0.5'
classpath 'com.github.xuexiangjys.XAOP:xaop-plugin:1.1.0'
}
}
```
Expand All @@ -61,9 +61,10 @@ apply plugin: 'com.xuexiang.xaop' //引用xaop插件
dependencies {
···
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.0.5' //添加依赖
//如果你升级到androidx,请使用下面依赖
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.0.5x'
//如果是androidx项目,使用1.1.0版本及以上
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.1.0'
//如果是support项目,请使用1.0.5版本
implementation 'com.github.xuexiangjys.XAOP:xaop-runtime:1.0.5'
}
```
Expand Down Expand Up @@ -102,9 +103,47 @@ XAOP.setInterceptor(new Interceptor() {
}
});
//设置自动捕获异常的处理者
XAOP.setIThrowableHandler(new IThrowableHandler() {
@Override
public Object handleThrowable(String flag, Throwable throwable) {
XLogger.d("捕获到异常,异常的flag:" + flag);
if (flag.equals(TRY_CATCH_KEY)) {
return 100;
}
return null;
}
});
```

## 联系方式
## 兼容Kotlin语法配置

1.在项目根目录的 build.gradle 的 dependencies 添加aspectjx插件:

[![](https://img.shields.io/badge/点击一键加入QQ群-602082750-blue.svg)](http://shang.qq.com/wpa/qunwpa?idkey=9922861ef85c19f1575aecea0e8680f60d9386080a97ed310c971ae074998887)
```
buildscript {
···
dependencies {
···
classpath 'com.hujiang.aspectjx:gradle-android-plugin-aspectjx:2.0.10'
}
}
```

2.在项目的 build.gradle 中增加依赖并引用aspectjx插件

```
apply plugin: 'android-aspectjx' //引用aspectjx插件
aspectjx {
include '项目的applicationId'
}
```

详细使用可参见kotlin-test项目进行使用.

## 联系方式

![gzh_weixin.jpg](https://img.rruu.net/image/5f871cfff3194)
6 changes: 3 additions & 3 deletions xaop-annotation/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
Expand All @@ -22,7 +22,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])

compileOnly deps.support.app_compat
compileOnly deps.androidx.appcompat
}

apply from: "../JitPackUpload.gradle"
4 changes: 2 additions & 2 deletions xaop-plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

apply plugin: 'groovy'

targetCompatibility = JavaVersion.VERSION_1_7
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8

dependencies {
implementation gradleApi()//gradle sdk
Expand Down

0 comments on commit e5e29ea

Please sign in to comment.