Add x11 backend runner support (#22)

This commit is contained in:
Hidenori Matsubayashi
2021-07-27 14:48:40 +09:00
committed by GitHub
parent 0a3ef762f5
commit d2a2a44002
3 changed files with 37 additions and 12 deletions
+21 -3
View File
@@ -11,9 +11,9 @@ $ sudo mv flutter-elinux /opt/
$ export PATH=$PATH:/opt/flutter-elinux/bin
```
### Install dependent libraries
### Install other tools
```Shell
$ sudo apt install curl
$ sudo apt install curl clang cmake pkg-config
# If you want to use Weston as a Wayland compositor:
$ sudo apt install weston
```
@@ -21,11 +21,29 @@ $ sudo apt install weston
### How to run flutter sample app in Weston
You need to install a Wayland compositor such as Weston and launch it before launching your Flutter apps.
```Shell
$ flutter-elinux devices
3 connected devices:
eLinux (desktop) • elinux-wayland • flutter-tester • Ubuntu 20.04.2 LTS 5.8.0-63-generic
eLinux (desktop) • elinux-x11 • flutter-tester • Ubuntu 20.04.2 LTS 5.8.0-63-generic
```
```Shell
$ flutter-elinux create sample
$ cd sample
$ weston &
$ flutter-elinux run -d elinux
$ flutter-elinux run -d elinux-wayland
```
If you want to run your flutter app in X11, use `elinux-x11` instead of `elinux-wayland`:
```Shell
$ flutter-elinux run -d elinux-x11
```
### How to run flutter sample app in X11
```Shell
```
## Documentation
+1 -8
View File
@@ -13,14 +13,7 @@ import '../elinux_plugins.dart';
class ELinuxRunCommand extends RunCommand with ELinuxExtension {
ELinuxRunCommand({bool verboseHelp = false})
: super(verboseHelp: verboseHelp) {
argParser.addOption(
'target-backend-type',
defaultsTo: 'wayland',
allowed: <String>['wayland', 'gbm', 'eglstream', 'x11'],
help: 'Target backend type that the app will run on devices.',
);
}
: super(verboseHelp: verboseHelp);
@override
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
+15 -1
View File
@@ -121,7 +121,7 @@ class ELinuxDeviceDiscovery extends PollingDeviceDiscovery {
// Adds current desktop host.
devices.add(
ELinuxDevice('elinux',
ELinuxDevice('elinux-wayland',
desktop: true,
targetArch: _getCurrentHostPlatformArchName(),
backendType: 'wayland',
@@ -134,6 +134,20 @@ class ELinuxDeviceDiscovery extends PollingDeviceDiscovery {
processManager: const LocalProcessManager(),
)),
);
devices.add(
ELinuxDevice('elinux-x11',
desktop: true,
targetArch: _getCurrentHostPlatformArchName(),
backendType: 'x11',
logger: _logger ?? globals.logger,
processManager: _processManager ?? globals.processManager,
operatingSystemUtils: OperatingSystemUtils(
fileSystem: globals.fs,
logger: _logger ?? globals.logger,
platform: globals.platform,
processManager: const LocalProcessManager(),
)),
);
// Adds remote devices.
for (final ELinuxRemoteDeviceConfig remoteDevice