Add arm64 Linux host support (#29)

Fixed https://github.com/sony/flutter-elinux/issues/2
This commit is contained in:
Hidenori Matsubayashi
2021-07-29 09:57:05 +09:00
committed by GitHub
parent 7c7e4eb542
commit ca037ac2d7
3 changed files with 36 additions and 2 deletions
+6 -1
View File
@@ -67,7 +67,12 @@ class BuildPackageCommand extends BuildSubCommand with ELinuxExtension {
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
<DevelopmentArtifact>{
DevelopmentArtifact.androidGenSnapshot,
// Use gensnapshot for Arm64 Linux when the host is arm64 because
// the artifacts for arm64 host don't support self-building now.
if (_getCurrentHostPlatformArchName() == 'arm64')
DevelopmentArtifact.linux,
if (_getCurrentHostPlatformArchName() == 'x64')
DevelopmentArtifact.androidGenSnapshot,
ELinuxDevelopmentArtifact.elinux,
};
+13 -1
View File
@@ -5,6 +5,8 @@
// @dart = 2.8
import 'package:flutter_tools/src/base/os.dart';
import 'package:flutter_tools/src/build_info.dart';
import 'package:flutter_tools/src/cache.dart';
import 'package:flutter_tools/src/commands/run.dart';
@@ -18,7 +20,17 @@ class ELinuxRunCommand extends RunCommand with ELinuxExtension {
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
<DevelopmentArtifact>{
DevelopmentArtifact.androidGenSnapshot,
// Use gensnapshot for Arm64 Linux when the host is arm64 because
// the artifacts for arm64 host don't support self-building now.
if (_getCurrentHostPlatformArchName() == 'arm64')
DevelopmentArtifact.linux,
if (_getCurrentHostPlatformArchName() == 'x64')
DevelopmentArtifact.androidGenSnapshot,
ELinuxDevelopmentArtifact.elinux,
};
String _getCurrentHostPlatformArchName() {
final HostPlatform hostPlatform = getCurrentHostPlatform();
return getNameForHostPlatformArch(hostPlatform);
}
}