Skip to content

Commit

Permalink
fix build & dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
RegadPoleCN committed Aug 27, 2024
1 parent 247d208 commit 486df94
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 39 deletions.
5 changes: 3 additions & 2 deletions apply/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
taboolib {
description {
name(rootProject.name)
desc("A qq bot plugin")
desc("A bot plugin for QQ/Kook")
links {
name("homepage").url("https://github.com/RegadPoleCN/PlumBot")
}
contributors {
name("alazeprt")
name("RegadPole")
name("alazeprt")
}
prefix("PlumBot")
}
}

Expand Down
7 changes: 5 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ subprojects {
taboolib {
env {
// 安装模块
install(UNIVERSAL, DATABASE, METRICS, LANG)
install(UNIVERSAL, DATABASE, METRICS)
install(BUKKIT_ALL)
install(VELOCITY)
}
Expand All @@ -28,7 +28,7 @@ subprojects {
}

dependencies {
taboo("com.github.RegadPoleCN:onebot-client:f73b158fc4")
compileOnly("com.github.RegadPoleCN:onebot-client:f73b158fc4")
taboo("com.github.SNWCreations:KookBC:0.27.4")
compileOnly("ink.ptms.core:v12004:12004:mapped")
compileOnly("ink.ptms.core:v12004:12004:universal")
Expand All @@ -51,3 +51,6 @@ subprojects {
}
}
}
gradle.buildFinished {
buildDir.deleteRecursively()
}
9 changes: 8 additions & 1 deletion bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
taboolib { subproject = true }
taboolib { subproject = true }

dependencies {
compileOnly(project(":common"))
}
gradle.buildFinished {
buildDir.deleteRecursively()
}
6 changes: 5 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
taboolib { subproject = true }
taboolib { subproject = true }

gradle.buildFinished {
buildDir.deleteRecursively()
}
23 changes: 23 additions & 0 deletions common/src/main/kotlin/me/regadpole/plumbot/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package me.regadpole.plumbot

import taboolib.common.env.RuntimeDependencies
import taboolib.common.env.RuntimeDependency

@RuntimeDependencies(
RuntimeDependency(value = "org.java-websocket:Java-WebSocket:1.5.5"),
RuntimeDependency(value = "org.java-websocket:Java-WebSocket:1.5.7"),
RuntimeDependency(value = "org.slf4j:slf4j-api:1.7.36"),
RuntimeDependency(value = "uk.org.lidalia:sysout-over-slf4j:1.0.2"),
RuntimeDependency(value = "net.kyori:event-method:3.0.0"),
RuntimeDependency(value = "net.kyori:event-api:3.0.0"),
RuntimeDependency(value = "org.checkerframework:checker-qual:2.5.4"),
RuntimeDependency(value = "org.yaml:snakeyaml:2.0"),
RuntimeDependency(value = "org.apache.logging.log4j:log4j-core:2.14.1"),
RuntimeDependency(value = "org.junit.platform:junit-platform-engine:1.11.0"),
RuntimeDependency(
value = "com.github.RegadPoleCN:onebot-client:f73b158fc4",
repository = "https://jitpack.io"
)
)
object Dependencies {
}
34 changes: 1 addition & 33 deletions common/src/main/kotlin/me/regadpole/plumbot/PlumBot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,13 @@ import me.regadpole.plumbot.bot.QQBot
import me.regadpole.plumbot.config.ConfigLoader
import me.regadpole.plumbot.config.ConfigResolver
import me.regadpole.plumbot.config.LangConfig
import taboolib.common.env.RuntimeDependencies
import taboolib.common.env.RuntimeDependency
import taboolib.common.platform.Plugin
import taboolib.common.platform.event.SubscribeEvent
import taboolib.common.platform.function.disablePlugin
import taboolib.common.platform.function.info
import taboolib.common.platform.function.submitAsync
import taboolib.common.platform.function.warning
import taboolib.module.lang.event.PlayerSelectLocaleEvent
import taboolib.module.lang.event.SystemSelectLocaleEvent


@RuntimeDependencies(
RuntimeDependency(
value = "org.java-websocket:Java-WebSocket:1.5.5",
),
RuntimeDependency(
value = "net.kyori:event-method:3.0.0",
),
RuntimeDependency(
value = "net.kyori:event-api:3.0.0",
),
RuntimeDependency(
value = "com.github.RegadPoleCN:onebot-client:f73b158fc4",
repository = "https://jitpack.io"
),
RuntimeDependency(
value = "com.github.SNWCreations:KookBC:0.27.4",
repository = "https://jitpack.io"
)
)
object PlumBot : Plugin() {

private lateinit var bot: Bot
Expand All @@ -49,6 +25,7 @@ object PlumBot : Plugin() {
ConfigResolver.loadConfig()
config = ConfigResolver.getConfigLoader()
lang =ConfigResolver.getLangConf()
info("Successfully load config")
}

// 项目使用TabooLib Start Jar 创建!
Expand Down Expand Up @@ -105,13 +82,4 @@ object PlumBot : Plugin() {
return lang
}

@SubscribeEvent
fun lang(event: PlayerSelectLocaleEvent) {
event.locale = getConfig().getConfig().lang!!
}

@SubscribeEvent
fun lang(event: SystemSelectLocaleEvent) {
event.locale = getConfig().getConfig().lang!!
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ group=me.regadpole.plumbot
version=2.0.0
kotlin.incremental=true
kotlin.incremental.java=true
kotlin.incremental.useClasspathSnapshot=true
kotlin.caching.enabled=true
kotlin.parallel.tasks.in.project=true

0 comments on commit 486df94

Please sign in to comment.