From 716e8920f53a413639ce584ba0d2dc09559f0be0 Mon Sep 17 00:00:00 2001 From: hill Date: Tue, 29 Sep 2026 16:04:47 +0200 Subject: [PATCH] Set the AnkiQuest versionCode through a setter Upstream's validateVersionCode (buildSrc VersionCode.read) requires exactly one line starting with versionCode and runs on every build through the configuration cache. The quest override was a second one, so merging upstream fails the build. setVersionCode sets the same value. --- AnkiDroid/build.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AnkiDroid/build.gradle b/AnkiDroid/build.gradle index 841574f9aff4..398512d0163f 100644 --- a/AnkiDroid/build.gradle +++ b/AnkiDroid/build.gradle @@ -121,6 +121,7 @@ android { // the upstream beta version. Keep the eight-digit ABI-split budget. // quest- is 5nnnn000; nightly builds after it add their commit count, // so both channels install over each other in order. + // A setter, so upstream's validateVersionCode still sees one versionCode literal. if ((project.findProperty("customSuffix") ?: "").toString().replaceFirst(/^\.*/, "") == "quest") { def questRelease = (project.findProperty("ankiquestRelease") ?: "0").toString() def questNightly = (project.findProperty("ankiquestNightly") ?: "0").toString() @@ -131,7 +132,7 @@ android { throw new GradleException("ankiquestNightly must be a commit count from 0 to 999") } if (questRelease.toInteger() > 0) { - versionCode = 50000000 + questRelease.toInteger() * 1000 + questNightly.toInteger() + setVersionCode(50000000 + questRelease.toInteger() * 1000 + questNightly.toInteger()) } } // If you change this to a new version, you probably also want to update .gradle/workflows/milestone.yml for the new version...