ohos: Allow passing arguments to servoshell (#33588)

* ohos: Bump minimum CMake version

By bumping the minimum CMake version, we avoid a deprecation warning.
The OH 4.0 SDK ships with CMake 3.16, so we can be sure that we have CMake 3.16
or newer available.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: Allow passing arguments to servoshell

Allows passing options passed via `wants` to the Ability through to servoshell.
This allows easier debugging, either by calling servoshell from a test app,
or from the commandline, e.g.
```
hdc shell aa start -a EntryAbility -b org.servo.servoshell -U "https://www.wikipedia.org" \
 --pb dom.webgpu.enabled true \
 --ps dom.webgpu.wgpu_backend "gl" \
 --pi layout.threads 4
```

Note: While the OH `wants` API differentiates between boolean, string and integer values, we convert
everything back to strings, so we can reuse the same parsing code as the desktop servoshell.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
Jonathan Schwender 2024-10-02 06:27:18 +02:00 committed by GitHub
parent d7da0563d3
commit e534c7d461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 90 additions and 6 deletions

View file

@ -51,6 +51,7 @@ pub struct InitOpts {
/// Path to application data bundled with the servo app, e.g. web-pages.
pub resource_dir: String,
pub display_density: f64,
pub commandline_args: String,
}
#[derive(Debug)]