mirror of
https://github.com/xHyroM/lighteco.git
synced 2024-11-10 01:18:07 +01:00
40 lines
751 B
Text
40 lines
751 B
Text
|
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
|
||
|
}
|