From 52aa75cf3f918610e0b5bcc251330130b878f037 Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 20 Nov 2020 11:36:28 +0800 Subject: [PATCH 1/7] Update Publishing.yml --- .github/workflows/Publishing.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/Publishing.yml b/.github/workflows/Publishing.yml index dc365bd7f..403aa333d 100644 --- a/.github/workflows/Publishing.yml +++ b/.github/workflows/Publishing.yml @@ -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: From 8bb4512f6f5f970b64e66a1ca13b089452f1a5de Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 20 Nov 2020 11:36:47 +0800 Subject: [PATCH 2/7] Rename Publishing.yml to DevTagPublishing.yml --- .github/workflows/{Publishing.yml => DevTagPublishing.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{Publishing.yml => DevTagPublishing.yml} (100%) diff --git a/.github/workflows/Publishing.yml b/.github/workflows/DevTagPublishing.yml similarity index 100% rename from .github/workflows/Publishing.yml rename to .github/workflows/DevTagPublishing.yml From 94256a43039e09dabe67659826c3eb9abcb6b657 Mon Sep 17 00:00:00 2001 From: Him188 Date: Fri, 20 Nov 2020 11:37:25 +0800 Subject: [PATCH 3/7] Create ReleasePublishing.yml --- .github/workflows/ReleasePublishing.yml | 63 +++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ReleasePublishing.yml diff --git a/.github/workflows/ReleasePublishing.yml b/.github/workflows/ReleasePublishing.yml new file mode 100644 index 000000000..12a8e5450 --- /dev/null +++ b/.github/workflows/ReleasePublishing.yml @@ -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 }} From 5fad5e93371fc6ce4f6a86c7942e60e954ee7d8d Mon Sep 17 00:00:00 2001 From: Him188 Date: Sat, 21 Nov 2020 09:14:27 +0800 Subject: [PATCH 4/7] Update FrontEnd.md --- docs/FrontEnd.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/docs/FrontEnd.md b/docs/FrontEnd.md index fd06cbe11..03a764a49 100644 --- a/docs/FrontEnd.md +++ b/docs/FrontEnd.md @@ -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 { - languageSettings.useExperimentalAnnotation("net.mamoe.mirai.console.ConsoleFrontEndImplementation") - } +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) \ No newline at end of file +[MiraiConsoleImplementation.kt: Line 161](../backend/mirai-console/src/MiraiConsoleImplementation.kt#L161) From 6ab182abba3e604df14a47ce15de102b4890065f Mon Sep 17 00:00:00 2001 From: Him188 Date: Sun, 22 Nov 2020 10:15:44 +0800 Subject: [PATCH 5/7] Update ConfiguringProjects.md --- docs/ConfiguringProjects.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/ConfiguringProjects.md b/docs/ConfiguringProjects.md index 5063a8857..9f876c25a 100644 --- a/docs/ConfiguringProjects.md +++ b/docs/ConfiguringProjects.md @@ -20,8 +20,8 @@ console 由后端和前端一起工作. 使用时必须选择一个前端. | 版本类型 | 版本号 | |:------:|:------------------------------:| -| 稳定 | - | -| 预览 | 1.0-RC-1 | +| 稳定 | 1.0.0 | +| 预览 | - | | 开发 | [![Version]][Bintray Download] | ## 配置项目 From e56860deb5acd49d0697d7411bc67551494e6469 Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Mon, 23 Nov 2020 22:42:14 +0800 Subject: [PATCH 6/7] Update Plugins.md --- docs/Plugins.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Plugins.md b/docs/Plugins.md index 63cee40f7..673992138 100644 --- a/docs/Plugins.md +++ b/docs/Plugins.md @@ -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; } From 653ca7ac793286786ac3fdc12132fc627e342f76 Mon Sep 17 00:00:00 2001 From: Karlatemp Date: Mon, 23 Nov 2020 23:32:08 +0800 Subject: [PATCH 7/7] Update Run.md --- docs/Run.md | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/docs/Run.md b/docs/Run.md index 2e794c54f..d7c7edbdd 100644 --- a/docs/Run.md +++ b/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