Skip to content

Commit 895f51d

Browse files
committed
Try to also satisfy Google Play's version code constraints
Google Play insists on different version codes for different architectures, without that we cannot even upload new APKs. So rather than keeping version codes in sync, try to satisfy the various or dering constraints from F-Droid and Google Play.
1 parent b06e6d2 commit 895f51d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

toolchain/ecm-version.gradle.in

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@
33

44
ext {
55
ecmVersionName = "@PROJECT_VERSION@"
6-
// version code needs to be strictly increasing and in sync for multiple APKs with different architectures
6+
// version code needs to be strictly increasing and properly ordered for multiple APKs with different architectures
77
// we ensure the former by tying this to time and the latter by using CI_PIPELINE_CREATED_AT for builds
88
// in Gitlab pipelines.
9+
//
10+
// We have the following constraints to satisfy
11+
// - Google Play requires different version codes for different architecture APKs
12+
// - F-Droid requires ARM32 does not have a higher version code than ARM64
13+
// - Google Play require ARM64 to have a higher version code as ARM32
914
ecmVersionCode = (int)(new Date().getTime()/1000)
1015
if (System.getenv('CI_PIPELINE_CREATED_AT')) {
1116
ecmVersionCode = (int)(Date.from(Instant.parse(System.getenv('CI_PIPELINE_CREATED_AT'))).getTime()/1000)
17+
if (System.getenv('KDECI_CRAFT_PLATFORM')) {
18+
if (System.getenv('KDECI_CRAFT_PLATFORM').contains('x86_64')) {
19+
ecmVersionCode = ecmVersionCode + 1
20+
} else if (System.getenv('KDECI_CRAFT_PLATFORM').contains('arm64')) {
21+
ecmVersionCode = ecmVersionCode + 2
22+
}
23+
}
1224
}
1325
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy