Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: load SPI Service in jvm plugin #2247

Merged
merged 3 commits into from
Oct 28, 2022
Merged

Conversation

cssxsh
Copy link
Contributor

@cssxsh cssxsh commented Sep 10, 2022

添加从 插件 jar 中 加载 SPI Service 的API

用来实现统一加载 Command 或者 PluginConfig 之类服务的效果

private val commands: List<Command> by services()

override fun onEnable() {
    for (command in commands) command.register()
}

override fun onDisable() {
    for (command in commands) command.unregister()
}

@Him188 Him188 requested a review from Karlatemp September 11, 2022 02:29
@Him188 Him188 added t:feature 类型: 新特性 s:console 子系统: mirai-console labels Sep 12, 2022
@Him188 Him188 added this to the 2.14 milestone Sep 12, 2022
@cssxsh cssxsh requested a review from Karlatemp September 12, 2022 20:12
@Him188 Him188 added the z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排 label Sep 15, 2022
@Him188 Him188 modified the milestones: 2.14, 2.14.0-RC Sep 23, 2022
@Him188 Him188 merged commit 5bf9fdf into mamoe:dev Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s:console 子系统: mirai-console t:feature 类型: 新特性 z:ready-to-merge 状态: PR 已经可以合并, 正在等待一些安排
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants