Skip to content

Commit

Permalink
chore: support --target android-armv8 to build armv8-only apk
Browse files Browse the repository at this point in the history
  • Loading branch information
w568w committed Jan 10, 2025
1 parent 9a7288b commit c28808b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions build_release.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ String dartExecutable = 'dart';
void main(List<String> arguments) async {
var parser = ArgParser()
..addOption("target",
allowed: ['android', 'windows', 'aab', 'linux'],
allowed: ['android', 'android-armv8', 'windows', 'aab', 'linux'],
help: "The target to build for.",
mandatory: true)
..addOption("versionCode",
Expand Down Expand Up @@ -83,6 +83,9 @@ void main(List<String> arguments) async {
case 'android':
await buildAndroid(versionCode, gitHash);
break;
case 'android-armv8':
await buildAndroid(versionCode, gitHash, target: 'android-arm64');
break;
case 'windows':
await buildWindows(versionCode, gitHash);
break;
Expand Down Expand Up @@ -111,13 +114,14 @@ Future<int> runDartProcess(List<String> args) async {
return await buildProcess.exitCode;
}

Future<void> buildAndroid(String? versionCode, String gitHash) async {
Future<void> buildAndroid(String? versionCode, String gitHash, {String? target}) async {
print('Build for Android...');
await runFlutterProcess([
'build',
'apk',
'--release',
'--dart-define=GIT_HASH=$gitHash',
if (target != null) '--target-platform=$target',
]);

print('Clean old files...');
Expand Down

0 comments on commit c28808b

Please sign in to comment.