Converting some code snippet from groovy to kotlin KTS in my build.gradle.kts file
I have the following code in my build.gradle.kts. I have now migrated to kotlin KTS. And need help on translating this code from groovy to kotlin script.
fun getVersionFromGit(fallback: String): String {
return try {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
"git describe --tags --abbrev=0 --match "v*.*.*"".execute().text.substring(1).trim()
} else {
["sh , "-c"", "git describe --tags --abbrev=0 --match "v*.*.*""].execute().text.substring(1).trim()...