Skip to content

Commit

Permalink
Merge pull request #117 from simple-robot/dev/main
Browse files Browse the repository at this point in the history
Release: v3.3.0.0-beta1
  • Loading branch information
ForteScarlet authored Dec 26, 2023
2 parents ce4e755 + e1c827a commit b3774d3
Show file tree
Hide file tree
Showing 36 changed files with 1,331 additions and 315 deletions.
8 changes: 8 additions & 0 deletions .changelog/v3.3.0.0-beta1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
> 对应核心版本: [**v3.3.0**](https://github.com/simple-robot/simpler-robot/releases/tag/v3.3.0)
> **Warning**
> 目前版本尚处于 **`BETA`** 阶段,代表仍然可能存在大量[已知问题](https://github.com/simple-robot/simbot-component-kook/issues)或未知问题,
以及未完善的内容和落后于官方更新的内容。**

我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-kook/issues)[协助](https://github.com/simple-robot/simbot-component-kook/pulls)
感谢您的贡献与支持!
8 changes: 4 additions & 4 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ jobs:
- name: Gradle Run Test
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
# arguments: clean assemble test
arguments: assemble test -Porg.gradle.daemon=false

- name: Gradle Publish Release
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
arguments: |
publishToSonatype
closeAndReleaseStagingRepository
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
- name: Gradle publish snapshot
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
arguments: clean test publishToSonatype closeAndReleaseStagingRepository
env:
SIMBOT_IS_SNAPSHOT: true
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Gradle generate documentation
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
arguments: |
-Porg.gradle.jvmargs="-Xmx4g -Xms4g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- name: Gradle publish snapshot
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
arguments: |
test
publishToSonatype
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
- name: Gradle generate documentation
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
arguments: |
-Porg.gradle.jvmargs="-Xmx4g -Xms4g -XX:MaxMetaspaceSize=2g -Dfile.encoding=UTF-8"
-Porg.gradle.daemon=false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- dev/main
- main

jobs:
qodana:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Run All Tests
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.6
gradle-version: 8.5
arguments: |
assemble
build
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# v3.3.0.0-beta.1

> Release & Pull Notes: [v3.3.0.0-beta.1](https://github.com/simple-robot/simpler-robot/releases/tag/v3.3.0.0-beta.1)
- fix: 消息发送中增加对 AtAll 的支持 ([`9363c9e`](https://github.com/simple-robot/simpler-robot/commit/9363c9e))
- website: 配置域名 ([`bfc48ad`](https://github.com/simple-robot/simpler-robot/commit/bfc48ad))
- fix(doc): 修复部分对配置文件 `ticket` 的描述错误问题 ([`3841f05`](https://github.com/simple-robot/simpler-robot/commit/3841f05))
- CI: Qodana for branches 'main' ([`e813648`](https://github.com/simple-robot/simpler-robot/commit/e813648))

# v3.2.0.0-alpha.8

> Release & Pull Notes: [v3.2.0.0-alpha.8](https://github.com/simple-robot/simpler-robot/releases/tag/v3.2.0.0-alpha.8)
Expand Down
36 changes: 27 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
# Simple Robot KOOK 组件
# Simple Robot - KOOK 组件

此为 [Simple Robot v3][simbot3] (以下简称为 `simbot3` ) 下基于simbot标准API对 [KOOK API](https://www.kookapp.cn/) 的组件支持。

**Simple Robot - KOOK 组件** <small>以下简称KOOK组件</small>
是一个基于 [KMP](https://kotlinlang.org/docs/multiplatform.html)
支持多平台(`JVM``JS`、native)且JVM平台库对Java友好、
(特定模块)实现simbot3标准API的 **KOOK 机器人API** 依赖库。

**KOOK组件**提供多平台的KOOK API、bot事件订阅等功能实现的底层库,
以及基于simbot3标准API的高级功能应用库。

## 文档

了解**simbot3**: [simbot3官网](https://simbot.forte.love)

KOOK组件的**组件手册**: [组件手册](https://simple-robot.github.io/simbot-component-kook/)
KOOK组件的**组件手册**: [组件手册][website]

> 版本进入稳定后考虑配置域名,目前暂未配置。
> [!note]
> 手册与simbot3官网均部署于GitHub Pages。
> 为了更好的浏览体验,**推荐**开启魔法后访问。
**API文档**: [API文档引导站](https://docs.simbot.forte.love)

> **Warning**
> README 施工中。。。
## 支持情况

前往查看 [支持列表](support-list.md)
前往查看 [支持列表](support-list.md)

## 使用
## 快速开始

前往 [组件官网](https://simple-robot.github.io/simbot-component-kook/) 参考 **快速开始** 相关章节。
前往 [组件手册][website] 阅读 **快速开始** 相关章节。

## 走马观花

<details>
<summary>简单示例</summary>

> [!note]
> Java开发者可直接参考 [组件手册][website]**快速开始**相关示例的Java部分代码。
> 使用 Kotlin + `simbot-component-kook-core` 配合 `simboot-core-spring-boot-starter` 使用 `Spring Boot` 的情况下:
```kotlin
// simbot-core / simbot-boot
Expand All @@ -54,6 +65,7 @@ suspend fun KookChannelMessageEvent.onEvent(@FilterValue("name") name: String) {
```

简单的完整示例:
> (使用 Kotlin + `simbot-component-kook-core`, 非 Spring Boot 的情况下:)
```kotlin
suspend fun main() {
Expand Down Expand Up @@ -85,6 +97,10 @@ suspend fun main() {

</details>

## 应用案例

如果你想看看通过 simbot 开发的bot是什么样子,不妨添加我们亲爱的 [法欧莉斯卡雷特](https://www.kookapp.cn/app/oauth2/authorize?id=10250&permissions=197958144&client_id=jqdlyHK85xe1i5Bo&redirect_uri=&scope=bot) 并使用 `@法欧莉 今天的我` 来看看效果吧~


## License

Expand All @@ -107,3 +123,5 @@ program. If not, see <https://www.gnu.org/licenses/>.
[m-stdlib]: simbot-component-kook-stdlib
[m-core]: simbot-component-kook-core
[simbot3]: https://github.com/simple-robot/simpler-robot

[website]: https://component-kook.simbot.forte.love/
15 changes: 7 additions & 8 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ repositories {
gradlePluginPortal()
}

val kotlinVersion = "1.8.21"
val dokkaVersion = "1.8.10"
val suspendTransformVersion = "0.3.1"
val kotlinVersion = "1.9.21"
val dokkaVersion = "1.9.10"
val suspendTransformVersion = "0.5.1"
val gradleCommon = "0.1.1"

dependencies {
Expand All @@ -35,7 +35,6 @@ dependencies {
implementation(kotlin("serialization", kotlinVersion))
implementation("org.jetbrains.dokka", "dokka-gradle-plugin", dokkaVersion)
implementation("org.jetbrains.dokka", "dokka-base", dokkaVersion)

// see https://github.com/gradle-nexus/publish-plugin
implementation("io.github.gradle-nexus:publish-plugin:1.1.0")

Expand All @@ -46,8 +45,8 @@ dependencies {
// implementation("love.forte.gradle.common:gradle-common-all:$gradleCommon")
}

val compileKotlin: org.jetbrains.kotlin.gradle.tasks.KotlinCompile by tasks
//val compileKotlin: org.jetbrains.kotlin.gradle.tasks.KotlinCompile by tasks

compileKotlin.kotlinOptions {
freeCompilerArgs += listOf("-Xinline-classes")
}
//compileKotlin.kotlinOptions {
// freeCompilerArgs += listOf("-Xinline-classes")
//}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/P.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import love.forte.gradle.common.core.project.version as v
*
*/

val simbotVersion = v(3, 2, 0)
val simbotVersion = v(3, 3, 0)

val simbotApi = "love.forte.simbot:simbot-api:$simbotVersion"
val simbotAnnotations = "love.forte.simbot.util:simbot-annotations:$simbotVersion"
Expand Down Expand Up @@ -68,7 +68,7 @@ object P : ProjectDetail() {
0, 0
)

private val alphaSuffix = v("alpha", 8)
private val alphaSuffix = v("beta1")

override val version: Version = baseVersion - alphaSuffix

Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/SuspendTransforms.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object SuspendTransforms {
*/
val jvmAsyncTransformer = SuspendTransformConfiguration.jvmAsyncTransformer.copy(
syntheticFunctionIncludeAnnotations = includeAnnotations,
transformFunctionInfo = FunctionInfo("love.forte.simbot.utils", null, "$\$runInAsync"),
transformFunctionInfo = FunctionInfo("love.forte.simbot.utils", null, "$\$runInAsyncNullable"),
copyAnnotationExcludes = SuspendTransformConfiguration.jvmAsyncTransformer.copyAnnotationExcludes + SuspendTransformConfiguration.jvmAsyncTransformer.markAnnotation.classInfo
)

Expand Down
12 changes: 7 additions & 5 deletions buildSrc/src/main/kotlin/changelog/GenerateChangelog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,19 @@ fun Project.generateChangelog(tag: String) {

val coreVersion = simbotVersion

file.writeText("""
file.writeText(
"""
> 对应核心版本: [**v$coreVersion**](https://github.com/simple-robot/simpler-robot/releases/tag/v$coreVersion)
> **Warning**
> 目前版本尚处于 **`ALPHA`** 阶段,代表仍然可能存在大量[已知问题](https://github.com/simple-robot/simbot-component-kook/issues)或未知问题,
> [!warning]
> 目前版本尚处于 **`BETA`** 阶段,代表仍然可能存在部分[已知问题](https://github.com/simple-robot/simbot-component-kook/issues)或未知问题,
以及未完善的内容和落后于官方更新的内容。**
我们欢迎并期望着您的的[反馈](https://github.com/simple-robot/simbot-component-kook/issues)或[协助](https://github.com/simple-robot/simbot-component-kook/pulls),
感谢您的贡献与支持!
""".trimIndent())
""".trimIndent()
)
}

val rootChangelogFile = rootProject.file("CHANGELOG.md").also { file ->
Expand Down Expand Up @@ -155,7 +157,7 @@ fun Project.generateChangelog(tag: String) {
}
}

val tmpDir = rootProject.buildDir.resolve("tmp/changelog").apply { mkdirs() }
val tmpDir = rootProject.layout.buildDirectory.dir("tmp/changelog").get().asFile

val tmpFile =
Files.createTempFile(tmpDir.toPath(), "changelog", "tmp").toFile()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ multiplatformConfigPublishing {
project = P

val jarJavadoc by tasks.registering(Jar::class) {
group = "documentation"
archiveClassifier.set("javadoc")
from(tasks.findByName("dokkaHtml"))
}
Expand All @@ -57,11 +56,12 @@ multiplatformConfigPublishing {
if (systemProp("SIMBOT_LOCAL").toBoolean()) {
mainHost = null
}
// else {
//
// mainHostSupportedTargets = mainHost?.supports(hostManager) ?: emptySet()
// }
}

// TODO see https://github.com/gradle-nexus/publish-plugin/issues/208#issuecomment-1465029831
val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>()
tasks.withType<PublishToMavenRepository>().configureEach {
mustRunAfter(signingTasks)
}

fun KonanTarget.supports(hostManager: HostManager): Set<String> {
Expand Down
5 changes: 5 additions & 0 deletions buildSrc/src/main/kotlin/simbot-kook-maven-publish.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ if (!isCi || isLinux) {
}
}

// TODO see https://github.com/gradle-nexus/publish-plugin/issues/208#issuecomment-1465029831
val signingTasks: TaskCollection<Sign> = tasks.withType<Sign>()
tasks.withType<PublishToMavenRepository>().configureEach {
mustRunAfter(signingTasks)
}

fun MavenPublication.show() {
//// show project info
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
kotlinx-coroutines = "1.7.0"
kotlinx-serialization = "1.5.0"
kotlinx-coroutines = "1.7.3"
kotlinx-serialization = "1.6.2"
spring-boot = "2.7.5"
openjdk-jmh = "1.35"
forte-di = "0.0.3"
forte-annotationTool = "0.6.3"
ktor = "2.3.0"
log4j = "2.20.0"
atomicfu = "0.20.1"
atomicfu = "0.23.1"

[libraries]
# jetbrains-annotation
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 8 additions & 0 deletions simbot-component-kook-api/Module.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Module simple-component-kook-api


[KOOK API](https://www.kookapp.cn/)的最基本封装,不包含额外的功能性实现(比如bot、事件调度等)。

如果希望使用一个仅仅是针对API的原始封装模块而不需要基础/高级的事件流程控制,那么请考虑使用api模块。


Loading

0 comments on commit b3774d3

Please sign in to comment.