gen_snapshot: fix Platform.operatingSystem issue (#213)

This change fixes an issue that `Platform.operatingSystem` returns Android on x64 hosts and when cross-building for arm64 targets on x64 hosts. To fix the issue, use the gen_snapshot of linux and elinux instead of Android's one.

Fixed https://github.com/sony/flutter-elinux/issues/212

Signed-off-by: Hidenori Matsubayashi <[email protected]>
This commit is contained in:
Hidenori Matsubayashi
2023-08-29 12:07:51 +00:00
committed by GitHub
parent fa64bab806
commit d2ae0ffdb9
4 changed files with 18 additions and 34 deletions
+3 -4
View File
@@ -88,12 +88,11 @@ class BuildPackageCommand extends BuildSubCommand
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
<DevelopmentArtifact>{
// Use gensnapshot for Arm64 Linux when the host is arm64 because
// the artifacts for arm64 host don't support self-building now.
// Use gen_snapshot of the arm64 linux-desktop when self-building
// on arm64 hosts. This is because elinux's artifacts for arm64
// doesn't support self-build as of now.
if (_getCurrentHostPlatformArchName() == 'arm64')
DevelopmentArtifact.linux,
if (_getCurrentHostPlatformArchName() == 'x64')
DevelopmentArtifact.androidGenSnapshot,
ELinuxDevelopmentArtifact.elinux,
};
+3 -4
View File
@@ -18,12 +18,11 @@ class ELinuxRunCommand extends RunCommand
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
<DevelopmentArtifact>{
// Use gensnapshot for Arm64 Linux when the host is arm64 because
// the artifacts for arm64 host don't support self-building now.
// Use gen_snapshot of the arm64 linux-desktop when self-building
// on arm64 hosts. This is because elinux's artifacts for arm64
// doesn't support self-build as of now.
if (_getCurrentHostPlatformArchName() == 'arm64')
DevelopmentArtifact.linux,
if (_getCurrentHostPlatformArchName() == 'x64')
DevelopmentArtifact.androidGenSnapshot,
ELinuxDevelopmentArtifact.elinux,
};