Skip to content

Commit b25be2d

Browse files
committed
移除 adapter 的 ktor 引擎
更新 yutori 格式化代码
1 parent af51c9b commit b25be2d

File tree

20 files changed

+1771
-2064
lines changed

20 files changed

+1771
-2064
lines changed

.gitignore

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
*.iml
32
.gradle
43
.idea
@@ -12,4 +11,4 @@ captures
1211
local.properties
1312
xcuserdata/
1413
Pods/
15-
*yarn.lock
14+
*yarn.lock

README.MD

+28-22
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div align="center">
1+
<div style="text-align: center;">
22

33
# Yutorix-Satori
44

@@ -22,23 +22,23 @@ build.gradle.kts
2222

2323
```kotlin
2424
maven {
25-
url = uri("https://maven.pkg.github.com/Nyayurin/yutorix-satori")
26-
credentials {
27-
username = project.findProperty("gpr.actor") as String? ?: System.getenv("GITHUB_ACTOR")
28-
password = project.findProperty("gpr.token") as String? ?: System.getenv("GITHUB_TOKEN")
29-
}
25+
url = uri("https://maven.pkg.github.com/Nyayurin/yutorix-satori")
26+
credentials {
27+
username = project.findProperty("gpr.actor") as String? ?: System.getenv("GITHUB_ACTOR")
28+
password = project.findProperty("gpr.token") as String? ?: System.getenv("GITHUB_TOKEN")
29+
}
3030
}
3131
```
3232

3333
settings.gradle.kts
3434

3535
```kotlin
36-
maven {
37-
url = uri("https://maven.pkg.github.com/Nyayurin/yutorix-satori")
38-
credentials {
39-
username = providers.gradleProperty("gpr.actor").orNull ?: System.getenv("GITHUB_ACTOR")
40-
password = providers.gradleProperty("gpr.token").orNull ?: System.getenv("GITHUB_TOKEN")
41-
}
36+
maven {
37+
url = uri("https://maven.pkg.github.com/Nyayurin/yutorix-satori")
38+
credentials {
39+
username = providers.gradleProperty("gpr.actor").orNull ?: System.getenv("GITHUB_ACTOR")
40+
password = providers.gradleProperty("gpr.token").orNull ?: System.getenv("GITHUB_TOKEN")
41+
}
4242
}
4343
```
4444

