From 2d54d588eb56e1ddf20cafeb95fa261e8a547607 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 5 Feb 2020 23:32:17 -0800 Subject: Hardcode version for F-Droid --- app/build.gradle | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1369f309..0bf77b05 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,10 +35,18 @@ android { applicationId "${project.APP_GROUP}.${project.APP_ID.toLowerCase(Locale.CANADA)}" minSdkVersion kau.Versions.minSdk targetSdkVersion Versions.targetSdk - // versionCode 2040300 - versionCode androidGitVersion.code() - // versionName 2.4.3 - versionName androidGitVersion.name() + versionCode 2040300 +// versionCode androidGitVersion.code() + versionName '2.4.3' +// versionName androidGitVersion.name() + + // Verification for F-Droid builds + if (versionCode != androidGitVersion.code()) { + throw new GradleException("Version code mismatch, expected ${androidGitVersion.code()}, got $versionCode") + } + if (versionName != androidGitVersion.name()) { + throw new GradleException("Version name mismatch, expected ${androidGitVersion.name()}, got $versionName") + } multiDexEnabled true testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" javaCompileOptions { -- cgit v1.2.3