Update build file and API version to automatically append patchversion

This commit is contained in:
Aria 2023-05-08 16:10:37 -07:00
parent 725217967b
commit 387b329d73

View file

@ -12,11 +12,26 @@ plugins {
id 'maven-publish'
}
version = "1.1.13"
version = "1.2.${determinePatchVersion()}"
group = "dev.zontreck"
archivesBaseName = "LibAC"
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
def determinePatchVersion = {
// get the name of the last tag
def tagInfo = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = tagInfo
}
tagInfo = tagInfo.toString()
if (!tagInfo.contains('-')) {
return 0
}
return tagInfo.split("-")[1]
}
repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()