Igniter-aware feature handlers for mix mob.enable.
One function per <feature> returning igniter -> igniter. Phase 4 of
the build-system migration moves each handler off the legacy
string-mutation path (where each helper writes files immediately) and
onto Igniter's update_file / create_new_file flow (where every
change rolls into a single dry-run-able diff before any file is
written).
Per-feature state:
| Feature | Igniter-routed (iter 1) | Elixir AST-aware |
|---|---|---|
| camera | yes | (no Elixir surface) |
| photo_library | yes | (no Elixir surface) |
| location | yes | (no Elixir surface) |
| file_sharing | yes | (no Elixir surface) |
| notifications | yes | (no Elixir surface) |
| liveview | yes | mob_screen.ex via create_module (iter 1) |
| python | yes | dep via add_dep (iter 2); paths module via create_module (iter 1) |
iter 1 wrapped every feature in Igniter so the diff preview + atomic
apply flow applies uniformly. iter 2 swapped python's mix.exs
dep-injection from MobDev.Enable.inject_pythonx_dep (regex) to
Igniter.Project.Deps.add_dep (AST). The remaining text-level
patches (assets/js/app.js, root.html.heex) are non-Elixir source
and stay text-level — AST tooling for those isn't a win.
All handlers are called with the project root as cwd (Igniter expects
paths relative to cwd). The app_name arg is the project's :app
Mix config (a string like "my_app") for any feature that needs to
template it into generated source.
Summary
Functions
Adds an Android <uses-permission> line to AndroidManifest.xml.
Adds an iOS Info.plist <key>...<string>... pair if not already present.
Enables MLX + EMLX (Apple's MLX numerics + the EMLX Nx backend) for
iOS. Adds :nx and :emlx to deps; generates a tiny
<App>.MLInit helper that picks EMLX.Backend at boot with a clean
fallback to Nx.BinaryBackend if the NIF can't load.
Enables the NxEigen Nx backend (Eigen-backed C++ NIF) on both iOS and
Android. mob_dev cross-compiles libnx_eigen.a per arch from the
:nx_eigen Hex dep + the Eigen header tarball it auto-downloads.
Enables the TensorFlow Lite NIF (:nx_tflite_mob) on both iOS and
Android. Adds the dep, generates a small <App>.TfliteInit helper that
surfaces per-platform default opts (NNAPI accelerator on Android, Core
ML delegate on iOS), and registers the static-NIF guard via the
build pipeline.
Functions
Adds an Android <uses-permission> line to AndroidManifest.xml.
No-op (with a notice) when no AndroidManifest.xml is found. Idempotent on the permission name — re-running with the same permission skips the patch silently.
Adds an iOS Info.plist <key>...<string>... pair if not already present.
No-op (with a notice) when no Info.plist is found under ios/. The
insertion is idempotent — runs that find the key already present skip
the patch silently.
Enables MLX + EMLX (Apple's MLX numerics + the EMLX Nx backend) for
iOS. Adds :nx and :emlx to deps; generates a tiny
<App>.MLInit helper that picks EMLX.Backend at boot with a clean
fallback to Nx.BinaryBackend if the NIF can't load.
The :emlx_nif static NIF entry is already in MobDev.StaticNifs
defaults — MobDev.NativeBuild auto-detects the :emlx dep, downloads
the cross-compiled MLX bundle, and sets MOB_STATIC_EMLX_NIF so the
driver_tab + linker include EMLX. So mob.enable mlx is mostly about
the dep wiring and the helper module.
Enables the NxEigen Nx backend (Eigen-backed C++ NIF) on both iOS and
Android. mob_dev cross-compiles libnx_eigen.a per arch from the
:nx_eigen Hex dep + the Eigen header tarball it auto-downloads.
The :nx_eigen static-NIF entry is already in
MobDev.StaticNifs defaults — MobDev.NativeBuild auto-detects the
:nx_eigen dep and sets MOB_STATIC_NX_EIGEN_NIF so the driver_tab
- linker include it.
mob.enable nxeigendoes the dep wiring + the helper module.
Enables the TensorFlow Lite NIF (:nx_tflite_mob) on both iOS and
Android. Adds the dep, generates a small <App>.TfliteInit helper that
surfaces per-platform default opts (NNAPI accelerator on Android, Core
ML delegate on iOS), and registers the static-NIF guard via the
build pipeline.
Unlike mlx / nxeigen, this is not an Nx backend — NxTfliteMob
wraps TFLite's model-inference API directly. The user loads a
.tflite model and calls NxTfliteMob.call(handle, inputs). The
generated <App>.TfliteInit only provides convenience helpers for
picking the right delegate + accelerator for the host platform.