From 93961dde2cf420dc396d010d01edee66cd59ee9d Mon Sep 17 00:00:00 2001 From: vvb2060 Date: Mon, 25 Jan 2021 23:33:09 +0800 Subject: [PATCH] Fix version on continuous build --- buildSrc/src/main/java/BuildSource.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/java/BuildSource.kt b/buildSrc/src/main/java/BuildSource.kt index 4f4f5517c..3ba97711d 100644 --- a/buildSrc/src/main/java/BuildSource.kt +++ b/buildSrc/src/main/java/BuildSource.kt @@ -1,4 +1,3 @@ - import org.eclipse.jgit.api.Git import org.eclipse.jgit.internal.storage.file.FileRepository import org.gradle.api.Plugin @@ -12,13 +11,14 @@ private lateinit var commitHash: String private var commitCount = 0 object Config { - operator fun get(key: String) : String? { + operator fun get(key: String): String? { val v = props[key] as? String ?: return null return if (v.isBlank()) null else v } + 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 stubVersion: String get() = get("magisk.stubVersion")!! }