mirror of
https://github.com/devproje/px32-bot.git
synced 2024-11-29 20:13:06 +00:00
feat: add version for terminal
This commit is contained in:
parent
dfd1934b5e
commit
2616675918
4 changed files with 28 additions and 18 deletions
|
@ -1,5 +1,7 @@
|
|||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
||||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("java")
|
||||
kotlin("jvm") version "2.0.20"
|
||||
id("com.gradleup.shadow") version "8.3.0"
|
||||
}
|
||||
|
@ -41,6 +43,28 @@ dependencies {
|
|||
}
|
||||
|
||||
tasks {
|
||||
withType<KotlinCompile> {
|
||||
compilerOptions {
|
||||
jvmTarget.set(JvmTarget.JVM_21)
|
||||
}
|
||||
}
|
||||
|
||||
processResources {
|
||||
filesMatching("*.properties") {
|
||||
expand(project.properties)
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
archiveBaseName.set(project.name)
|
||||
archiveClassifier.set("")
|
||||
archiveVersion.set("")
|
||||
|
||||
manifest {
|
||||
attributes["Main-Class"] = "net.projecttl.p.x32.Px32Kt"
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
package net.projecttl.p.x32
|
||||
|
||||
import java.util.*
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
private class DefaultConfigDelegate {
|
||||
private val props = Properties()
|
||||
|
||||
init {
|
||||
props.load(this.javaClass.getResourceAsStream("/default.properties"))
|
||||
}
|
||||
|
||||
operator fun getValue(thisRef: Any?, property: KProperty<*>): String {
|
||||
return props.getProperty(property.name).toString()
|
||||
}
|
||||
}
|
|
@ -2,6 +2,7 @@ package net.projecttl.p.x32
|
|||
|
||||
import net.projecttl.p.x32.command.Avatar
|
||||
import net.projecttl.p.x32.command.Ping
|
||||
import net.projecttl.p.x32.config.DefaultConfig
|
||||
import net.projecttl.p.x32.handler.Ready
|
||||
import net.projecttl.p.x32.kernel.CoreKernel
|
||||
import org.slf4j.Logger
|
||||
|
@ -10,6 +11,7 @@ import org.slf4j.LoggerFactory
|
|||
val logger: Logger = LoggerFactory.getLogger(Px32::class.java)
|
||||
|
||||
fun main() {
|
||||
logger.info("PX32 version v${DefaultConfig.version}")
|
||||
val kernel = CoreKernel(System.getenv("TOKEN"))
|
||||
kernel.addHandler(Ready)
|
||||
|
||||
|
|
|
@ -1 +1 @@
|
|||
version=${version}
|
||||
version=${project.version}
|
||||
|
|
Loading…
Reference in a new issue