From 982f73444af0d3951a06586ab8517a3afec0aefe Mon Sep 17 00:00:00 2001 From: fankesyooni Date: Sun, 10 Nov 2024 21:35:12 +0800 Subject: [PATCH] chore: some tweaks in build.gradle.kts --- app/build.gradle.kts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index f0666c7..2edecd6 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -58,7 +58,13 @@ androidComponents { onVariants(selector().all()) { it.outputs.forEach { output -> val currentType = it.buildType - val currentSuffix = property.github.ci.commit.id.let { suffix -> if (suffix.isNotBlank()) "-$suffix" else "" } + + // Workaround for GitHub Actions. + // Why? I don't know, but it works. + // Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: + // public inline fun CharSequence.isNotBlank(): Boolean defined in kotlin.text. + @Suppress("UNNECESSARY_SAFE_CALL") + val currentSuffix = property.github.ci.commit.id?.let { suffix -> if (suffix.isNotBlank()) "-$suffix" else "" } val currentVersion = "${output.versionName.get()}$currentSuffix(${output.versionCode.get()})" if (output is com.android.build.api.variant.impl.VariantOutputImpl) output.outputFileName.set("${property.project.name}-v$currentVersion-$currentType.apk")