1
0
Fork 0
mirror of https://github.com/xHyroM/lighteco.git synced 2024-11-10 01:18:07 +01:00
lighteco/build.gradle.kts
Jozef Steinhübl 35eebc1609
feat(better command abstraction)!: switch to brigadier (#8)
* feat: switch to brigadier

* some updates

* feat: make suggestion provider work

* supress warnings

* feat: pay & set command

* feat: give & take command, better suggestions, permissions

* refactor: cleanup

* fix: dont register pay if currency is not payable

* fix: send commands only if you have perms

* make second test currency not payable

* feat: use command's description & name
2024-07-03 17:58:07 +02:00

61 lines
No EOL
1.5 KiB
Text

import java.io.ByteArrayOutputStream
plugins {
id("java")
id("org.sonarqube") version "4.2.1.3168"
}
val majorVersion = 0
val minorVersion = 1
val patchVersion = determinePatchVersion(project)
val commitHash = determineCommitHash(project)
allprojects {
group = "dev.xhyrom"
version = "$majorVersion.$minorVersion.$patchVersion"
description = "Incredibly fast, lightweight, and modular plugin that excels across multiple platforms."
ext {
set("version", "$majorVersion.$minorVersion.$patchVersion+$commitHash")
set("description", description)
}
}
subprojects {
apply(plugin = "java")
apply(plugin = "java-library")
repositories {
mavenCentral()
maven("https://storehouse.okaeri.eu/repository/maven-public/")
maven("https://libraries.minecraft.net")
}
}
fun determinePatchVersion(project: Project): Int {
val tagInfo = ByteArrayOutputStream()
return try {
exec {
commandLine("git", "describe", "--tags")
standardOutput = tagInfo
}
val result = tagInfo.toString()
if (result.contains("-")) result.split("-")[1].toInt() else 0
} catch (e: Exception) {
0
}
}
fun determineCommitHash(project: Project): String {
val commitHashInfo = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "HEAD")
standardOutput = commitHashInfo
}
return commitHashInfo.toString().strip()
}