Skip to content

Commit

Permalink
Showing 50 changed files with 2,045 additions and 593 deletions.
14 changes: 14 additions & 0 deletions .changelog/v3.0.0.preview.19.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**仓库参考:**

| **模块** | **repo1.maven** | **search.maven** |
|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| simbot-api | [simbot-api: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/simbot-api/3.0.0.preview.19.0) | [simbot-api: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot/simbot-api/3.0.0.preview.19.0/jar) |
| simbot-core | [simbot-core: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/simbot-core/3.0.0.preview.19.0) | [simbot-core: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot/simbot-core/3.0.0.preview.19.0/jar) |
| simbot-logger | [simbot-logger: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/simbot-logger/3.0.0.preview.19.0) | [simbot-logger: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot/simbot-logger/3.0.0.preview.19.0/jar) |
| simboot-api | [simboot-api: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-api/3.0.0.preview.19.0) | [simboot-api: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-api/3.0.0.preview.19.0/jar) |
| simboot-core | [simboot-core: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-core/3.0.0.preview.19.0) | [simboot-core: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-core/3.0.0.preview.19.0/jar) |
| simboot-core-annotation | [simboot-core-annotation: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-core-annotation/3.0.0.preview.19.0) | [simboot-core-annotation: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-core-annotation/3.0.0.preview.19.0/jar) |
| simboot-core-spring-boot-starter | [simboot-core-spring-boot-starter: v3.0.0.preview.19.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-core-spring-boot-starter/3.0.0.preview.19.0) | [simboot-core-spring-boot-starter: v3.0.0.preview.19.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-core-spring-boot-starter/3.0.0.preview.19.0/jar) |



14 changes: 14 additions & 0 deletions .changelog/v3.0.0.preview.20.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
**仓库参考:**

