Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
TheFloodDragon committed Jun 30, 2023
1 parent 8ace9ad commit 70cec2a
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 14 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
jobs:
build:
#奇怪的问题——ubuntu就是构建不了
runs-on: ubuntu-latest
#runs-on: windows-latest
#runs-on: ubuntu-latest
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
Expand Down
8 changes: 4 additions & 4 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import org.gradle.api.Project
import org.gradle.api.artifacts.Dependency
import org.gradle.api.artifacts.dsl.DependencyHandler
import org.gradle.api.artifacts.dsl.RepositoryHandler
import org.gradle.api.plugins.PluginAware
Expand Down Expand Up @@ -51,12 +51,12 @@ fun DependencyHandler.compileTabooLib() {
taboolibModules.forEach { installTaboo(it) }
}

fun DependencyHandler.installModule(dependency: Dependency) {
add("implementation", dependency)
fun DependencyHandler.compileModule(name: String) {
add("compileOnly", project(":project:$name"))
}

fun DependencyHandler.installModule(name: String) {
installModule(project(":project:$name"))
add("implementation", project(":project:$name"))
}

fun DependencyHandler.installTaboo(vararg module: String, version: String = taboolibVersion) = module.forEach {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package cn.fd.utilities.bukkit.command

import cn.fd.utilities.common.util.debug
import cn.fd.utilities.util.debug
import cn.fd.utilities.util.getRunningClasses
import taboolib.common.platform.Platform
import taboolib.common.platform.PlatformSide
import taboolib.common.platform.ProxyCommandSender
import taboolib.common.platform.command.CommandBody
import taboolib.common.platform.command.CommandHeader
import taboolib.common.platform.command.mainCommand
Expand All @@ -17,12 +19,17 @@ object MainCommand {
*/
@CommandBody
val main = mainCommand {
execute<ProxyCommandSender> { sender, _, _ ->
debug("Test")
}
}

//测试命令
@CommandBody
val test = subCommand {
debug("测试")
execute<ProxyCommandSender> { sender, _, _ ->
debug(getRunningClasses())
}
}

}
4 changes: 3 additions & 1 deletion project/module-common/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
dependencies {}
dependencies {
compileModule("module-core")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package cn.fd.utilities.util

import taboolib.common.io.runningClasses
import java.util.*

fun getRunningClasses(): LinkedList<Class<*>> {
return runningClasses
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
package cn.fd.utilities.common.util
package cn.fd.utilities.util

import taboolib.common.platform.function.console
import taboolib.module.lang.Level
import taboolib.module.lang.sendMessage

fun debug(message: String, level: Level = Level.INFO, vararg args: Any) {
console().sendMessage(level, message, args)
fun debug(info: Any?, level: Level = Level.INFO) {
println(info)
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cn.fd.utilities.core.script

/**
* 运行库加载器
*
* @author 坏黑
* @since 2022/5/16 01:01
*/
interface RuntimeClassLoader {

/**
* 获取所有已加载的类
*/
fun runningClasses(): Map<String, Class<*>>

/**
* 获取类
*/
fun findClass(name: String): Class<*>
}

0 comments on commit 70cec2a

Please sign in to comment.