From 19348631ab0449762a70d4aef760cc14603ddb1d Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Thu, 9 Jul 2026 22:21:48 +0000 Subject: [PATCH] [Chore] (android-plugin): calendar versioning 26.07 with commit-hash build id versionCode = major * 100 + minor (2607); versionName = 26.07. (e.g. 26.07.4e558ee, -trace suffixed for trace flavors), replacing the placeholder versionCode 1 / versionName 'dev'. Co-Authored-By: Claude Fable 5 --- android-plugin/app/build.gradle | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/android-plugin/app/build.gradle b/android-plugin/app/build.gradle index 47aad93d..28547d80 100644 --- a/android-plugin/app/build.gradle +++ b/android-plugin/app/build.gradle @@ -32,6 +32,21 @@ def mobileGlAbiFilters = { .findAll { !it.isEmpty() } } +// Calendar versioning: major = two-digit year, minor = month. The build +// identifier is the short commit hash, giving version names like 26.07.4e558ee. +def mobileGlVersionMajor = 26 +def mobileGlVersionMinor = 7 +def mobileGlGitShortHash = { + try { + def proc = ['git', 'rev-parse', '--short=7', 'HEAD'].execute(null, rootDir) + proc.waitFor() + def hash = proc.in.text.trim() + (proc.exitValue() == 0 && hash) ? hash : 'nogit' + } catch (Exception ignored) { + 'nogit' + } +}() + android { namespace 'top.mobilegl.plugin' compileSdk 34 @@ -40,8 +55,8 @@ android { defaultConfig { minSdk 26 targetSdk 34 - versionCode 1 - versionName 'dev' + versionCode mobileGlVersionMajor * 100 + mobileGlVersionMinor + versionName String.format('%d.%02d.%s', mobileGlVersionMajor, mobileGlVersionMinor, mobileGlGitShortHash) ndk { def abiFiltersOverride = mobileGlAbiFilters()