emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-30 121371a7064 2/2: Move java/incrementing-version-code to Android


From: Po Lu
Subject: emacs-30 121371a7064 2/2: Move java/incrementing-version-code to AndroidManifest.xml.in
Date: Wed, 5 Mar 2025 01:59:41 -0500 (EST)

branch: emacs-30
commit 121371a706491fde8c06d95b13c16703d53f6fa3
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>

    Move java/incrementing-version-code to AndroidManifest.xml.in
    
    * admin/admin.el (admin-android-version-code-regexp): New
    variable.
    (set-version): Modify AndroidManifest.xml.in instead.
    
    * java/AndroidManifest.xml.in (Version-code): Define version
    code.
    
    * java/incrementing-version-code: Delete file.
---
 admin/admin.el                 | 10 ++++++----
 java/AndroidManifest.xml.in    | 15 +++++++++++++++
 java/incrementing-version-code | 12 ------------
 3 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/admin/admin.el b/admin/admin.el
index 12891bc8c48..0f02ac8d9b1 100644
--- a/admin/admin.el
+++ b/admin/admin.el
@@ -98,6 +98,10 @@ Optional argument DATE is the release date, default today."
 (defvar admin-git-command (executable-find "git")
   "The `git' program to use.")
 
+(defvar admin-android-version-code-regexp
+  "\\bAuto-incrementing version code\\(?:.\\|\n\\)*\\([[:digit:]]\\{9\\}\\)$"
+  "Regexp with which to detect the version code in AndroidManifest.xml.")
+
 (defun set-version (root version)
   "Set Emacs version to VERSION in relevant files under ROOT.
 Root must be the root of an Emacs source tree."
@@ -122,13 +126,11 @@ Root must be the root of an Emacs source tree."
                       (rx (and "AC_INIT" (1+ (not (in ?,)))
                                 ?, (0+ space) ?\[
                                 (submatch (1+ (in "0-9."))))))
-  (set-version-in-file root "java/incrementing-version-code"
+  (set-version-in-file root "java/AndroidManifest.xml.in"
                        (apply #'format "%02d%02d%02d000"
                               (mapcar #'string-to-number
                                       (split-string version "\\.")))
-                       (rx (and line-start
-                                (submatch (1+ (in digit)))
-                                line-end)))
+                       admin-android-version-code-regexp)
   (set-version-in-file root "nt/README.W32" version
                       (rx (and "version" (1+ space)
                                (submatch (1+ (in "0-9."))))))
diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in
index 6243c5e13ba..92b63925ef4 100644
--- a/java/AndroidManifest.xml.in
+++ b/java/AndroidManifest.xml.in
@@ -338,3 +338,18 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>. -->
             android:label="GNU Emacs service"/>
   </application>
 </manifest>
+
+<!-- Auto-incrementing version code.
+
+This comment contains an Android version code
+(https://developer.android.com/studio/publish/versioning#versioningsettings)
+corresponding to the current Emacs version.  The version code in
+AndroidManifest.xml.in is hard-coded to a fixed value to facilitate
+package downgrades.  Some automated systems employed by Android package
+repositories require an incrementing numeric version code to detect
+upgrades, which is provided here and is altered by admin/admin.el.
+Refer to e.g. https://forum.f-droid.org/t/emacs-packaging/30424/25.
+
+Version-code: 300050000
+
+-->
diff --git a/java/incrementing-version-code b/java/incrementing-version-code
index fed5b627275..e69de29bb2d 100644
--- a/java/incrementing-version-code
+++ b/java/incrementing-version-code
@@ -1,12 +0,0 @@
-; This file contains an Android version code
-; (https://developer.android.com/studio/publish/versioning#versioningsettings)
-; corresponding to the current Emacs version.
-;
-; The version code in AndroidManifest.xml.in is hard-coded to a fixed
-; value, to make package downgrades possible.  Where an incrementing
-; version code is required (for example, for automated F-Droid package
-; builds (https://f-droid.org/packages/org.gnu.emacs/)), the version
-; code in this file should be referred to and patched in to
-; AndroidManifest.xml.
-
-300093000



reply via email to

[Prev in Thread] Current Thread [Next in Thread]