Skip to content

Commit 2534e1e

Browse files
authored
chore: change the scope(kotlin-stdlib) to provided (#1580)
Signed-off-by: Kraity <[email protected]>
1 parent 22cb840 commit 2534e1e

File tree

6 files changed

+84
-6
lines changed

6 files changed

+84
-6
lines changed

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,15 @@ dependencies {
9191
<artifactId>fastjson2-kotlin</artifactId>
9292
<version>2.0.33</version>
9393
</dependency>
94+
```
95+
96+
```xml
97+
<dependency>
98+
<groupId>org.jetbrains.kotlin</groupId>
99+
<artifactId>kotlin-stdlib</artifactId>
100+
<version>${kotlin-version}</version>
101+
</dependency>
94102

95-
<!-- 有些场景需要依赖kotlin-reflect -->
96103
<dependency>
97104
<groupId>org.jetbrains.kotlin</groupId>
98105
<artifactId>kotlin-reflect</artifactId>
@@ -108,6 +115,13 @@ dependencies {
108115
}
109116
```
110117

118+
```kotlin
119+
dependencies {
120+
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
121+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
122+
}
123+
```
124+
111125
### `Fastjson Extension`扩展模块
112126

113127
如果项目使用`SpringFramework`等框架,可以使用`fastjson-extension`模块,使用方式参考 [SpringFramework Support](docs/spring_support_cn.md)

README_EN.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,35 @@ If your project uses `kotlin`, you can use the `Fastjson-Kotlin` module, and use
9999
</dependency>
100100
```
101101

102-
`Kotlin Gradle`:
102+
```xml
103+
<dependency>
104+
<groupId>org.jetbrains.kotlin</groupId>
105+
<artifactId>kotlin-stdlib</artifactId>
106+
<version>${kotlin-version}</version>
107+
</dependency>
108+
109+
<dependency>
110+
<groupId>org.jetbrains.kotlin</groupId>
111+
<artifactId>kotlin-reflect</artifactId>
112+
<version>${kotlin-version}</version>
113+
</dependency>
114+
```
115+
116+
* `Kotlin Gradle`:
103117

104118
```kotlin
105119
dependencies {
106120
implementation("com.alibaba.fastjson2:fastjson2-kotlin:2.0.33")
107121
}
108122
```
109123

124+
```kotlin
125+
dependencies {
126+
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
127+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
128+
}
129+
```
130+
110131
### `Extension` integration module `fastjson-extension`
111132

112133
If your project uses a framework such as `SpringFramework`, you can use the `fastjson-extension` module, please refer to the usage [SpringFramework Support](docs/spring_support_en.md).

android-test/app/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ dependencies {
3737
implementation 'com.alibaba:fastjson:1.1.73.android'
3838
implementation 'com.alibaba.fastjson2:fastjson2:2.0.33-SNAPSHOT'
3939
implementation 'com.alibaba.fastjson2:fastjson2-kotlin:2.0.33-SNAPSHOT'
40+
41+
implementation 'org.jetbrains.kotlin:kotlin-stdlib:1.8.10'
4042
implementation 'org.jetbrains.kotlin:kotlin-reflect:1.8.10'
4143

4244
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.14.2'

docs/kotlin_cn.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,42 @@
77
`Maven`:
88

99
```xml
10-
1110
<dependency>
1211
<groupId>com.alibaba.fastjson2</groupId>
1312
<artifactId>fastjson2-kotlin</artifactId>
1413
<version>2.0.33</version>
1514
</dependency>
1615
```
1716

18-
`Kotlin Gradle`:
17+
```xml
18+
<dependency>
19+
<groupId>org.jetbrains.kotlin</groupId>
20+
<artifactId>kotlin-stdlib</artifactId>
21+
<version>${kotlin-version}</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.jetbrains.kotlin</groupId>
26+
<artifactId>kotlin-reflect</artifactId>
27+
<version>${kotlin-version}</version>
28+
</dependency>
29+
```
30+
31+
* `Kotlin Gradle`:
1932

2033
```kotlin
2134
dependencies {
2235
implementation("com.alibaba.fastjson2:fastjson2-kotlin:2.0.33")
2336
}
2437
```
2538

39+
```kotlin
40+
dependencies {
41+
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
42+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
43+
}
44+
```
45+
2646
### 1.2 导包工作
2747

2848
每当调用`fastjson-kotlin`里的函数时,需要完成导包工作,**否则会提示找不到相应函数**

docs/kotlin_en.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,42 @@ If your project uses `kotlin`, you can use the` Fastjson-Kotlin` module, and use
77
`Maven`:
88

99
```xml
10-
1110
<dependency>
1211
<groupId>com.alibaba.fastjson2</groupId>
1312
<artifactId>fastjson2-kotlin</artifactId>
1413
<version>2.0.33</version>
1514
</dependency>
1615
```
1716

18-
`Kotlin Gradle`:
17+
```xml
18+
<dependency>
19+
<groupId>org.jetbrains.kotlin</groupId>
20+
<artifactId>kotlin-stdlib</artifactId>
21+
<version>${kotlin-version}</version>
22+
</dependency>
23+
24+
<dependency>
25+
<groupId>org.jetbrains.kotlin</groupId>
26+
<artifactId>kotlin-reflect</artifactId>
27+
<version>${kotlin-version}</version>
28+
</dependency>
29+
```
30+
31+
* `Kotlin Gradle`:
1932

2033
```kotlin
2134
dependencies {
2235
implementation("com.alibaba.fastjson2:fastjson2-kotlin:2.0.33")
2336
}
2437
```
2538

39+
```kotlin
40+
dependencies {
41+
implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version")
42+
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlin_version")
43+
}
44+
```
45+
2646
### 1.2 Import functions
2747

2848
Whenever the function in the `Fastjson-Kotlin`, you need to complete the import functions work, **otherwise it will be prompted that the corresponding function will not be found**.

kotlin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
<dependency>
4444
<groupId>org.jetbrains.kotlin</groupId>
4545
<artifactId>kotlin-stdlib-jdk8</artifactId>
46+
<scope>provided</scope>
4647
</dependency>
4748
</dependencies>
4849

0 commit comments

Comments
 (0)