Skip to content

Commit

Permalink
build: 2.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
cssxsh committed Aug 2, 2022
1 parent 72b9b7d commit 6bda2c7
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -118,4 +118,4 @@ run/
!gradle-wrapper.jar

# Local Test Launch point
src/test/kotlin/RunTerminal.kt
debug-sandbox
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ mirai {
* `/selenium status` 驱动进程状态
* `/selenium firefox` 下载解压 firefox
* `/selenium chromium` 下载解压 chromium
* `/selenium chart` 测试 图表绘制功能,将以群员入群事件和发言时间为数据集

## 配置

Expand All @@ -70,7 +71,7 @@ mirai {
* `proxy` 代理地址
* `log` 启用日志文件
* `browser` 指定使用的浏览器: `Chrome`,`Chromium`,`Firefox`,`Edge`
* `factory` 指定使用的Factory: ~~ktor~~,`netty` (ktor 不再可用)
* `factory` 指定使用的Factory: `netty` (ktor 不再可用)
* `arguments` 自定义 arguments, 可以尝试加入 `--no-sandbox`, `--disable-dev-shm-usage`, 解决兼容性问题
* `preferences` 自定义 preferences,浏览器配置

Expand All @@ -80,9 +81,9 @@ mirai {
* `edge` Edge 二进制文件路径
* `firefox` Firefox 二进制文件路径

## LoginSolver
## [MiraiSeleniumLoginSolver](src/main/kotlin/xyz/cssxsh/mirai/selenium/MiraiSeleniumLoginSolver.kt)

本插件提供了 [MiraiSeleniumLoginSolver](src/main/kotlin/xyz/cssxsh/mirai/selenium/MiraiSeleniumLoginSolver.kt)
本插件提供了 一个类似 [mirai-login-solver-selenium](https://github.com/project-mirai/mirai-login-solver-selenium) 的 登陆处理器
需要在 mirai 运行时中添加 JVM 属性 mirai.slider.captcha.supported (添加参数 -Dmirai.slider.captcha.supported) 启用

## 安装
Expand All @@ -94,5 +95,5 @@ mirai {

### 手动安装

1. 运行 [Mirai Console](https://github.com/mamoe/mirai-console) 生成`plugins`文件夹
1.[Releases](https://github.com/cssxsh/mirai-selenium-plugin/releases) 下载`jar`并将其放入`plugins`文件夹中
1. 运行 [Mirai Console](https://github.com/mamoe/mirai-console) 生成 `plugins` 文件夹
2.[Releases](https://github.com/cssxsh/mirai-selenium-plugin/releases) 下载 `jar` 并将其放入 `plugins` 文件夹中
16 changes: 9 additions & 7 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
plugins {
kotlin("jvm") version "1.6.21"
kotlin("plugin.serialization") version "1.6.21"
kotlin("jvm") version "1.7.10"
kotlin("plugin.serialization") version "1.7.10"

id("net.mamoe.mirai-console") version "2.12.0"
id("net.mamoe.maven-central-publish") version "0.7.1"
id("me.him188.kotlin-jvm-blocking-bridge") version "2.1.0-162.1"
id("net.mamoe.mirai-console") version "2.12.1"
id("me.him188.maven-central-publish") version "1.0.0-dev-3"
id("me.him188.kotlin-jvm-blocking-bridge") version "2.1.0-170.1"
}

group = "xyz.cssxsh.mirai"
version = "2.2.1"
version = "2.2.2"

mavenCentralPublish {
useCentralS01()
singleDevGithubProject("cssxsh", "mirai-selenium-plugin")
licenseFromGitHubProject("AGPL-3.0", "master")
workingDir = System.getenv("PUBLICATION_TEMP")?.let { file(it).resolve(projectName) }
?: project.buildDir.resolve("publishing-tmp")
publication {
artifact(tasks.getByName("buildPlugin"))
}
Expand All @@ -34,7 +36,7 @@ dependencies {
exclude("org.slf4j")
}
compileOnly("com.google.auto.service:auto-service-annotations:1.0.1")
compileOnly("net.mamoe:mirai-core-utils:2.12.0")
compileOnly("net.mamoe:mirai-core-utils:2.12.1")
// test
testImplementation(kotlin("test", "1.6.21"))
testImplementation("org.icepear.echarts:echarts-java:1.0.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public object MiraiSeleniumPlugin : KotlinPlugin(
JvmPluginDescription(
id = "xyz.cssxsh.mirai.plugin.mirai-selenium-plugin",
name = "mirai-selenium-plugin",
version = "2.2.1",
version = "2.2.2",
) {
author("cssxsh")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public object SeleniumCommand : CompositeCommand(
}

@SubCommand
@Description("下载解压 chromium, https://github.com/macchrome")
@Description("测试 图表绘制功能,将以群员入群事件和发言时间为数据集")
public suspend fun MemberCommandSenderOnMessage.chart() {
val tags = mapOf(
"Within 1 days" to LocalDateTime.now().minusDays(1),
Expand Down
2 changes: 1 addition & 1 deletion src/test/kotlin/xyz/cssxsh/mirai/test/RemoteWebDriver.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.openqa.selenium.remote.*

/**
* 注意,[RemoteWebDriver] 不要出现在 if (selenium) { } 外面,
* 否则 [MiraiSeleniumPlugin] 未安装时会出现 [NoClassDefFoundError]
* 否则 [xyz.cssxsh.mirai.selenium.MiraiSeleniumPlugin] 未安装时会出现 [NoClassDefFoundError]
* 也不应该作为 KotlinPlugin 的属性声明,否则会出现 [NoClassDefFoundError]
*/
lateinit var driver: RemoteWebDriver

0 comments on commit 6bda2c7

Please sign in to comment.