From 23c1eb81dcd9623eb8b87379f22dfd54acbd5359 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Beno=C3=AEt=20Harrault?= <benoit@harrault.fr>
Date: Wed, 16 Oct 2024 09:49:00 +0200
Subject: [PATCH] Fix build process

---
 android/app/build.gradle |  6 +++---
 pubspec.yaml             |  2 +-
 test.sh                  | 12 ------------
 3 files changed, 4 insertions(+), 16 deletions(-)
 delete mode 100755 test.sh

diff --git a/android/app/build.gradle b/android/app/build.gradle
index 57e585a..8a419ab 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -66,10 +66,10 @@ import com.android.build.OutputFile
 
 android.applicationVariants.all { variant ->
   variant.outputs.each { output ->
-    def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
+    def perAbiVersionCodeIncrement = project.ext.abiCodes.get(output.getFilter(OutputFile.ABI))
 
-    if (baseAbiVersionCode != null) {
-      output.versionCodeOverride = baseAbiVersionCode * 1000 + variant.versionCode
+    if (perAbiVersionCodeIncrement != null) {
+      output.versionCodeOverride = variant.versionCode * 1000 + perAbiVersionCodeIncrement
     }
   }
 }
diff --git a/pubspec.yaml b/pubspec.yaml
index df35c73..0469327 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -3,7 +3,7 @@ description: A random application, for testing purpose only.
 
 publish_to: "none"
 
-version: 1.0.61+62
+version: 1.0.62+63
 
 environment:
   sdk: "^3.0.0"
diff --git a/test.sh b/test.sh
deleted file mode 100755
index 5bfee41..0000000
--- a/test.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash -i
-
-BASE_APK_FOLDER="build/app/outputs/flutter-apk"
-VERSION_NAME="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f1)"
-VERSION_CODE="$(grep '^version:' pubspec.yaml | cut -d' ' -f2 | cut -d'+' -f2)"
-APP_NAME="$(grep 'namespace' android/app/build.gradle | cut -d'"' -f2)"
-
-if [ "$(find "${BASE_APK_FOLDER}" -name "*.apk")" != "" ]; then
-    for APK in ${BASE_APK_FOLDER}/*.apk; do
-        mv -v "${APK}" "$(echo "${APK}" | sed "s|\.apk|_${VERSION_CODE}.apk|" | sed "s|/app-|/${APP_NAME}-|")"
-    done
-fi
-- 
GitLab