Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
1250422131 committed Aug 16, 2023
2 parents 5cf0b2b + 6c0a290 commit 5067e29
Showing 1 changed file with 14 additions and 21 deletions.
35 changes: 14 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,23 @@ DeepReCopy是针对Kotlin的Data类所开发的深度拷贝功能库,利用KSP

## 如何使用

### 仓库引入

请在你的`settings.gradle.kts`中的`repositories`中添加下面的仓库。
如果你是普通的gradle脚本,那么请用下面这个groovy版本

### 库的引入
由于项目使用了KSP,需要在脚本顶部添加KSP插件,在每个使用KSP的模块都需要哦。
groovy
```groovy
maven { url 'https://jitpack.io' }
```

如果你是kts扩展脚本,那么可以使用kotlin版本

```kotlin
maven {
setUrl("https://jitpack.io")
plugins {
id 'com.google.devtools.ksp' version '1.9.0-1.0.11'
}
```
### 库的引入

```groovy
implementation 'com.github.1250422131.DeepReCopy:core:<version>'
ksp 'com.github.1250422131.DeepReCopy:compiler:<version>'
implementation 'com.imcys.deeprecopy:core:<version>'
ksp 'com.imcys.deeprecopy:compiler:<version>'
```
kts
```kotlin
plugins {
id("com.google.devtools.ksp") version "1.9.0-1.0.11"
}

implementation("com.github.1250422131.DeepReCopy:core:<version>")
ksp("com.github.1250422131.DeepReCopy:compiler:<version>")
```
Expand Down Expand Up @@ -89,13 +82,13 @@ EnhancedData是用来增强Data类的,现阶段它只有对Data类进行扩展

我们看一则例子:

```kotlin
```kotlin
@EnhancedData
data class AData(val name: String, val title: String, val bData: BData)

@EnhancedData
data class BData(val doc: String, val content: String)
```
```

当对AData和BData顶上注解后我们点击Android Studio的Build。

Expand Down

0 comments on commit 5067e29

Please sign in to comment.