Flutter target preset
The Nx targets every Flutter app under apps/ gets from the mobile-app generator, and what each one runs.
Every Flutter app under apps/ gets the same Nx targets from nx-plugin:mobile-app. Targets that wrap a Flutter CLI call
run the CLI directly; targets with logic call one script in scripts/flutter/, so the logic lives in one place and each
target stays a one-line call.
Always
| Target | Runs | Notes |
|---|---|---|
pub-get | flutter pub get | Input: pubspec.yaml |
analyze | flutter analyze | Must be clean |
format | dart format lib test | Writes |
format-check | dart format --set-exit-if-changed lib test | CI form of format |
test | flutter test | |
run | flutter run | Continuous; needs a device or simulator |
refresh | flutter clean && flutter pub get | Use after native or plugin changes |
build-check | scripts/flutter/build-check.mjs | Debug build of every platform the app has |
run-all | scripts/flutter/run-all.mjs | Debug build on every connected phone and this Mac |
build-release | scripts/flutter/build-release.mjs | Release build on every connected device and this Mac |
bundle | scripts/flutter/build-bundles.mjs | Store artifacts: .aab, .ipa, Mac .pkg |
rename-app | scripts/flutter/rename-app.mjs --name "<Name>" | Display name on every platform folder the app has |
Fonts from google_fonts: node scripts/flutter/bundle-fonts.mjs scan|fetch|verify [app] (not a target; driven by the flutter-bundle-google-fonts skill).
analyze, test, run and the builds depend on pub-get and design-tokens:generate.
Per platform
Chosen with --platforms (default ios,android). A target exists only when its platform does.
| Target | Platform | Runs |
|---|---|---|
build-apk | android | flutter build apk |
build-ios | ios | flutter build ios |
build-macos | macos | flutter build macos |
build-web | web | flutter build web |
Opt-in
| Target | Flag | Runs | Needs |
|---|---|---|---|
sync-api | --syncApi | scripts/flutter/sync-api-schema.mjs | A running backend; swagger_parser in the app |
codegen | --codegen | scripts/flutter/codegen.mjs | build_runner in the app |
Generator flags
pnpm nx g @gentlemans-stack/nx-plugin:mobile-app <name> --platforms=ios,android,web,macos --syncApi --codegen--platforms also passes to flutter create, so the platform folders match the targets.
Existing apps
The three existing apps run the same .mjs scripts as the stack. Each keeps its own DEFAULT_APP in scripts/flutter/lib/app.mjs. The copies are manual until the Phase 5 sync.
wemove-mobileandmqtizermqtt_client:generate-assetsruns the same script as the stack.desk_mate:generate-assetsadded (it has both YAML configs).desk_mate(Nx namedesk-mate): has nocodegen(no build_runner).bundleis present, but it signs the Android build with the debug key untilandroid/key.propertiesexists, so Play rejects the upload. The script warns about this.
Assets and store images
Every generated app has these three targets (no flag), each a one-line call to a script that takes --dry-run:
| Target | Script | Runs | Needs |
|---|---|---|---|
generate-assets | scripts/flutter/generate-assets.mjs | flutter_launcher_icons and flutter_native_splash | The two YAML files (generated, same shape as the flutter-brand-icons skill writes) and assets/icon/light.png |
capture | scripts/flutter/capture.mjs | image-gen-tools:capture (flutter drive on integration_test/capture_test.dart) | apps/<app>/image-gen.config.json; booted simulators or this Mac |
store-assets | scripts/flutter/store-assets.mjs | image-gen-tools:store (cards, feature graphic, listing icons into dist/<app>/store/) | The config and the captures |
generate-assets skips a step whose YAML is missing and exits 0, so an app without icons yet is not an error. It
overwrites committed platform files, so run it when the artwork changes, not on every build. The generator also writes
the capture harness (integration_test/capture_test.dart, test_driver/integration_test.dart, an empty
integration_test/capture_actions.dart) and adds flutter_launcher_icons, flutter_native_splash and
integration_test to the dev dependencies. Colors in the YAML are placeholders; the flutter-brand-icons skill
regenerates both files and the PNGs from the logo and the theme.
Why a script, not a shell line
A target becomes a script when it does more than one thing or needs to read the app (its bundle id, which platforms it
has). Scripts take --dry-run, which prints the commands without running them.