mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-28 16:50:09 +08:00
Add docs for building core
This commit is contained in:
parent
cca40b8aa3
commit
dcc418a557
103
CONTRIBUTING.md
103
CONTRIBUTING.md
@ -1,103 +0,0 @@
|
||||
# 贡献
|
||||
|
||||
**感谢你来到这里和你对 mirai 做的所有贡献。**
|
||||
|
||||
mirai 欢迎一切形式的代码贡献。你可以通过以下几种途径向 mirai 贡献。
|
||||
|
||||
## 主仓库 `mirai-core`
|
||||
|
||||
### 构建项目
|
||||
|
||||
#### 更新 submodules
|
||||
|
||||
mirai git 仓库含有 submodule, 请在 clone 时使用 `--recursive` 参数, 或在 clone 后使用如下命令更新 submodule:
|
||||
```shell script
|
||||
git submodule init
|
||||
git submodule update
|
||||
```
|
||||
|
||||
#### 安装 JDK
|
||||
|
||||
mirai 2.9.0 在如下环境测试可以编译:
|
||||
- macOS 12.0.1, AdoptOpenJDK 17 aarch64, Gradle 7.2, Kotlin 1.6.0
|
||||
- macOS 12.0.1, Amazon Corretto 11 amd64, Gradle 7.2, Kotlin 1.6.0
|
||||
|
||||
若在其他环境下无法正常编译, 请尝试选择上述一个环境配置.
|
||||
|
||||
#### 运行 Gradle 构建
|
||||
|
||||
项目首次初始化和构建可能要花费较长时间。
|
||||
|
||||
- 要构建项目, 请运行 `gradlew assemble`
|
||||
- 要运行测试, 请运行 `gradlew check`
|
||||
- 要构建项目并运行测试, 请运行 `gradlew build`
|
||||
|
||||
### 分支
|
||||
|
||||
- `1.x`: 1.x 版本的开发 (已停止)
|
||||
- `dev`: 2.0 版本的开发
|
||||
- `-release` 后缀: 基于[版本规范](docs/Evolution.md#版本规范), 用于从 `dev` 中筛选 bugfix 并发布一个版本的 patch 的版本. 如 `2.0-release` 会包含 `2.0.x` 版本的更新.
|
||||
|
||||
**请基于 `dev` 分支进行修改**
|
||||
|
||||
### 能做什么?
|
||||
|
||||
- 维护社区: 可以为 [mirai-console](/mirai-console) 编写插件, 并发布到论坛
|
||||
|
||||
- 代码优化: 优化任何功能设计或实现, 或是引入一个新的设计
|
||||
- 解决问题: 在 [issues](https://github.com/mamoe/mirai/issues) 查看 mirai 正遇到的所有问题, 或在 [里程碑](https://github.com/mamoe/mirai/milestones) 查看版本计划. 所有没有 assignee 的 issue 都处于
|
||||
- 协议支持: [添加新协议支持](#添加协议支持)
|
||||
|
||||
### 加入开发组
|
||||
|
||||
你可以随时提交 PR 解决任何问题。而若有兴趣,我们也欢迎你加入开发组,请联系 support@mamoe.net
|
||||
|
||||
[mirai-compose]: https://github.com/sonder-joker/mirai-compose
|
||||
[plugin-center 服务端]: https://github.com/project-mirai/mirai-plugin-center
|
||||
[mirai-api-http]: https://github.com/project-mirai/mirai-api-http
|
||||
[project-mirai/docs]: https://github.com/project-mirai/docs
|
||||
[docs.mirai.mamoe.net]: https://docs.mirai.mamoe.net
|
||||
|
||||
|
||||
| 名称 | 描述 |
|
||||
|:------------------------:|:------------------------------------------------------------------------------------------------------:|
|
||||
| core 和 console 日常更新 | 在 milestone 安排的日常更新。我们目前版本速度是一个月到两个月发布一个次版本(2.x)。需要日常的开发。 |
|
||||
| console 后端 | 架构稳定,现在格外需要在易用性上的提升,首先需要一个优化方案,再实现它们。 |
|
||||
| console 文档 | 根据用户反馈,现在文档十分缺少。需要以用户的身份体验过 console 的人编写用户文档。 |
|
||||
| 图形前端 [mirai-compose] | 各功能都缺目前尤其缺少对接 console PluginConfig 的图形化配置的实现。 |
|
||||
| [plugin-center 服务端] | 插件中心正在建设中。后端 Spring,前端 Vuetify。由于开发人员学业繁忙,暂搁置。 |
|
||||
| plugin-center 社区 | 插件中心计划支持所有语言的插件,因此需要与社区 SDK 作者沟通并帮助它们接入 Console 的 PluginLoader API 和插件中心的要求。 |
|
||||
| plugin-center console 端 | 需要评估现在 console 架构是否足够支持插件中心及所有语言插件的管理,实现与插件中心的对接。 |
|
||||
| plugin-center gradle | 对接插件中心,实现通过 Task 上传插件。还没有开始做。 |
|
||||
| mirai-console-loader | console 启动器。对接插件中心的 API,支持下载和更新插件等。不确定之后是否会有人实现。 |
|
||||
| IDE 插件 | IntelliJ IDEA 的插件的工作。可以为 mirai 框架添加检查等功能。这个部分目前基本满足需求。 |
|
||||
| [mirai-api-http] v2 | 日常维护。 |
|
||||
| [project-mirai/docs] | 用户友好文档自动部署,使用 VuePress , 部署于 [docs.mirai.mamoe.net],目前还有部分超链接错误的问题。 |
|
||||
|
||||
|
||||
### 里程碑
|
||||
|
||||
[里程碑](https://github.com/mamoe/mirai/milestones) 为各版本的开发计划. 在完成所有任务后就会发布该版本.
|
||||
|
||||
`Backlog` 为没有设定目标版本的计划. 如果有相关 PR, 这些计划就可能会被确定到一个最近的版本.
|
||||
|
||||
### 添加协议支持
|
||||
|
||||
请查看 [PacketFactory.kt](mirai-core/src/commonMain/kotlin/network/protocol/packet/PacketFactory.kt) 了解网络层架构.
|
||||
参考现有的 `PacketFactory` 实现和一些有关协议的 PR (带有 `protocol` 标签) 了解如何添加新的 `PacketFactory`.
|
||||
|
||||
|
||||
### 开发 mirai-core
|
||||
|
||||
- 使用 IntelliJ IDEA 或 Android Studio
|
||||
- 安装 IDE 插件 [kotlin-jvm-blocking-bridge](https://github.com/Him188/kotlin-jvm-blocking-bridge/blob/master/README-chs.md#%E5%AE%89%E8%A3%85-intellij-idea-%E6%88%96-android-studio-%E6%8F%92%E4%BB%B6)
|
||||
- 若要添加一个 suspend 函数, 请为它添加 `@JvmBlockingBridge`, 使用 [kotlin-jvm-blocking-bridge](https://github.com/mamoe/kotlin-jvm-blocking-bridge/blob/master/README-chs.md)
|
||||
- 在 mirai-core 和 mirai-core-api 使用纯 Kotlin 实现
|
||||
- 尽量不要引用新的库
|
||||
- 遵守 Kotlin 官方代码规范(提交前使用 IDE 格式化代码 (commit 时勾选 'Reformat code'))
|
||||
- 保证二进制兼容性: 在提交前执行 `./gradlew build`, 若有不兼容变更会得到错误。
|
||||
如果你正在添加一个新功能,可以忽略这个错误,执行 `./gradlew clean apiDumpAll`。这将会生成 `*.api`,文件的变化反映了你的修改情况。将这些文件一并提交。 (详细了解 [Kotlin/binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator))
|
||||
- 通过 GitHub 的 Pull Request 提交代码,很快就会有相关模块负责人员来审核
|
||||
|
||||
|
||||
如果你不太保证自己能达到上述要求也没关系,mirai 感谢你的每一行代码,维护者会审核代码并尽可能帮助你。
|
@ -129,9 +129,10 @@ mirai 是一个在全平台下运行,提供 QQ Android 协议支持的高效
|
||||
- 在线讨论: [Gitter](https://gitter.im/mamoe/mirai?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
||||
|
||||
- mirai 开发组和官方系列项目: [project-mirai](https://github.com/project-mirai)
|
||||
- mirai 社区相关项目 (旧): [awesome-mirai](https://github.com/project-mirai/awsome-mirai/blob/master/README.md)
|
||||
- mirai 社区相关项目 (
|
||||
旧): [awesome-mirai](https://github.com/project-mirai/awsome-mirai/blob/master/README.md)
|
||||
|
||||
- 帮助 mirai: [CONTRIBUTING](CONTRIBUTING.md)
|
||||
- 帮助 mirai: [CONTRIBUTING](docs/contributing/README.md)
|
||||
|
||||
## 赞助
|
||||
- 本着与更多 mirai 开发者、用户、支持者共建更好的学习环境为目的,mirai 自 2021 年 3 月 1 日发起官方社区的建设。社区建设可能涉及:[学习论坛](https://mirai.mamoe.net)、[插件中心(在建)](https://github.com/project-mirai/mirai-plugin-center)等。由于社区的运维需要经费,mirai 项目开启 sponsor 功能。
|
||||
|
156
docs/contributing/BuildingCore.md
Normal file
156
docs/contributing/BuildingCore.md
Normal file
@ -0,0 +1,156 @@
|
||||
# 构建 Core
|
||||
|
||||
本文介绍如何构建 core 的 JVM 和 Native 目标。
|
||||
|
||||
## 构建 core 的 JVM 目标
|
||||
|
||||
方法与[构建 JVM 目标项目](README.md#构建-jvm-目标项目)
|
||||
类似,但需要使用 `:mirai-core:compileKotlinJvm` 和 `:mirai-core:jvmTest`
|
||||
分别用于编译和测试。提示:直接执行测试时也会自动先完成编译。
|
||||
|
||||
## 构建 core 的 Native 目标
|
||||
|
||||
[OpenSSL.def]: ../../mirai-core/src/nativeMain/cinterop/OpenSSL.def
|
||||
|
||||
Kotlin 会自动配置 Native 编译器,要构建 Mirai 的 Native 目标还需要准备相关依赖。
|
||||
|
||||
### 操作系统条件
|
||||
|
||||
主机操作系统为以下任一:
|
||||
|
||||
- Windows x86_64 (amd64)
|
||||
- macOS x86_64 (amd64)
|
||||
- macOS aarch64 (arm64)
|
||||
- Linux x86_64 (amd64)
|
||||
|
||||
注意:32 位操作系统不受支持。未列举的操作系统不受支持。
|
||||
|
||||
目前 Kotlin 对交叉编译支持有限,只能在一个主机上编译该主机平台的目标。例如在 Windows x86_64 主机上只能编译
|
||||
Windows x86_64 目标;在 macOS aarch64 主机上只能编译 macOS aarch64 目标。
|
||||
|
||||
与其他 Native 语言相同,Kotlin 的应用使用依赖时同样需要配置链接,mirai
|
||||
已经配置了常用目录。也可以在 `mirai-core/src/nativeMain/cinterop/OpenSSL.def`
|
||||
修改 `linkerOpts` 即链接器参数,以增加自定义路径。
|
||||
|
||||
### 安装 OpenSSL
|
||||
|
||||
所有上述主机都需要进行这一步。
|
||||
|
||||
可以访问 OpenSSL 官网 `https://curl.se/download.html` 安装。
|
||||
|
||||
#### 在 Ubuntu 通过 Aptitude 安装 OpenSSL
|
||||
|
||||
```shell
|
||||
$ sudo apt install libssl-dev # 安装 OpenSSL
|
||||
$ sudo apt install gcc-multilib # 若遇到链接问题可额外尝试此命令
|
||||
```
|
||||
|
||||
#### 在 macOS 通过 Homebrew 安装 OpenSSL
|
||||
|
||||
```shell
|
||||
$ brew install openssl@3
|
||||
```
|
||||
|
||||
注意:若遇到无法链接等问题,可以尝试通过源码编译安装。
|
||||
|
||||
#### 在 macOS 或 Linux 通过源码编译安装 OpenSSL
|
||||
|
||||
请参考 [OpenSSL 文档](https://github.com/openssl/openssl/blob/master/INSTALL.md#prerequisites)
|
||||
准备 OpenSSL 的要求。
|
||||
|
||||
以下命令可能会帮助你(这是 mirai 的 GitHub Actions 使用的命令)。
|
||||
|
||||
```shell
|
||||
$ git clone https://github.com/openssl/openssl.git --recursive
|
||||
$ cd openssl
|
||||
$ git checkout tags/openssl-3.0.3
|
||||
$ ./Configure --prefix=/opt/openssl --openssldir=/usr/local/ssl
|
||||
$ make
|
||||
$ sudo make install
|
||||
```
|
||||
|
||||
若在 Ubuntu 遇到链接问题,可额外尝试此命令:
|
||||
|
||||
```shell
|
||||
$ sudo apt install gcc-multilib
|
||||
```
|
||||
|
||||
#### 在 Windows 通过源码编译安装 OpenSSL
|
||||
|
||||
在 Windows,可通过源码编译安装,请使用 Command Prompt (cmd)。
|
||||
|
||||
你需要提前安装 [Git](https://git-scm.com/)
|
||||
和 [Microsoft Visual Studio](https://visualstudio.microsoft.com/zh-hans/)
|
||||
,并修改以下命令中的路径。
|
||||
|
||||
请参考 [OpenSSL 文档](https://github.com/openssl/openssl/blob/master/INSTALL.md#prerequisites)
|
||||
准备 OpenSSL 的要求。
|
||||
|
||||
以下命令可能会帮助你(这是 mirai 的 GitHub Actions 使用的命令)。
|
||||
|
||||
```shell
|
||||
git clone https://github.com/openssl/openssl.git --recursive
|
||||
cd openssl
|
||||
git checkout tags/openssl-3.0.3
|
||||
perl Configure VC-WIN64A --prefix=C:/openssl --openssldir=C:/openssl/ssl no-asm
|
||||
"C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64 && nmake && nmake install
|
||||
```
|
||||
|
||||
注意:
|
||||
|
||||
- `--prefix=C:/openssl --openssldir=C:/openssl/ssl` 表示将 OpenSSL
|
||||
安装在 `C:/openssl`,mirai
|
||||
已经配置会使用此路径寻找链接库。你也可以更换为其他路径,但就需要同步修改配置(位于 `mirai-core/src/nativeMain/cinterop/OpenSSL.def`
|
||||
);
|
||||
- 不要将修改路径后的 `OpenSSL.def` 通过 Git 推送到 mirai 仓库或 PR。
|
||||
|
||||
#### 安装 cURL
|
||||
|
||||
mirai 在 Windows 上使用
|
||||
cURL,在其他平台使用 [Ktor CIO](https://ktor.io/docs/http-client-engines.html#cio)
|
||||
,因此只有 Windows 系统需要进行这一步。
|
||||
|
||||
可以访问 cURL 官网 `https://curl.se/download.html` 安装。
|
||||
|
||||
提示:如果在[链接](#链接)时遇到找不到 cURL
|
||||
相关符号的问题,请尝试修改链接器参数。尽管 `mirai-core/src/nativeMain/cinterop/OpenSSL.def`
|
||||
是用于 `OpenSSL.def` 的,也可以在这个文件配置 cURL 路径。
|
||||
|
||||
#### 编译
|
||||
|
||||
在任意主机上可以执行所有目标的 Kotlin 编译,但不能执行链接。要执行特定目标的编译,运行 Gradle
|
||||
任务 `compileKotlinXXX`,其中 `XXX` 可以是:`MacosX64`、`MacosArm64`、`MingwX64`
|
||||
或 `LinuxX64`。
|
||||
|
||||
也可以执行 `compileKotlinHost`,将自动根据当前主机选择合适的目标。
|
||||
|
||||
#### 链接并测试
|
||||
|
||||
执行 core 模块的 `hostTest`,将根据主机选择合适的测试并运行。
|
||||
|
||||
详情参考 [Kotlin 官方文档](https://kotlinlang.org/docs/multiplatform-run-tests.html)
|
||||
。
|
||||
|
||||
#### 链接并构建动态链接库
|
||||
|
||||
注意,只有 mirai-core 可以构建可用的动态链接库。
|
||||
|
||||
执行 `:mirai-core:linkDebugSharedHost`
|
||||
或 `:mirai-core:linkReleaseSharedHost`。Debug 版本会保留调试符号,能显示完整错误堆栈;而
|
||||
Release 拥有更小体积(比 Debug 减小 50%)。
|
||||
|
||||
这也会同时生成一个头文件(`.h`
|
||||
)供交互使用。详情查看 [Kotlin 官方文档](https://kotlinlang.org/docs/native-c-interop.html)
|
||||
。
|
||||
|
||||
可以在 `mirai-core/build/bin/macosArm64/debugShared/` 类似路径找到生成的动态链接库和头文件。
|
||||
|
||||
#### 链接并构建静态链接库
|
||||
|
||||
注意,只有 mirai-core 可以构建可用的静态链接库。
|
||||
|
||||
执行 `:mirai-core:linkDebugStaticHost`
|
||||
或 `:mirai-core:linkReleaseStaticHost`。Debug 版本会保留调试符号,能显示完整错误堆栈;而
|
||||
Release 拥有更小体积(比 Debug 减小 50%)。
|
||||
|
||||
可以在 `mirai-core/build/bin/macosArm64/debugStatic/` 类似路径找到生成的静态链接库和头文件。
|
206
docs/contributing/README.md
Normal file
206
docs/contributing/README.md
Normal file
@ -0,0 +1,206 @@
|
||||
# 贡献
|
||||
|
||||
**感谢你来到这里和你对 mirai 做的所有贡献。**
|
||||
|
||||
mirai 欢迎一切形式的代码贡献。你可以通过以下几种途径向 mirai 贡献。
|
||||
|
||||
[mirai-core-api]: ../../mirai-core-api
|
||||
|
||||
[mirai-core-utils]: ../../mirai-core-utils
|
||||
|
||||
[mirai-core]: ../../mirai-core
|
||||
|
||||
[mirai-console]: ../../mirai-console/backend/mirai-console
|
||||
|
||||
[mirai-console-integration-test]: ../../mirai-console/backend/integration-test
|
||||
|
||||
[mirai-console-codegen]: ../../mirai-console/backend/codegen
|
||||
|
||||
[mirai-console-terminal]: ../../mirai-console/frontend/mirai-console-terminal
|
||||
|
||||
[mirai-conosle-compiler-annotations]: ../../mirai-console/tools/compiler-annotations
|
||||
|
||||
[mirai-conosle-compiler-common]: ../../mirai-console/tools/compiler-common
|
||||
|
||||
[mirai-conosle-intellij]: ../../mirai-console/tools/intellij-plugin
|
||||
|
||||
[mirai-conosle-gradle]: ../../mirai-console/tools/gradle-plugin
|
||||
|
||||
[mirai-bom]: ../../mirai-bom
|
||||
|
||||
[mirai-dokka]: ../../mirai-dokka
|
||||
|
||||
[mirai-core-all]: ../../mirai-core-all
|
||||
|
||||
[mirai-logging]: ../../logging/
|
||||
|
||||
[mirai-logging-log4j2]: ../../logging/mirai-logging-log4j2
|
||||
|
||||
[mirai-logging-slf4j]: ../../logging/mirai-logging-slf4j
|
||||
|
||||
[mirai-logging-slf4j-simple]: ../../logging/mirai-logging-slf4j-simple
|
||||
|
||||
[mirai-logging-slf4j-logback]: ../../logging/mirai-logging-slf4j-logback
|
||||
|
||||
# 主仓库 mirai
|
||||
|
||||
当前仓库 mamoe/mirai 包含 mirai 核心模块:
|
||||
|
||||
| 名称 | 描述 |
|
||||
|------------------------|---------------------|
|
||||
| mirai-core-utils | 一些工具类,供其他模块使用 |
|
||||
| mirai-core-api | mirai 机器人核心 API |
|
||||
| mirai-core | mirai 机器人核心实现 |
|
||||
| mirai-core-all | 上述三个模块的集合,用于启动器 |
|
||||
| mirai-console | 插件模式机器人框架后端 |
|
||||
| mirai-console-terminal | mirai-console 的终端前端 |
|
||||
| mirai-console-intellij | IntelliJ IDEA 插件 |
|
||||
| mirai-console-gradle | Gradle 插件 |
|
||||
| mirai-bom | Maven BOM |
|
||||
| mirai-logging | 常用日志库转接器 |
|
||||
|
||||
## Git 分支
|
||||
|
||||
- `1.x`: 1.x 版本的开发 (已停止);
|
||||
- `dev`: 2.x 版本的开发(当前);
|
||||
- `-release` 后缀: 某个版本的小更新分支。如 `2.10-release` 会包含 `2.10.x` 小版本的更新。
|
||||
|
||||
通常请基于 `dev` 分支进行修改。
|
||||
基于[版本规范](../Evolution.md#版本规范)
|
||||
,若一个修改适合发布为小版本更新,我们会从 `dev` 中提取该修复到目标 `-release` 分支。
|
||||
|
||||
## `mirai-core` 术语
|
||||
|
||||
根据语境,mirai-core 有时候可能指 `mirai-core` 这个模块,有时候可能指 `mirai-core-utils`
|
||||
、`mirai-core-api`、 `mirai-core` 这三个模块的整体。
|
||||
本文中,`mirai-core` 将特指 `mirai-core` 模块,而用 'core' 或者 'mirai core'
|
||||
指相关三个模块的整体。
|
||||
|
||||
## core 多平台架构
|
||||
|
||||
[HMPP]: https://kotlinlang.org/docs/multiplatform-discover-project.html
|
||||
|
||||
core 三个模块都使用 Kotlin [HMPP] 功能,同时支持 JVM 和 Native
|
||||
两种平台。你可以在 [Kotlin 官方英文文档][HMPP] 了解 HMPP 模式。
|
||||
|
||||
core 的源集结构如图所示:
|
||||
|
||||
```
|
||||
common
|
||||
|
|
||||
/---------------+---------------\
|
||||
jvmBase native
|
||||
/ \ / \
|
||||
jvm android unix \
|
||||
/ \ mingwX64
|
||||
/ \
|
||||
darwin linuxX64
|
||||
|
|
||||
*
|
||||
<darwin targets>
|
||||
```
|
||||
|
||||
备注:
|
||||
|
||||
- common 包含全平台通用代码,绝大部分代码都位于 common;
|
||||
- jvmBase 包含针对 JVM 平台的通用代码;
|
||||
- `<darwin targets>` 为 macOS,iOS,WatchOS 等 Apple 平台目标。
|
||||
|
||||
## 安装 JDK
|
||||
|
||||
需要安装 JDK 才能编译 mirai。mirai 2.12 在如下环境测试可以编译:
|
||||
|
||||
- macOS 12.0.1, AdoptOpenJDK 17 aarch64
|
||||
- macOS 12.0.1, Amazon Corretto 11 amd64
|
||||
- Windows 10, OpenJDK 17 amd64
|
||||
- Ubuntu 20.04, AdoptOpenJDK 17 amd64
|
||||
|
||||
若在其他环境下无法正常编译, 请尝试选择上述一个环境配置。
|
||||
|
||||
## 构建 JVM 目标项目
|
||||
|
||||
要构建只有 JVM 目标的项目(如 `mirai-console`,只需在项目根目录使用如下命令执行 Gradle 任务:
|
||||
|
||||
```shell
|
||||
$ ./gradlew :mirai-console:assemble # 编译
|
||||
$ ./gradlew :mirai-console:check # 测试
|
||||
$ ./gradlew :mirai-console:build # 编译和测试
|
||||
```
|
||||
|
||||
其中 `:mirai-console` 是目标项目的路径(path)。
|
||||
|
||||
你也可以在 IDEA 等有 Gradle 支持 IDE 中在通过侧边栏等方式选择项目的 `assemble` 等任务:
|
||||
|
||||

|
||||
|
||||
### 获得 mirai-console JAR
|
||||
|
||||
在项目根目录执行如下命令可以获得包含依赖的 mirai-console JAR。对于其他模块类似。
|
||||
|
||||
```shell
|
||||
$ ./gradlew :mirai-console:shadowJar
|
||||
```
|
||||
|
||||
### 构建 core
|
||||
|
||||
请参考 [构建 Core](BuildingCore.md)。
|
||||
|
||||
## 其他项目支持
|
||||
|
||||
- 维护社区:可以为 [mirai-console](/mirai-console)
|
||||
编写插件并发布到[论坛](https://mirai.mamoe.net/);
|
||||
- 代码优化:优化任何功能设计或实现, 或是引入一个新的设计;
|
||||
- 解决问题:在 [issues](https://github.com/mamoe/mirai/issues) 查看 mirai
|
||||
正遇到的所有问题,或在 [里程碑](https://github.com/mamoe/mirai/milestones) 查看版本计划;
|
||||
- 协议支持:[添加新协议支持](ImplementingProtocol.md)。
|
||||
|
||||
### 加入开发组
|
||||
|
||||
你可以随时提交 PR 解决任何问题。而若有兴趣,我们也欢迎你加入开发组,请联系 support@mamoe.net
|
||||
|
||||
[mirai-compose]: https://github.com/sonder-joker/mirai-compose
|
||||
|
||||
[plugin-center 服务端]: https://github.com/project-mirai/mirai-plugin-center
|
||||
|
||||
[mirai-api-http]: https://github.com/project-mirai/mirai-api-http
|
||||
|
||||
[project-mirai/docs]: https://github.com/project-mirai/docs
|
||||
|
||||
[docs.mirai.mamoe.net]: https://docs.mirai.mamoe.net
|
||||
|
||||
| 名称 | 描述 |
|
||||
|:-----------------------:|:----------------------------------------------------------------------------:|
|
||||
| core 和 console 日常更新 | 在 milestone 安排的日常更新。我们目前版本速度是一个月到两个月发布一个次版本(2.x)。需要日常的开发。 |
|
||||
| console 后端 | 架构稳定,现在格外需要在易用性上的提升,首先需要一个优化方案,再实现它们。 |
|
||||
| console 文档 | 根据用户反馈,现在文档十分缺少。需要以用户的身份体验过 console 的人编写用户文档。 |
|
||||
| 图形前端 [mirai-compose] | 各功能都缺目前尤其缺少对接 console PluginConfig 的图形化配置的实现。 |
|
||||
| [plugin-center 服务端] | 插件中心正在建设中。后端 Spring,前端 Vuetify。由于开发人员学业繁忙,暂搁置。 |
|
||||
| plugin-center 社区 | 插件中心计划支持所有语言的插件,因此需要与社区 SDK 作者沟通并帮助它们接入 Console 的 PluginLoader API 和插件中心的要求。 |
|
||||
| plugin-center console 端 | 需要评估现在 console 架构是否足够支持插件中心及所有语言插件的管理,实现与插件中心的对接。 |
|
||||
| plugin-center gradle | 对接插件中心,实现通过 Task 上传插件。还没有开始做。 |
|
||||
| mirai-console-loader | console 启动器。对接插件中心的 API,支持下载和更新插件等。不确定之后是否会有人实现。 |
|
||||
| IDE 插件 | IntelliJ IDEA 的插件的工作。可以为 mirai 框架添加检查等功能。这个部分目前基本满足需求。 |
|
||||
| [mirai-api-http] v2 | 日常维护。 |
|
||||
| [project-mirai/docs] | 用户友好文档自动部署,使用 VuePress , 部署于 [docs.mirai.mamoe.net],目前还有部分超链接错误的问题。 |
|
||||
|
||||
### 里程碑
|
||||
|
||||
[里程碑](https://github.com/mamoe/mirai/milestones) 为各版本的开发计划.
|
||||
在完成所有任务后就会发布该版本.
|
||||
|
||||
`Backlog` 为没有设定目标版本的计划. 如果有相关 PR, 这些计划就可能会被确定到一个最近的版本.
|
||||
|
||||
### 开发 mirai-core
|
||||
|
||||
- 使用 IntelliJ IDEA 或 Android Studio
|
||||
- 安装 IDE
|
||||
插件 [kotlin-jvm-blocking-bridge](https://github.com/Him188/kotlin-jvm-blocking-bridge/blob/master/README-chs.md#%E5%AE%89%E8%A3%85-intellij-idea-%E6%88%96-android-studio-%E6%8F%92%E4%BB%B6)
|
||||
- 若要添加一个 suspend 函数, 请为它添加 `@JvmBlockingBridge`,
|
||||
使用 [kotlin-jvm-blocking-bridge](https://github.com/mamoe/kotlin-jvm-blocking-bridge/blob/master/README-chs.md)
|
||||
- 使用纯 Kotlin 实现
|
||||
- 尽量不要引用新的库
|
||||
- 遵守 Kotlin 官方代码规范(提交前使用 IDE 格式化代码即可 (commit 时勾选 'Reformat code'))
|
||||
- 保证二进制兼容性: 在提交前进行 [ABI 验证](VerifyingABI.md)
|
||||
- 通过 GitHub 的 Pull Request 提交代码,很快就会有相关模块负责人员来审核
|
||||
|
||||
如果你不太保证自己能达到上述要求也没关系,mirai 感谢你的每一行代码,维护者会审核代码并尽可能帮助你。
|
13
docs/contributing/VerifyingABI.md
Normal file
13
docs/contributing/VerifyingABI.md
Normal file
@ -0,0 +1,13 @@
|
||||
# 进行 ABI 验证
|
||||
|
||||
mirai
|
||||
通过 [binary-compatibility-validator](https://github.com/Kotlin/binary-compatibility-validator))
|
||||
维护 [ABI](https://zh.wikipedia.org/zh-cn/%E5%BA%94%E7%94%A8%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%8E%A5%E5%8F%A3)
|
||||
稳定性。
|
||||
|
||||
若要修改 mirai-core-api,可执行 Gradle 任务 `apiCheckAll` 来检验 ABI 兼容性,也可以运行 IDEA
|
||||
配置 `Check Binary Compatiblity`。
|
||||
|
||||
若正在添加一个新功能,可以执行 Gradle 任务 `apiDumpAll` 或 IDEA
|
||||
配置 `Dump API Changes for ...` 来更新记录。这将会生成 `*.api`
|
||||
文件,文件的变化反映了你的修改情况。请人工审核该文件以确保向下兼容。
|
BIN
docs/contributing/images/run-gradle-tasks-in-idea.png
Normal file
BIN
docs/contributing/images/run-gradle-tasks-in-idea.png
Normal file
Binary file not shown.
After ![]() (image error) Size: 24 KiB |
Loading…
Reference in New Issue
Block a user