Skip to content

Commit 0f17e65

Browse files
committed
build: 1.3.7
1 parent 40189d5 commit 0f17e65

5 files changed

Lines changed: 31 additions & 30 deletions

File tree

build.gradle.kts

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
plugins {
2-
kotlin("jvm") version "1.7.10"
3-
kotlin("plugin.serialization") version "1.7.10"
2+
kotlin("jvm") version "1.7.22"
3+
kotlin("plugin.serialization") version "1.7.22"
44

5-
id("net.mamoe.mirai-console") version "2.12.1"
5+
id("net.mamoe.mirai-console") version "2.13.2"
66
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
77
}
88

99
group = "io.github.gnuf0rce"
10-
version = "1.3.6"
10+
version = "1.3.7"
1111

1212
mavenCentralPublish {
1313
useCentralS01()
1414
singleDevGithubProject("gnuf0rce", "netdisk-filesync-plugin", "cssxsh")
1515
licenseFromGitHubProject("AGPL-3.0")
1616
workingDir = System.getenv("PUBLICATION_TEMP")?.let { file(it).resolve(projectName) }
17-
?: project.buildDir.resolve("publishing-tmp")
17+
?: buildDir.resolve("publishing-tmp")
1818
publication {
19-
artifact(tasks.getByName("buildPlugin"))
19+
artifact(tasks["buildPlugin"])
2020
}
2121
}
2222

@@ -26,15 +26,16 @@ repositories {
2626
}
2727

2828
dependencies {
29-
api("xyz.cssxsh.baidu:baidu-netdisk:3.2.0") {
30-
exclude(group = "org.jetbrains.kotlin")
31-
exclude(group = "org.jetbrains.kotlinx")
32-
exclude(group = "org.slf4j")
33-
}
34-
compileOnly("net.mamoe:mirai-core-utils:2.12.1")
35-
compileOnly("xyz.cssxsh.mirai:mirai-hibernate-plugin:2.4.3")
36-
//
29+
api("xyz.cssxsh.baidu:baidu-netdisk:3.3.0")
30+
compileOnly("xyz.cssxsh.mirai:mirai-hibernate-plugin:2.5.1")
3731
testImplementation(kotlin("test"))
32+
//
33+
implementation(platform("net.mamoe:mirai-bom:2.13.2"))
34+
compileOnly("net.mamoe:mirai-console-compiler-common")
35+
testImplementation("net.mamoe:mirai-logging-slf4j")
36+
//
37+
implementation(platform("org.slf4j:slf4j-parent:2.0.6"))
38+
testImplementation("org.slf4j:slf4j-simple")
3839
}
3940

