Commit 93961dde authored by vvb2060's avatar vvb2060 Committed by topjohnwu

Fix version on continuous build

parent 1024e68e
import org.eclipse.jgit.api.Git import org.eclipse.jgit.api.Git
import org.eclipse.jgit.internal.storage.file.FileRepository import org.eclipse.jgit.internal.storage.file.FileRepository
import org.gradle.api.Plugin import org.gradle.api.Plugin
...@@ -12,13 +11,14 @@ private lateinit var commitHash: String ...@@ -12,13 +11,14 @@ private lateinit var commitHash: String
private var commitCount = 0 private var commitCount = 0
object Config { object Config {
operator fun get(key: String) : String? { operator fun get(key: String): String? {
val v = props[key] as? String ?: return null val v = props[key] as? String ?: return null
return if (v.isBlank()) null else v return if (v.isBlank()) null else v
} }
fun contains(key: String) = get(key) != null fun contains(key: String) = get(key) != null
val version: String = get("version") ?: commitHash val version: String get() = get("version") ?: commitHash
val versionCode: Int get() = get("magisk.versionCode")!!.toInt() val versionCode: Int get() = get("magisk.versionCode")!!.toInt()
val stubVersion: String get() = get("magisk.stubVersion")!! val stubVersion: String get() = get("magisk.stubVersion")!!
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment