chore: enable Flutter Android workflow on aarch64 (#113829)

- removes invalid arch check on Android workflow in order to enable Android development on any device supported

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
The one with the braid (she/her) | Dфҿ mit dem Zopf (sie/ihr) 2022-11-10 23:09:28 +01:00 committed by GitHub
parent c1ceda41ef
commit 2e432ec16b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 33 deletions

View File

@ -44,19 +44,14 @@ class AndroidWorkflow implements Workflow {
AndroidWorkflow({
required AndroidSdk? androidSdk,
required FeatureFlags featureFlags,
required OperatingSystemUtils operatingSystemUtils,
}) : _androidSdk = androidSdk,
_featureFlags = featureFlags,
_operatingSystemUtils = operatingSystemUtils;
_featureFlags = featureFlags;
final AndroidSdk? _androidSdk;
final FeatureFlags _featureFlags;
final OperatingSystemUtils _operatingSystemUtils;
@override
bool get appliesToHostPlatform => _featureFlags.isAndroidEnabled
// Android Studio is not currently supported on Linux Arm64 Hosts.
&& _operatingSystemUtils.hostPlatform != HostPlatform.linux_arm64;
bool get appliesToHostPlatform => _featureFlags.isAndroidEnabled;
@override
bool get canListDevices => appliesToHostPlatform && _androidSdk != null

View File

@ -120,7 +120,6 @@ Future<T> runInContext<T>(
AndroidWorkflow: () => AndroidWorkflow(
androidSdk: globals.androidSdk,
featureFlags: featureFlags,
operatingSystemUtils: globals.os,
),
ApplicationPackageFactory: () => FlutterApplicationPackageFactory(
userMessages: globals.userMessages,

View File

@ -23,7 +23,6 @@ void main() {
androidWorkflow = AndroidWorkflow(
androidSdk: FakeAndroidSdk(),
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
);
});
@ -34,7 +33,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: FakeAndroidSdk(null),
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
processManager: FakeProcessManager.empty(),
fileSystem: MemoryFileSystem.test(),
@ -55,7 +53,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: FakeAndroidSdk(),
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
processManager: fakeProcessManager,
fileSystem: MemoryFileSystem.test(),
@ -74,7 +71,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: FakeAndroidSdk(null),
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
processManager: FakeProcessManager.empty(),
fileSystem: MemoryFileSystem.test(),
@ -116,7 +112,6 @@ void main() {
featureFlags: TestFeatureFlags(
isAndroidEnabled: false,
),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
processManager: FakeProcessManager.any(),
fileSystem: MemoryFileSystem.test(),

View File

@ -39,7 +39,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: null,
operatingSystemUtils: FakeOperatingSystemUtils(),
);
expect(androidWorkflow.canLaunchDevices, false);
@ -53,7 +52,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
);
expect(androidWorkflow.canLaunchDevices, false);
@ -61,20 +59,19 @@ void main() {
expect(androidWorkflow.canListEmulators, false);
});
// Android Studio is not currently supported on Linux Arm64 hosts.
testWithoutContext('Not supported AndroidStudio on Linux Arm Hosts', () {
// Android SDK is actually supported on Linux Arm64 hosts.
testWithoutContext('Support for Android SDK on Linux Arm Hosts', () {
final FakeAndroidSdk androidSdk = FakeAndroidSdk();
androidSdk.adbPath = null;
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
operatingSystemUtils: CustomFakeOperatingSystemUtils(hostPlatform: HostPlatform.linux_arm64),
);
expect(androidWorkflow.appliesToHostPlatform, false);
expect(androidWorkflow.canLaunchDevices, false);
expect(androidWorkflow.canListDevices, false);
expect(androidWorkflow.canListEmulators, false);
expect(androidWorkflow.appliesToHostPlatform, isTrue);
expect(androidWorkflow.canLaunchDevices, isFalse);
expect(androidWorkflow.canListDevices, isFalse);
expect(androidWorkflow.canListEmulators, isFalse);
});
testWithoutContext('AndroidWorkflow is disabled if feature is disabled', () {
@ -83,7 +80,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(isAndroidEnabled: false),
androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
);
expect(androidWorkflow.appliesToHostPlatform, false);
@ -98,7 +94,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
);
expect(androidWorkflow.appliesToHostPlatform, true);
@ -114,7 +109,6 @@ void main() {
final AndroidWorkflow androidWorkflow = AndroidWorkflow(
featureFlags: TestFeatureFlags(),
androidSdk: androidSdk,
operatingSystemUtils: FakeOperatingSystemUtils(),
);
expect(androidWorkflow.appliesToHostPlatform, true);

View File

@ -79,7 +79,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
@ -101,7 +100,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
@ -116,7 +114,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
fileSystem: fileSystem,
);
@ -144,7 +141,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
final CreateEmulatorResult result = await emulatorManager.createEmulator();
@ -186,7 +182,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
final CreateEmulatorResult result = await emulatorManager.createEmulator();
@ -223,7 +218,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
final CreateEmulatorResult result = await emulatorManager.createEmulator(name: 'test');
@ -262,7 +256,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
final CreateEmulatorResult result = await emulatorManager.createEmulator(name: 'existing-avd-1');
@ -304,7 +297,6 @@ void main() {
androidWorkflow: AndroidWorkflow(
androidSdk: sdk,
featureFlags: TestFeatureFlags(),
operatingSystemUtils: FakeOperatingSystemUtils(),
),
);
final CreateEmulatorResult result = await emulatorManager.createEmulator();