4041
mirai {

readme.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
> 基于 [Mirai Console](https://github.com/mamoe/mirai-console) 的 文件同步/备份 插件
44
55
[![Release](https://img.shields.io/github/v/release/gnuf0rce/Netdisk-FileSync-Plugin)](https://github.com/gnuf0rce/Netdisk-FileSync-Plugin/releases)
6-
![Downloads](https://img.shields.io/github/downloads/gnuf0rce/Netdisk-FileSync-Plugin/total)
6+
[![Downloads](https://img.shields.io/github/downloads/gnuf0rce/Netdisk-FileSync-Plugin/total)](https://repo1.maven.org/maven2/io/github/gnuf0rce/netdisk-filesync-plugin/)
77
[![MiraiForum](https://img.shields.io/badge/post-on%20MiraiForum-yellow)](https://mirai.mamoe.net/topic/765)
88
[![maven-central](https://img.shields.io/maven-central/v/io.github.gnuf0rce/netdisk-filesync-plugin)](https://search.maven.org/artifact/io.github.gnuf0rce/netdisk-filesync-plugin)
99

@@ -31,7 +31,9 @@
3131

3232
### upload.yml
3333

34-
* https 使用Https协议下载文件
34+
* `https` 使用Https协议下载文件
35+
* `reply` 同步后回复消息
36+
* `log` 插件启动时上传日志文件
3537

3638
## 在插件项目中引用
3739

@@ -43,6 +45,10 @@ repositories {
4345
dependencies {
4446
compileOnly("io.github.gnuf0rce:netdisk-filesync-plugin:${version}")
4547
}
48+
49+
mirai {
50+
jvmTarget = JavaVersion.VERSION_11
51+
}
4652
```
4753

4854
### 示例代码
@@ -60,9 +66,9 @@ dependencies {
6066

6167
### MCL 指令安装
6268

63-
`./mcl --update-package io.github.gnuf0rce:netdisk-filesync-plugin --channel stable --type plugin`
69+
`./mcl --update-package io.github.gnuf0rce:netdisk-filesync-plugin --channel maven-stable --type plugin`
6470

6571
### 手动安装
6672

67-
1. 运行 [Mirai Console](https://github.com/mamoe/mirai-console) 生成`plugins`文件夹
68-
1.[Releases](https://github.com/gnuf0rce/Netdisk-FileSync-Plugin/releases) 下载`jar`并将其放入`plugins`文件夹中
73+
1. [Releases](https://github.com/gnuf0rce/Netdisk-FileSync-Plugin/releases) 或者 [Maven](https://repo1.maven.org/maven2/io/github/gnuf0rce/netdisk-filesync-plugin/) 下载 `mirai2.jar`
74+
2. 将其放入 `plugins` 文件夹中

settings.gradle.kts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
pluginManagement {
2-
repositories {
3-
mavenLocal()
4-
mavenCentral()
5-
gradlePluginPortal()
6-
}
7-
}
8-
91
rootProject.name = "netdisk-filesync-plugin"

src/main/kotlin/io/github/gnuf0rce/mirai/netdisk/NetDisk.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ public object NetDisk : BaiduNetDiskClient(config = NetdiskOauthConfig), Listene
9393

9494
override val apiIgnore: suspend (Throwable) -> Boolean = { throwable ->
9595
when (throwable) {
96+
is java.net.UnknownHostException,
97+
is java.net.NoRouteToHostException -> false
9698
is IOException -> {
9799
val count = ++throwable::class.count
98100
if (count > 10) {
@@ -245,7 +247,7 @@ public object NetDisk : BaiduNetDiskClient(config = NetdiskOauthConfig), Listene
245247
rapid(upload = rapid)
246248
return rapid
247249
} catch (cause: ClientRequestException) {
248-
logger.info { "文件 ${file.name} 秒传失败, 进入文件上传, ${cause.message}" }
250+
logger.info { "文件 ${file.name} 秒传失败, 进入文件上传, ${cause.response.bodyAsText()}" }
249251
} catch (exception: Exception) {
250252
logger.warning({ "文件 ${file.name} 秒传失败, 进入文件上传" }, exception)
251253
}

src/main/kotlin/io/github/gnuf0rce/mirai/netdisk/NetDiskFileSyncPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public object NetDiskFileSyncPlugin : KotlinPlugin(
2222
) {
2323
author("cssxsh")
2424

25-
dependsOn("xyz.cssxsh.mirai.plugin.mirai-hibernate-plugin", false)
25+
dependsOn("xyz.cssxsh.mirai.plugin.mirai-hibernate-plugin", true)
2626
}
2727
) {
2828

@@ -43,7 +43,7 @@ public object NetDiskFileSyncPlugin : KotlinPlugin(
4343
NetDiskFileSyncRecorder.enable()
4444
logger.info { "审核记录将记录到数据库 ${NetDiskFileSyncRecorder.database()}" }
4545
} catch (_: NoClassDefFoundError) {
46-
logger.info { "审核记录将记录到 ContentCensorHistory.yml" }
46+
logger.info { "审核记录将记录到 history.yml" }
4747
NetdiskSyncHistory.reload()
4848
}
4949

0 commit comments

Comments
 (0)