| **模块** | **repo1.maven** | **search.maven** |
|----------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| simbot-api | [simbot-api: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/simbot-api/3.0.0.preview.20.0) | [simbot-api: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot/simbot-api/3.0.0.preview.20.0/jar) |
| simbot-core | [simbot-core: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/simbot-core/3.0.0.preview.20.0) | [simbot-core: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot/simbot-core/3.0.0.preview.20.0/jar) |
| simbot-logger | [simbot-logger: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/simbot-logger/3.0.0.preview.20.0) | [simbot-logger: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot/simbot-logger/3.0.0.preview.20.0/jar) |
| simboot-api | [simboot-api: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-api/3.0.0.preview.20.0) | [simboot-api: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-api/3.0.0.preview.20.0/jar) |
| simboot-core | [simboot-core: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-core/3.0.0.preview.20.0) | [simboot-core: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-core/3.0.0.preview.20.0/jar) |
| simboot-core-annotation | [simboot-core-annotation: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-core-annotation/3.0.0.preview.20.0) | [simboot-core-annotation: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-core-annotation/3.0.0.preview.20.0/jar) |
| simboot-core-spring-boot-starter | [simboot-core-spring-boot-starter: v3.0.0.preview.20.0](https://repo1.maven.org/maven2/love/forte/simbot/boot/simboot-core-spring-boot-starter/3.0.0.preview.20.0) | [simboot-core-spring-boot-starter: v3.0.0.preview.20.0](https://search.maven.org/artifact/love.forte.simbot.boot/simboot-core-spring-boot-starter/3.0.0.preview.20.0/jar) |



15 changes: 12 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
@@ -53,17 +53,25 @@ jobs:
distribution: 'temurin'
java-version: 8

# the gpg
- name: Decode gpg file
id: decode-gpg-file
run: |
mkdir -p ~/.gradle
echo "${{ secrets.GPG_B64 }}" > ~/.gradle/secring.gpg.b64
base64 -d ~/.gradle/secring.gpg.b64 > ~/.gradle/secring.gpg
echo "::set-output name=SEC_KEY_RING_FILE::$(echo ~/.gradle/secring.gpg)"
# setup Gradle
- name: Gradle Publish Release
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.4.2
arguments: clean build test publishToSonatype closeAndReleaseStagingRepository -Porg.gradle.workers.max=16 -Porg.gradle.parallel=true
arguments: clean build publishToSonatype closeAndReleaseStagingRepository --warning-mode all --info -Porg.gradle.jvmargs="org.gradle.jvmargs=-Xmx4G -Xms4G -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8"
env:
SIMBOT_IS_SNAPSHOT: false
SIMBOT_RELEASES_ONLY: true

SIMBOT_SNAPSHOT_ONLY: false

create-release:
name: Create release
@@ -107,10 +115,11 @@ jobs:
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.4.2
arguments: clean build test publishToSonatype closeAndReleaseStagingRepository -Porg.gradle.workers.max=16 -Porg.gradle.parallel=true
arguments: clean build publishToSonatype closeAndReleaseStagingRepository -Porg.gradle.workers.max=16 -Porg.gradle.parallel=true
env:
SIMBOT_IS_SNAPSHOT: true
SIMBOT_SNAPSHOT_ONLY: true
SIMBOT_RELEASES_ONLY: false

deploy-doc:
name: Deploy API Doc
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,12 @@

**⚠ 参与指南将会在后续完善,敬请期待 👷**

- 特性与修复
- Objective相关
- 事件相关
- 时间段类型参数


> 这些可能包括:
> - 创建良好议题或拉取请求的步骤。
> - 指向外部文档、邮件列表或行为准则的链接。
89 changes: 85 additions & 4 deletions PERFORMANCE_TESTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,107 @@
# 性能测试报告

此处会针对一部分需要可能需要关注、可能需要进行对比的相关api进行性能测试。
如果你对某些内容的性能对比感兴趣、或者对某些内容有好的优化策略/方案,欢迎通过
如果你对某些内容的性能对比感兴趣、或者对某些内容有好的方案或建议,欢迎通过
[issues](https://github.com/ForteScarlet/simpler-robot/issues/new/choose) 分享你的想法
[pr](https://github.com/ForteScarlet/simpler-robot/pulls) 贡献你的力量,十分感谢。

这些测试内容都应可以从相关的测试模块中找到。

## randomID(Random)

> [IDTest.kt](simbot-apis/simbot-api/src/test/kotlin/jmh/IdTest.kt)
针对内容:

- `randomID()` 对比 `UUID.randomUUID`
- `randomID()` 使用 `kotlin.Random.Default` 对比 `ThreadLocalRandom`

> JMH version: 1.33
> VM version: JDK 1.8.0_332, OpenJDK 64-Bit Server VM, 25.332-b09
```
# JMH version: 1.33
# VM version: JDK 1.8.0_332, OpenJDK 64-Bit Server VM, 25.332-b09
# Threads: 8 threads, will synchronize iterations
Benchmark Mode Cnt Score Error Units
IdTest.randomIdByDefaultGenerate thrpt 25 70801412.214 ± 1498689.005 ops/s
IdTest.randomIdByThreadLocalRandomGenerate thrpt 25 66505118.175 ± 730902.232 ops/s
IdTest.randomUUIDGenerate thrpt 25 1435474.691 ± 39339.236 ops/s
```

## TimeDuration

> [DurationTest](simbot-project-tests/simbot-project-test-jmh-duration/src/main/kotlin/love/forte/simbotest/duration/DurationTest.kt)
针对内容:

对几个可以代表"Duration"的类型的单位转化效率的测试。
包括:

- `kotlin.time.Duration`
- `java.time.Duration`
- `java.util.concurrent.TimeUnit`

> 讲道理,`kotiln.time.Duration` 的表现结果我是没想到会是这样。唔。。也许是我的使用方式有误?
**第一轮**

> JMH version: 1.35
> VM version: JDK 17.0.3, OpenJDK 64-Bit Server VM, 17.0.3+7-LTS
```
Benchmark Mode Cnt Score Error Units
DurationTest.MilliToSecond thrpt 2 355646.441 ops/ms
DurationTest.MilliToSecond:javaDurationMilliToSecond thrpt 2 211252.355 ops/ms
DurationTest.MilliToSecond:ktDurationMilliToSecond thrpt 2 42129.351 ops/ms
DurationTest.MilliToSecond:timeUnitMilliToSecond thrpt 2 102264.734 ops/ms
DurationTest.SecondToMilli thrpt 2 554247.894 ops/ms
DurationTest.SecondToMilli:javaDurationSecondToMilli thrpt 2 223422.624 ops/ms
DurationTest.SecondToMilli:ktDurationSecondToMilli thrpt 2 42339.539 ops/ms
DurationTest.SecondToMilli:timeUnitSecondToMilli thrpt 2 288485.731 ops/ms
```

**第二轮**

> JMH version: 1.35
> VM version: JDK 1.8.0_332, OpenJDK 64-Bit Server VM, 25.332-b09
```
Benchmark Mode Cnt Score Error Units
DurationTest.MilliToSecond thrpt 2 501943.887 ops/ms
DurationTest.MilliToSecond:javaDurationMilliToSecond thrpt 2 173481.768 ops/ms
DurationTest.MilliToSecond:ktDurationMilliToSecond thrpt 2 107571.847 ops/ms
DurationTest.MilliToSecond:timeUnitMilliToSecond thrpt 2 220890.272 ops/ms
DurationTest.SecondToMilli thrpt 2 536347.374 ops/ms
DurationTest.SecondToMilli:javaDurationSecondToMilli thrpt 2 212098.647 ops/ms
DurationTest.SecondToMilli:ktDurationSecondToMilli thrpt 2 104243.386 ops/ms
DurationTest.SecondToMilli:timeUnitSecondToMilli thrpt 2 220005.341 ops/ms
```

## DurationConvert

> [DurationConvertTest](simbot-apis/simbot-api/src/test/kotlin/jmh/DurationConvertTest.kt)
针对内容:

`java.time.Duration``TimeUnit``kotlin.time.Duration` 转化时的性能。

**第一轮**

> JMH version: 1.35
> VM version: JDK 17.0.2, OpenJDK 64-Bit Server VM, 17.0.2+8-86
```
Benchmark Mode Cnt Score Error Units
DurationConvertTest.MinutesDuration thrpt 447133.994 ops/ms
DurationConvertTest.MinutesDuration:javaMinutesDuration thrpt 76914.765 ops/ms
DurationConvertTest.MinutesDuration:javaMinutesDurationSimbot thrpt 103878.816 ops/ms
DurationConvertTest.MinutesDuration:minutesTimeUnit thrpt 266340.413 ops/ms
DurationConvertTest.SecondsDuration thrpt 533031.432 ops/ms
DurationConvertTest.SecondsDuration:javaSecondsDuration thrpt 77124.192 ops/ms
DurationConvertTest.SecondsDuration:javaSecondsDurationSimbot thrpt 106764.854 ops/ms
DurationConvertTest.SecondsDuration:secondsTimeUnit thrpt 349142.386 ops/ms
```


6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -76,9 +76,9 @@ simbot3目前已经实现的组件有:

| 组件目标 | 作者/团队 | 仓库地址 | 状态 |
|:---------------------------------------:|:-----------:|:-------------------------------------------------------------------------------------------------------------:|:---:|
| [QQ频道机器人](https://bot.q.qq.com/wiki) | simbot team | [simple-robot/simbot-component-tencent-guild](https://github.com/simple-robot/simbot-component-tencent-guild) | 维护中 |
| [Mirai](https://github.com/mamoe/mirai) | simbot team | [simple-robot/simbot-component-mirai](https://github.com/simple-robot/simbot-component-mirai) | 维护中 |
| [开黑啦](https://www.kaiheila.cn/) | simbot team | [simple-robot/simbot-component-kaiheila](https://github.com/simple-robot/simbot-component-kaiheila) | 维护中 |
| [Kook(开黑啦)](https://www.kookapp.cn/) | simbot team | [simple-robot/simbot-component-kook](https://github.com/simple-robot/simbot-component-kook) | 维护中 |
| [QQ频道机器人](https://bot.q.qq.com/wiki) | simbot team | [simple-robot/simbot-component-tencent-guild](https://github.com/simple-robot/simbot-component-tencent-guild) | 维护中 |

有关于这些组件等simbot附属内容的相关信息,你可以从 [**Simple Robot 附属组织库**](https://github.com/simple-robot) 处查看~

@@ -111,7 +111,7 @@ simbot3目前已经实现的组件有:
## 联系我们
simbot不再拥有或推广任何官方管理的社交群聊(包括QQ群、TG群等诸如此类平台)。
- 如果想要反馈问题、提出建议建议或提出问题,请通过 [**ISSUES**][issues]
- 如果想要与开发团队交流、与其他开发者交流,请前往[**讨论区**][discussions]
- 如果想要与开发团队交流、与其他开发者交流,请前往 [**讨论区**][discussions]


[pr]: https://github.com/ForteScarlet/simpler-robot/pulls
24 changes: 0 additions & 24 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -16,32 +16,8 @@


plugins {
id("org.jetbrains.dokka")
id("simbot.changelog-generator")
id("simbot.nexus-publish")
id("simbot.dokka-multi-module")
idea
}

group = P.Simbot.GROUP
version = P.Simbot.VERSION
description = P.Simbot.DESCRIPTION

repositories {
mavenLocal()
mavenCentral()
maven {
url = uri(Sonatype.Snapshot.URL)
mavenContent {
snapshotsOnly()
}
}
}


idea {
module {
isDownloadSources = true
isDownloadJavadoc = true
}
}
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -8,14 +8,14 @@ repositories {
}

val kotlinVersion = "1.6.21"
val dokkaVersion = "1.6.21"
val dokkaPluginVersion = "1.6.21"

dependencies {
// kotlin("jvm") apply false
implementation(gradleApi())
implementation(kotlin("gradle-plugin", kotlinVersion))
implementation(kotlin("serialization", kotlinVersion))
implementation("org.jetbrains.dokka", "dokka-gradle-plugin", dokkaVersion)
implementation("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaPluginVersion")

// see https://github.com/gradle-nexus/publish-plugin
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")
3 changes: 3 additions & 0 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
@@ -53,6 +53,9 @@ object P {
object Simbot {
const val GROUP = "love.forte.simbot"
const val BOOT_GROUP = "love.forte.simbot.boot"
const val TEST_GROUP = "love.forte.simbot.test"
const val COMPONENT_GROUP = "love.forte.simbot.component"

const val DESCRIPTION = "Simple Robot,一个通用的bot风格事件调度框架,以灵活的统一标准来编写bot应用。"

val version = Version(
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* Copyright (c) 2022-2022 ForteScarlet <ForteScarlet@163.com>
*
* 本文件是 simply-robot ( simple robot的v3版本,因此亦可称为 simple-robot v3 、simbot v3 等) 的一部分。
* 本文件是 simply-robot (或称 simple-robot 3.x 、simbot 3.x ) 的一部分。
*
* simply-robot 是自由软件:你可以再分发之和/或依照由自由软件基金会发布的 GNU 通用公共许可证修改之,无论是版本 3 许可证,还是(按你的决定)任何以后版都可以。
*
@@ -12,7 +12,6 @@
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
* https://www.gnu.org/licenses/lgpl-3.0-standalone.html
*
*
*/

plugins {
@@ -23,9 +22,6 @@ plugins {
idea
}

group = P.Simbot.GROUP
version = P.Simbot.VERSION

repositories {
mavenLocal()
mavenCentral()
@@ -104,9 +100,4 @@ idea {
}
}

//// show project info
println("========================================================")
println("== project.group: ${group}")
println("== project.name: ${name}")
println("== project.version: ${version}")
println("========================================================")

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021-2022 ForteScarlet <ForteScarlet@163.com>
* Copyright (c) 2022-2022 ForteScarlet <ForteScarlet@163.com>
*
* 本文件是 simply-robot (或称 simple-robot 3.x 、simbot 3.x ) 的一部分。
*
@@ -12,12 +12,11 @@
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
* https://www.gnu.org/licenses/lgpl-3.0-standalone.html
*
*
*/
plugins {
id("simbot.base-module-conventions")
}

group = P.Simbot.BOOT_GROUP

subprojects {
println("BOOT SUB: $this")
group = P.Simbot.BOOT_GROUP
}
version = P.Simbot.VERSION
description = P.Simbot.DESCRIPTION
Loading

0 comments on commit fd50ab0

Please sign in to comment.