Update build file and API version to automatically append patchversion
This commit is contained in:
parent
725217967b
commit
387b329d73
1 changed files with 16 additions and 1 deletions
17
build.gradle
17
build.gradle
|
@ -12,11 +12,26 @@ plugins {
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
version = "1.1.13"
|
version = "1.2.${determinePatchVersion()}"
|
||||||
group = "dev.zontreck"
|
group = "dev.zontreck"
|
||||||
archivesBaseName = "LibAC"
|
archivesBaseName = "LibAC"
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
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 {
|
repositories {
|
||||||
// Use Maven Central for resolving dependencies.
|
// Use Maven Central for resolving dependencies.
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue