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

40 lines
751 B
Text
Raw Normal View History

2023-07-30 16:00:37 +02:00
import java.io.ByteArrayOutputStream
plugins {
id("java")
}
val majorVersion = 0;
val minorVersion = 1;
val patchVersion = determinePatchVersion(project);
allprojects {
group = "dev.xhyrom"
version = "1.0-SNAPSHOT"
}
subprojects {
apply(plugin = "java")
apply(plugin = "java-library")
ext {
set("version", "$majorVersion.$minorVersion.$patchVersion")
}
repositories {
mavenCentral()
}
}
fun determinePatchVersion(project: Project): Int {
val tagInfo = ByteArrayOutputStream()
exec {
commandLine("git", "describe", "--tags")
standardOutput = tagInfo
}
val result = tagInfo.toString()
return if (result.contains("-")) result.split("-")[1].toInt() else 0
}