@@ -65,17 +65,23 @@ yutorix-satori-server = { module = "cn.yurin.yutorix:yutorix-satori-server", ver
6565
对于开发板, 它的版本号应该和 Commit 的完整 SHA 值一致<br>
6666
要获取一个 Commit 的完整 SHA 值, 请在 Commits 页面对应 Commit 处点击 Commit ID 右侧的复制按钮(Copy full SHA for *******)
6767

68+
如果使用 adapter 模块, 请参考 [Ktor 文档](https://ktor.io/docs/client-engines.html) 引入引擎
69+
6870
安装模块
6971

7072
```kotlin
71-
install(Adapter.satori(
72-
host = "127.0.0.1",
73-
port = 8080,
74-
token = "token"
75-
))
76-
install(Server.satori(
77-
listen = "0.0.0.0",
78-
port = 8080,
79-
token = "token"
80-
))
73+
install(
74+
Adapter.satori(
75+
host = "127.0.0.1",
76+
port = 8080,
77+
token = "token"
78+
)
79+
)
80+
install(
81+
Server.satori(
82+
listen = "0.0.0.0",
83+
port = 8080,
84+
token = "token"
85+
)
86+
)
8187
```

adapter/build.gradle.kts

+101-129
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,114 @@
11
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
22

33
plugins {
4-
alias(libs.plugins.multiplatform)
5-
alias(libs.plugins.serialization)
6-
alias(libs.plugins.atomicfu)
7-
alias(libs.plugins.android.library)
4+
alias(libs.plugins.multiplatform)
5+
alias(libs.plugins.serialization)
6+
alias(libs.plugins.atomicfu)
7+
alias(libs.plugins.android.library)
88
}
99

1010
kotlin {
11-
jvmToolchain(21)
12-
13-
jvm()
14-
15-
androidTarget {
16-
publishLibraryVariants("release", "debug")
17-
}
18-
19-
js {
20-
browser {
21-
webpackTask {
22-
mainOutputFileName = "yutorix-satori-adapter.js"
23-
}
24-
}
25-
nodejs()
26-
binaries.library()
27-
}
28-
29-
@OptIn(ExperimentalWasmDsl::class)
30-
wasmJs {
31-
browser {
32-
webpackTask {
33-
mainOutputFileName = "yutorix-satori-adapter.js"
34-
}
35-
}
36-
nodejs()
37-
binaries.library()
38-
}
39-
40-
// Apple(IOS & MacOS)
41-
listOf(
42-
iosX64(),
43-
iosArm64(),
44-
iosSimulatorArm64(),
45-
macosX64(),
46-
macosArm64()
47-
).forEach {
48-
it.binaries.framework {
49-
baseName = "yutorix-satori-adapter"
50-
isStatic = true
51-
}
52-
}
53-
54-
// Linux
55-
listOf(
56-
linuxX64(),
57-
linuxArm64()
58-
).forEach {
59-
it.binaries.staticLib {
60-
baseName = "yutorix-satori-adapter"
61-
}
62-
}
63-
64-
// Windows
65-
mingwX64 {
66-
binaries.staticLib {
67-
baseName = "yutorix-satori-adapter"
68-
}
69-
}
70-
71-
sourceSets {
72-
commonMain.dependencies {
73-
implementation(libs.yutori)
74-
implementation(project(":yutorix-satori-core"))
75-
api(libs.ktor.client.core)
76-
api(libs.ktor.client.content.negotiation)
77-
}
78-
79-
jvmMain.dependencies {
80-
api(libs.ktor.client.okhttp)
81-
}
82-
83-
androidMain.dependencies {
84-
api(libs.ktor.client.okhttp)
85-
}
86-
87-
jsMain.dependencies {
88-
api(libs.ktor.client.js)
89-
}
90-
91-
wasmJsMain.dependencies {
92-
api(libs.ktor.client.js)
93-
}
94-
95-
appleMain.dependencies {
96-
api(libs.ktor.client.darwin)
97-
}
98-
99-
linuxMain.dependencies {
100-
api(libs.ktor.client.curl)
101-
}
102-
103-
mingwMain.dependencies {
104-
api(libs.ktor.client.winhttp)
105-
}
106-
}
11+
jvmToolchain(21)
12+
13+
jvm()
14+
15+
androidTarget {
16+
publishLibraryVariants("release", "debug")
17+
}
18+
19+
js {
20+
browser {
21+
webpackTask {
22+
mainOutputFileName = "yutorix-satori-adapter.js"
23+
}
24+
}
25+
nodejs()
26+
binaries.library()
27+
}
28+
29+
@OptIn(ExperimentalWasmDsl::class)
30+
wasmJs {
31+
browser {
32+
webpackTask {
33+
mainOutputFileName = "yutorix-satori-adapter.js"
34+
}
35+
}
36+
nodejs()
37+
binaries.library()
38+
}
39+
40+
// Apple(IOS & MacOS)
41+
listOf(
42+
iosX64(),
43+
iosArm64(),
44+
iosSimulatorArm64(),
45+
macosX64(),
46+
macosArm64()
47+
).forEach {
48+
it.binaries.framework {
49+
baseName = "yutorix-satori-adapter"
50+
isStatic = true
51+
}
52+
}
53+
54+
// Linux
55+
listOf(
56+
linuxX64(),
57+
linuxArm64()
58+
).forEach {
59+
it.binaries.staticLib {
60+
baseName = "yutorix-satori-adapter"
61+
}
62+
}
63+
64+
// Windows
65+
mingwX64 {
66+
binaries.staticLib {
67+
baseName = "yutorix-satori-adapter"
68+
}
69+
}
70+
71+
sourceSets {
72+
commonMain.dependencies {
73+
implementation(libs.yutori)
74+
implementation(project(":yutorix-satori-core"))
75+
api(libs.ktor.client.core)
76+
api(libs.ktor.client.content.negotiation)
77+
}
78+
}
10779
}
10880

10981
android {
110-
namespace = "cn.yurn.yutorix.satori.adapter"
111-
compileSdk = 34
112-
113-
defaultConfig {
114-
minSdk = 24
115-
}
116-
compileOptions {
117-
sourceCompatibility = JavaVersion.VERSION_21
118-
sourceCompatibility = JavaVersion.VERSION_21
119-
}
82+
namespace = "cn.yurn.yutorix.satori.adapter"
83+
compileSdk = 34
84+
85+
defaultConfig {
86+
minSdk = 24
87+
}
88+
compileOptions {
89+
sourceCompatibility = JavaVersion.VERSION_21
90+
sourceCompatibility = JavaVersion.VERSION_21
91+
}
12092
}
12193

12294
publishing {
123-
publications.withType<MavenPublication> {
124-
pom {
125-
name = "Yutorix-Satori-Adapter"
126-
version = System.getenv("VERSION")
127-
description = "Kotlin Multiplatform library"
128-
url = "https://github.com/Nyayurn/yutorix-satori"
129-
130-
developers {
131-
developer {
132-
id = "Nyayurn"
133-
name = "Yurn"
134-
135-
}
136-
}
137-
scm {
138-
url = "https://github.com/Nyayurn/yutorix-satori"
139-
}
140-
}
141-
}
95+
publications.withType<MavenPublication> {
96+
pom {
97+
name = "Yutorix-Satori-Adapter"
98+
version = System.getenv("VERSION")
99+
description = "Kotlin Multiplatform library"
100+
url = "https://github.com/Nyayurn/yutorix-satori"
101+
102+
developers {
103+
developer {
104+
id = "Nyayurn"
105+
name = "Yurn"
106+
107+
}
108+
}
109+
scm {
110+
url = "https://github.com/Nyayurn/yutorix-satori"
111+
}
112+
}
113+
}
142114
}

0 commit comments

Comments
 (0)