Skip to content

Commit

Permalink
升级版本
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Apr 24, 2024
1 parent 0cd1ac1 commit 885a847
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 17 deletions.
31 changes: 24 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
//必须项 👇
plugins {
...
id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.5.7"
id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.5.8"
}
```

Expand All @@ -77,7 +77,7 @@ plugins {
buildscript {
dependencies {
//必须项 👇
classpath 'io.github.FlyJingFish.AndroidAop:android-aop-plugin:1.5.7'
classpath 'io.github.FlyJingFish.AndroidAop:android-aop-plugin:1.5.8'
}
}
```
Expand All @@ -88,7 +88,7 @@ buildscript {
plugins {
//必须项 👇
id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.5.7" apply false
id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.5.8" apply false
}
```

Expand Down Expand Up @@ -135,17 +135,17 @@ plugins {
dependencies {
//必须项 👇
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-core:1.5.7'
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-annotation:1.5.7'
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-core:1.5.8'
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-annotation:1.5.8'
//必须项 👇如果您项目内已经有了这项不用加也可以
implementation 'androidx.appcompat:appcompat:1.3.0' // 至少在1.3.0及以上
//非必须项 👇,如果你想自定义切面需要用到,⚠️支持Java和Kotlin代码写的切面
ksp 'io.github.FlyJingFish.AndroidAop:android-aop-ksp:1.5.7'
ksp 'io.github.FlyJingFish.AndroidAop:android-aop-ksp:1.5.8'
//非必须项 👇,如果你想自定义切面需要用到,⚠️只适用于Java代码写的切面
annotationProcessor 'io.github.FlyJingFish.AndroidAop:android-aop-processor:1.5.7'
annotationProcessor 'io.github.FlyJingFish.AndroidAop:android-aop-processor:1.5.8'
//⚠️上边的 android-aop-ksp 和 android-aop-processor 二选一
}
```
Expand Down Expand Up @@ -183,6 +183,23 @@ android {

**另外设置此处之后由于 Android Studio 可能有缓存,建议重启 AS 并 clean 下项目再继续开发**

#### 五、开发中可设置代码织入方式(此步为可选配置项)

- **1、请为所有子 module 模块设置上述[步骤一](#%E4%B8%80%E5%BC%95%E5%85%A5%E6%8F%92%E4%BB%B6%E4%B8%8B%E8%BE%B9%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F%E4%BA%8C%E9%80%89%E4%B8%80%E5%BF%85%E9%A1%BB),例如:**
```gradle
plugins {
...
id 'android.aop'//最好放在最后一行
}
```
- **2、在根目录的 `gradle.properties` 添加如下设置**

```
androidAop.debugMode=true //设置为 true 默认走您项目当前的打包方式 ,false 则为全量打包方式
```

**⚠️⚠️⚠️请注意设置为 true 时部分功能将失效,只会为设置的 module 织入 aop 代码,三方jar包 不会织入代码**

### 本库内置了一些功能注解可供你直接使用

| 注解名称 | 参数说明 | 功能说明 |
Expand Down
30 changes: 24 additions & 6 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Add directly to ```build.gradle``` of **app**
//Required items 👇
plugins {
...
id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.5.7"
id "io.github.FlyJingFish.AndroidAop.android-aop" version "1.5.8"
}
```

Expand All @@ -85,7 +85,7 @@ plugins {
buildscript {
dependencies {
//Required items 👇
classpath 'io.github.FlyJingFish.AndroidAop:android-aop-plugin:1.5.7'
classpath 'io.github.FlyJingFish.AndroidAop:android-aop-plugin:1.5.8'
}
}
```
Expand Down Expand Up @@ -137,12 +137,12 @@ plugins {
dependencies {
//Required items 👇
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-core:1.5.7'
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-annotation:1.5.7'
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-core:1.5.8'
implementation 'io.github.FlyJingFish.AndroidAop:android-aop-annotation:1.5.8'
//Optional 👇, if you want to customize aspects, you need to use them, ⚠️supports aspects written in Java and Kotlin code
ksp 'io.github.FlyJingFish.AndroidAop:android-aop-ksp:1.5.7'
ksp 'io.github.FlyJingFish.AndroidAop:android-aop-ksp:1.5.8'
//Optional 👇, if you want to customize aspects, you need to use them, ⚠️only applies to aspects written in Java code
annotationProcessor 'io.github.FlyJingFish.AndroidAop:android-aop-processor:1.5.7'
annotationProcessor 'io.github.FlyJingFish.AndroidAop:android-aop-processor:1.5.8'
//⚠️Choose one of the above android-aop-ksp and android-aop-processor
}
```
Expand Down Expand Up @@ -179,6 +179,24 @@ android {
**⚠️⚠️⚠️After setting include and exclude, all aspects are only valid within the rules you set. Please remember your settings! **

**In addition, since Android Studio may have cache after setting this, it is recommended to restart AS and clean the project before continuing development**

#### 5. The code weaving method can be set during development (this step is an optional configuration item)

- **1. Please set the above [Step 1](#%E4%B8%80%E5%BC%95%E5%85%A5%E6%8F%92%E4%BB%B6% for all sub-module modules E4%B8%8B%E8%BE%B9%E4%B8%A4%E7%A7%8D%E6%96%B9%E5%BC%8F%E4%BA%8C%E9%80%89%E4% B8%80%E5%BF%85%E9%A1%BB), for example: **
```gradle
plugins {
...
id 'android.aop'//It is best to put it on the last line
}
```
- **2. Add the following settings to `gradle.properties` in the root directory**

```
androidAop.debugMode=true //Set to true to default to the current packaging method of your project, false to use the full packaging method
```

**⚠️⚠️⚠️Please note that when set to true, some functions will be disabled. Only the aop code will be woven into the set module, and the code will not be woven into the third-party jar package**

### This library has some built-in functional annotations for you to use directly.

| Annotation name | Parameter description | Function description |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class AndroidAopPlugin : Plugin<Project> {
val debugModeStr :String = project.properties["androidAop.debugMode"].toString()
val debugMode = debugModeStr == "true"
if (debugMode){
if (!isApp) {
logger.warn("Plugin ['android.aop'] 应该被用于 com.android.application 所在 module 下,打正式包时请注意将 androidAop.debugMode 设置为 false")
}
val isDynamicLibrary = project.plugins.hasPlugin(DynamicFeaturePlugin::class.java)

val android = project.extensions.findByName(ANDROID_EXTENSION_NAME) as BaseExtension
Expand Down Expand Up @@ -120,7 +123,6 @@ class AndroidAopPlugin : Plugin<Project> {
}
}else{
if (!isApp) {
logger.warn("Plugin ['android.aop'] can only be used under the application, not under the module library invalid!")
return
}
val androidComponents = project.extensions.getByType(AndroidComponentsExtension::class.java)
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ DEVELOPER_ID=FlyJingFish
DEVELOPER_NAME=FlyJingFish
DEVELOPER_EMAIL=[email protected]

TestVersion = 1.5.7
TestVersion = 1.5.8
SonatypeTestCode = 1395
TestType = 0
# 0 mavenLocal 1 SonatypeCache 2 mavenCentral
Expand Down
4 changes: 2 additions & 2 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Mon Apr 22 17:10:24 CST 2024
PROJ_VERSION=1.5.7
#Wed Apr 24 13:12:24 CST 2024
PROJ_VERSION=1.5.8

0 comments on commit 885a847

Please sign in to comment.