meta-flutter / workspace-automation

Work aids for developing with Embedded Flutter on Linux
Apache License 2.0
6 stars 5 forks source link
automation-framework elinux flutter linux vscode

Flutter Workspace Automation

Workspace Automation that supports embedded Flutter development

We developed a Python script, flutter_workspace.py to automate embedded flutter setup. This script reads a configuration folder of JSON files, or a single JSON configuration file and sets up a Flutter Workspace.

Discord Server https://discord.gg/VKcpSHgjGQ

create_aot.py

create AOT is used to create libapp.so for use on a device.

Example use:

./create_aot --path <path that holds a pubspec.yaml>

Expects to be run from an active FLUTTER_WORKSPACE. Meaning you need to source you environment first.

create_recipes.py

creates a Yocto recipe for every pubspec.yaml found in a path folder. It will recursively iterate all subfolders.

Example use:

./create_recipes.py --path app/packages/ --license LICENSE --license_type BSD3-Clause --author "Google" --out ./tmp

Environmental variables used by script:

roll_meta_flutter.py

Updates all Flutter App recipes in meta-flutter using json as data source. The default data source is configs/flutter-apps.json

Example use

./roll_meta_flutter.py --path `pwd`/tmp

Default pubspec.yaml filter tokens

_android/pubspec.yaml
_ios/pubspec.yaml
_linux/pubspec.yaml
_macos/pubspec.yaml
_platform_interface/pubspec.yaml
_web/pubspec.yaml
_windows/pubspec.yaml

Default recipe filename filter tokens

-apple_
-avfoundation_
-darwin_
-linux_
-web_

_Note: Exclude filters are added to json as "exclude" string array. The value to populate exclude filter is the FLUTTER_APPLICATION_PATH value. An empty string is valid._

flutter_workspace.py

flutter_workspace.py does the following tasks automatically for you

Flutter Workspace

A Flutter workspace contains

JSON Configuration

flutter_workspace_config.json contains the following components

Installation

git clone https://github.com/meta-flutter/workspace_automation.git
./flutter_workspace.py

Options

--clean

Wipes workspace before creating

--config=

Pass configuration folder path.

--flutter-version=x.x.x

Override config/_globals.json key "flutter_version"

--fetch-engine

Fetch libflutter_engine.so and update bundle cache

--version-files=

Pass folder for storing dart and engine json files.

--plex="..."

Platform Load Exceptions. Pass platform-id values. Space is delimiter

--stdin-file

Use for debugging

Run flutter app with desktop-auto

Run flutter app with QEMU

Create hello_world flutter example

Visual Studio Code

Launching on Ubuntu

    cd <your flutter workspace>
    source ./setup_env.sh
    code .

Debugging with VS Code

flutter_workspace.py creates a .vscode/launch.json file if one is not present. It uses the repo json key pubspec_path. If this key is present in the repo json, then it will add entry to .vscode/launch.json.