Add x11 backend runner support (#22)
This commit is contained in:
@@ -11,9 +11,9 @@ $ sudo mv flutter-elinux /opt/
|
|||||||
$ export PATH=$PATH:/opt/flutter-elinux/bin
|
$ export PATH=$PATH:/opt/flutter-elinux/bin
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install dependent libraries
|
### Install other tools
|
||||||
```Shell
|
```Shell
|
||||||
$ sudo apt install curl
|
$ sudo apt install curl clang cmake pkg-config
|
||||||
# If you want to use Weston as a Wayland compositor:
|
# If you want to use Weston as a Wayland compositor:
|
||||||
$ sudo apt install weston
|
$ sudo apt install weston
|
||||||
```
|
```
|
||||||
@@ -21,11 +21,29 @@ $ sudo apt install weston
|
|||||||
### How to run flutter sample app in 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.
|
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
|
```Shell
|
||||||
$ flutter-elinux create sample
|
$ flutter-elinux create sample
|
||||||
$ cd sample
|
$ cd sample
|
||||||
$ weston &
|
$ 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
|
## Documentation
|
||||||
|
|||||||
@@ -13,14 +13,7 @@ import '../elinux_plugins.dart';
|
|||||||
|
|
||||||
class ELinuxRunCommand extends RunCommand with ELinuxExtension {
|
class ELinuxRunCommand extends RunCommand with ELinuxExtension {
|
||||||
ELinuxRunCommand({bool verboseHelp = false})
|
ELinuxRunCommand({bool verboseHelp = false})
|
||||||
: super(verboseHelp: verboseHelp) {
|
: 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.',
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
|
Future<Set<DevelopmentArtifact>> get requiredArtifacts async =>
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class ELinuxDeviceDiscovery extends PollingDeviceDiscovery {
|
|||||||
|
|
||||||
// Adds current desktop host.
|
// Adds current desktop host.
|
||||||
devices.add(
|
devices.add(
|
||||||
ELinuxDevice('elinux',
|
ELinuxDevice('elinux-wayland',
|
||||||
desktop: true,
|
desktop: true,
|
||||||
targetArch: _getCurrentHostPlatformArchName(),
|
targetArch: _getCurrentHostPlatformArchName(),
|
||||||
backendType: 'wayland',
|
backendType: 'wayland',
|
||||||
@@ -134,6 +134,20 @@ class ELinuxDeviceDiscovery extends PollingDeviceDiscovery {
|
|||||||
processManager: const LocalProcessManager(),
|
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.
|
// Adds remote devices.
|
||||||
for (final ELinuxRemoteDeviceConfig remoteDevice
|
for (final ELinuxRemoteDeviceConfig remoteDevice
|
||||||
|
|||||||
Reference in New Issue
Block a user