Skip to content

Commit 3b7cc8e

Browse files
committed
Set version code and build number in gradle build
Closes #12
1 parent 0a9537d commit 3b7cc8e

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

android/app/build.gradle.kts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,18 @@ android {
6262
}
6363
}
6464

65+
val abiCodes = mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86_64" to 3)
66+
android.applicationVariants.configureEach {
67+
val variant = this
68+
variant.outputs.forEach { output ->
69+
val abiVersionCode = abiCodes[output.filters.find { it.filterType == "ABI" }?.identifier]
70+
if (abiVersionCode != null) {
71+
(output as com.android.build.gradle.internal.api.ApkVariantOutputImpl).versionCodeOverride = variant.versionCode * 10 + abiVersionCode
72+
}
73+
}
74+
}
75+
76+
6577
flutter {
6678
source = "../.."
6779
}

pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ packages:
199199
dependency: transitive
200200
description:
201201
name: meta
202-
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
202+
sha256: "23f08335362185a5ea2ad3a4e597f1375e78bce8a040df5c600c8d3552ef2394"
203203
url: "https://pub.dev"
204204
source: hosted
205-
version: "1.16.0"
205+
version: "1.17.0"
206206
path:
207207
dependency: transitive
208208
description:
@@ -276,10 +276,10 @@ packages:
276276
dependency: transitive
277277
description:
278278
name: test_api
279-
sha256: "522f00f556e73044315fa4585ec3270f1808a4b186c936e612cab0b565ff1e00"
279+
sha256: ab2726c1a94d3176a45960b6234466ec367179b87dd74f1611adb1f3b5fb9d55
280280
url: "https://pub.dev"
281281
source: hosted
282-
version: "0.7.6"
282+
version: "0.7.7"
283283
typed_data:
284284
dependency: transitive
285285
description:

0 commit comments

Comments
 (0)