mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-11 02:50:15 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
6ecfd34ff5
@ -1,6 +1,6 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Bintray Publish
|
||||
name: Dev Tag Publishing
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
@ -9,9 +9,6 @@ on:
|
||||
# Sequence of patterns matched against refs/tags
|
||||
tags:
|
||||
- '*-dev*'
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
63
.github/workflows/ReleasePublishing.yml
vendored
Normal file
63
.github/workflows/ReleasePublishing.yml
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: Bintray Publish
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# This workflow contains a single job called "build"
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Grant execute permission for gradlew
|
||||
run: chmod +x gradlew
|
||||
- name: Gradle clean
|
||||
run: ./gradlew clean
|
||||
- name: Gradle build
|
||||
run: ./gradlew build # if test's failed, don't publish
|
||||
- name: Check keys
|
||||
run: ./gradlew
|
||||
:mirai-console:ensureBintrayAvailable
|
||||
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
|
||||
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
|
||||
- name: Gradle :mirai-console:fillBuildConstants
|
||||
run: ./gradlew
|
||||
:mirai-console:fillBuildConstants
|
||||
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
|
||||
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
|
||||
- name: Gradle :mirai-console:bintrayUpload
|
||||
run: ./gradlew
|
||||
:mirai-console:bintrayUpload
|
||||
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
|
||||
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
|
||||
- name: Gradle :mirai-console-terminal:bintrayUpload
|
||||
run: ./gradlew
|
||||
:mirai-console-terminal:bintrayUpload
|
||||
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
|
||||
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
|
||||
- name: Gradle :mirai-console-compiler-common:bintrayUpload
|
||||
run: ./gradlew
|
||||
:mirai-console-compiler-common:bintrayUpload
|
||||
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
|
||||
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
|
||||
- name: Gradle :mirai-console-intellij:bintrayUpload
|
||||
run: ./gradlew
|
||||
:mirai-console-intellij:bintrayUpload
|
||||
-Dbintray_user=${{ secrets.BINTRAY_USER }} -Pbintray_user=${{ secrets.BINTRAY_USER }}
|
||||
-Dbintray_key=${{ secrets.BINTRAY_KEY }} -Pbintray_key=${{ secrets.BINTRAY_KEY }}
|
||||
- name: Publish Gradle plugin
|
||||
run: ./gradlew
|
||||
:mirai-console-gradle:publishPlugins
|
||||
-Dgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }} -Pgradle.publish.key=${{ secrets.GRADLE_PUBLISH_KEY }}
|
||||
-Dgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }} -Pgradle.publish.secret=${{ secrets.GRADLE_PUBLISH_SECRET }}
|
@ -20,8 +20,8 @@ console 由后端和前端一起工作. 使用时必须选择一个前端.
|
||||
|
||||
| 版本类型 | 版本号 |
|
||||
|:------:|:------------------------------:|
|
||||
| 稳定 | - |
|
||||
| 预览 | 1.0-RC-1 |
|
||||
| 稳定 | 1.0.0 |
|
||||
| 预览 | - |
|
||||
| 开发 | [![Version]][Bintray Download] |
|
||||
|
||||
## 配置项目
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
Mirai Console 前端开发文档。
|
||||
|
||||
[`MiraiConsole`]: ../backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsole.kt
|
||||
[`MiraiConsole`]: ../backend/mirai-console/src/MiraiConsole.kt
|
||||
|
||||
## 实现前端
|
||||
|
||||
@ -10,10 +10,8 @@ Mirai Console 前端开发文档。
|
||||
|
||||
在 `build.gradle` 或 `build.gradle.kts` 添加:
|
||||
```kotlin
|
||||
kotlin {
|
||||
sourceSets.all {
|
||||
kotlin.sourceSets.all {
|
||||
languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.ConsoleFrontEndImplementation")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@ -22,9 +20,9 @@ kotlin {
|
||||
|
||||
### 实现 Mirai Console
|
||||
|
||||
[`MiraiConsole`] 是后端的公开对象,由 [MiraiConsoleImplementationBridge](../backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/internal/MiraiConsoleImplementationBridge.kt) 代理,与前端链接。
|
||||
[`MiraiConsole`] 是后端的公开对象,由 [MiraiConsoleImplementationBridge](../backend/mirai-console/src/internal/MiraiConsoleImplementationBridge.kt) 代理,与前端链接。
|
||||
|
||||
前端需要实现 [MiraiConsoleImplementation.kt](../backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsoleImplementation.kt)。
|
||||
前端需要实现 [MiraiConsoleImplementation.kt](../backend/mirai-console/src/MiraiConsoleImplementation)。
|
||||
|
||||
由于实现前端需要一定的技术能力,相信实现者都能理解源码内注释。
|
||||
|
||||
@ -32,4 +30,4 @@ kotlin {
|
||||
|
||||
通过 `public fun MiraiConsoleImplementation.start()`。
|
||||
|
||||
[MiraiConsoleImplementation.kt: Line 161](../backend/mirai-console/src/main/kotlin/net/mamoe/mirai/console/MiraiConsoleImplementation.kt#L161)
|
||||
[MiraiConsoleImplementation.kt: Line 161](../backend/mirai-console/src/MiraiConsoleImplementation.kt#L161)
|
||||
|
@ -135,7 +135,7 @@ public final class JExample extends JavaPlugin {
|
||||
由 Console 初始化(仅在某些静态初始化不可用的情况下使用):
|
||||
```java
|
||||
public final class JExample extends JavaPlugin {
|
||||
private static final JExample instance;
|
||||
private static JExample instance;
|
||||
public static JExample getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
38
docs/Run.md
38
docs/Run.md
@ -22,12 +22,34 @@ Mirai Console 可以独立启动,也可以被嵌入到某个应用中。
|
||||
|
||||
只有 mirai-console 前端才有入口点 `main` 方法。目前只有一个 terminal 前端可用。
|
||||
|
||||
#### 从JCenter下载模块
|
||||
|
||||
mirai 在版本发布时会将发布的构建存放与 [mirai-bintray-repo]。
|
||||
|
||||
- mirai-core 会提供 [mirai-core-all]
|
||||
- mirai-console 与其各个模块都会提供 `-all` 的 Shadowed 构建
|
||||
|
||||
```shell script
|
||||
# 注: 自行更换对应版本号
|
||||
|
||||
# Download Mirai Core All
|
||||
|
||||
curl -L https://maven.aliyun.com/repository/public/net/mamoe/mirai-core-all/1.3.3/mirai-core-all-1.3.3-all.jar -o mirai-core-all-1.3.3.jar
|
||||
|
||||
# Download Mirai Console All
|
||||
|
||||
curl -L https://maven.aliyun.com/repository/public/net/mamoe/mirai-console/1.0.0/mirai-console-1.0.0-all.jar -o mirai-console-1.0.0.jar
|
||||
|
||||
# Download Mirai Console Terminal
|
||||
|
||||
curl -L https://maven.aliyun.com/repository/public/net/mamoe/mirai-console-terminal/1.0.0/mirai-console-terminal-1.0.0-all.jar -o mirai-console-terminal-1.0.0.jar
|
||||
|
||||
```
|
||||
|
||||
### 启动 mirai-console-terminal 前端
|
||||
|
||||
mirai 在版本发布时会同时发布打包依赖的 Shadow JAR,存放在 [mirai-repo]。
|
||||
|
||||
1. 在 [mirai-repo] 下载如下三个模块的最新版本文件并放到一个文件夹内 (如 `libs`):
|
||||
- mirai-core-qqandroid
|
||||
1. 下载如下三个模块的最新版本文件并放到一个文件夹内 (如 `libs`)(详见 [下载模块](#从JCenter下载模块)):
|
||||
- mirai-core-all
|
||||
- mirai-console
|
||||
- mirai-console-terminal
|
||||
|
||||
@ -51,6 +73,7 @@ pause
|
||||
Linux:
|
||||
```shell script
|
||||
#!/usr/bin/env bash
|
||||
echo -e '\033]2;Mirai Console\007'
|
||||
java -cp "./libs/*" net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader $*
|
||||
```
|
||||
|
||||
@ -59,11 +82,14 @@ java -cp "./libs/*" net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader
|
||||
#### mirai-console-terminal 前端参数
|
||||
使用 `./start-mirai-console --help` 查看 mirai-console-terminal 支持的启动参数
|
||||
|
||||
[mirai-repo]: https://github.com/project-mirai/mirai-repo/tree/master/shadow
|
||||
|
||||
|
||||
### 启动 mirai-console-pure 前端
|
||||
|
||||
与启动 `mirai-console-terminal` 前端大体相同
|
||||
- 下载 `mirai-console-terminal` 改成下载 `mirai-console-pure`
|
||||
- 启动入口从 `net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader` 改成 `net.mamoe.mirai.console.pure.MiraiConsolePureLoader`
|
||||
|
||||
|
||||
[mirai-repo]: https://github.com/project-mirai/mirai-repo/tree/master/shadow
|
||||
[mirai-bintray-repo]: https://bintray.com/him188moe/mirai
|
||||
[mirai-core-all]: https://bintray.com/him188moe/mirai/mirai-core-all
|
||||
|
Loading…
Reference in New Issue
Block a user