Skip to content

Commit

Permalink
mcl: release 2.0.0-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Mar 31, 2022
1 parent cf29e0d commit 9c3370a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

group 'org.itxtech'
version '1.2.3'
version '2.0.0-beta.1'
description '模块化、轻量级且支持完全自定义的 mirai 加载器。'

repositories {
Expand All @@ -28,7 +28,7 @@ def getGitHash = { ->

task fatJar(type: Jar) {
from sourceSets.main.output
archiveBaseName.set("mcl")
archiveFileName = "mcl-${project.version}-all.jar"

manifest {
attributes "Main-Class": "org.itxtech.mcl.Loader"
Expand Down Expand Up @@ -63,11 +63,11 @@ task launchTest(type: JavaExec) {
task zipAll(type: Zip) {
from fileTree(dir: ".", includes: ["README.md", "LICENSE", "mcl", "mcl.cmd"])
from("$buildDir/libs") {
include "mcl-${project.version}.jar"
include "mcl-${project.version}-all.jar"
rename { "mcl.jar" }
}
destinationDirectory = file("$buildDir/libs")
archiveFileName = "mirai-console-loader-${project.version}.zip"
archiveFileName = "mcl-${project.version}.zip"
}

assemble.dependsOn(fatJar)
Expand Down
14 changes: 5 additions & 9 deletions docs/Plugin.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# MCL Plugin

`Mirai Console`中使用`MCL API`,本文档采用`Kotlin`编写。
`Mirai Console`插件中使用`MCL API`,本文档采用`Kotlin`编写。

## `build.gradle(.kts)` 中添加`MCL`依赖

```groovy
dependencies {
//打包时排除mcl包,如果您的插件打包时不打包依赖,则可使用implementation
compileOnly("org.itxtech:mirai-console-loader:1.2.1")
compileOnly("org.itxtech:mirai-console-loader:2.0.0")
}
```

Expand Down Expand Up @@ -35,7 +35,7 @@ val mcl = Loader.getInstance()

fun runMclCommand(args: Array<String>) {
mcl.parseCli(args, true) //调用mcl解析参数
mcl.manager.phaseCli() //调用脚本管理器执行cli阶段
mcl.manager.phaseCli() //调用模块管理器执行cli阶段
}

//执行添加包指令
Expand All @@ -55,10 +55,6 @@ mcl.config.packages.add(
Config.Package("org.itxtech:mirai-native", "stable")
)

//执行 updater 脚本,如果updater被禁用则无法调用
mcl.manager.getScript("updater")?.apply {
phase.load?.run() //执行脚本的 load 阶段
return
}

//执行 updater 模块,如果updater被禁用则无法调用
mcl.manager.getModule("updater")?.load() //执行模块的 load 阶段
```
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ pluginManagement {
gradlePluginPortal()
}
}
rootProject.name = 'mirai-console-loader'
rootProject.name = 'mcl'

0 comments on commit 9c3370a

Please sign in to comment.