mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-06-18 16:55:23 +12:00
forgot that is build.gradle.kts not build.gradle
This commit is contained in:
parent
ff34490678
commit
93ed2284df
1 changed files with 12 additions and 11 deletions
|
@ -55,24 +55,25 @@ dependencies {
|
||||||
implementation("com.google.code.gson:gson:2.10.1")
|
implementation("com.google.code.gson:gson:2.10.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
def getVersionName() {
|
fun getVersionName(): String {
|
||||||
def tag = '1.0'
|
var tag = "1.0"
|
||||||
try {
|
try {
|
||||||
def process = 'git describe --tags --abbrev=0'.execute()
|
val process = Runtime.getRuntime().exec("git describe --tags --abbrev=0")
|
||||||
tag = process.text.trim()
|
tag = process.inputStream.bufferedReader().readText().trim()
|
||||||
if (tag.startsWith('v')) {
|
if (tag.startsWith("v")) {
|
||||||
tag = tag.substring(1)
|
tag = tag.substring(1)
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (e: Exception) {
|
||||||
println "Failed to get latest Git tag: ${e.message}"
|
println("Failed to get latest Git tag: ${e.message}")
|
||||||
}
|
}
|
||||||
return tag
|
return tag
|
||||||
}
|
}
|
||||||
|
|
||||||
def getVersionCode() {
|
fun getVersionCode(): Int {
|
||||||
def versionCode = 1
|
var versionCode = 1
|
||||||
if (getVersionName() && getVersionName()[0].isDigit()) {
|
val tag = getVersionName()
|
||||||
versionCode = getVersionName()[0].toInteger()
|
if (tag.isNotEmpty() && tag[0].isDigit()) {
|
||||||
|
versionCode = tag[0].toString().toInt()
|
||||||
}
|
}
|
||||||
return versionCode
|
return versionCode
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue