iris is the framework alone; the app is one crate in app-rust/
Iris: "the organization of the rust rewrite is a mess right now... there shouldn't be anything related to the app inside of iris. Iris is supposed to be the UI framework alone." And, on the crate count: "I'm confused why the app only code needs more than one crate though." Nine cargo workspaces become three, and the port's project code -- which sat in five places, four of them inside the framework -- becomes one crate, `ai-app`, in `app-rust/`: client-core -> app-rust/src/client iris/transcript-ui -> app-rust/src/ui iris/transcript-fixture -> app-rust/src/ui/fixture.rs + tests/ + touch/ iris/desktop-app -> app-rust/src/desktop + src/bin_desktop.rs iris/android-app -> app-rust/src/android + android-project/ android-shell -> app-rust/src/shell iris/ keeps core, macro, the iris crate, tabs-ui and rig-input, and now mentions no session, transcript, setup or server anywhere. Only two of the old splits had a reason that survived reading. event-model stays a crate at the repo root because server/ depends on it too, so a crate is what makes the backend and the app agree by construction. The two Android .so names looked like a hard constraint -- a package produces one library artifact -- until P2 turned out to already plan merging those two Android apps into one; both faces now come out of libai_app.so, picked apart by features so `--no-default-features --features shell` keeps wgpu, parley and iris out of the Compose app's APK. docs/RUST.md's "One app crate" has the rest, including what each remaining feature is for. DECISIONS.md and SUBAGENTS.md move into docs/ with everything else. Verified: ./run-tests.sh and `cd iris && cargo test` green, clippy and fmt clean in all five workspaces, `cargo ndk -t x86_64` links libai_app.so, build-apk.sh produces an APK that installs and launches on this checkout's emulator (Gl ... virgl, as expected), and the phone-sized headless screenshot renders the transcript unchanged. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e9a6562dc6
commit
6d5a231f5c
100 files changed
+924
-3295
No files matched your search
+16
-6
@@ -8,7 +8,7 @@
|
||||
//! the Keystore-sealed enrollment, RUST.md's E3 entry explains why that
|
||||
//! code is reused rather than re-derived in Rust) and on
|
||||
//! `androidx.core:core-ktx` (used at runtime through JNI by
|
||||
//! `android-shell`'s `notify.rs`, for `NotificationCompat` and friends).
|
||||
//! the shell bridge's `notify.rs`, for `NotificationCompat` and friends).
|
||||
//! Both are ordinary Maven/AAR dependency graphs, and reimplementing a
|
||||
//! dependency resolver to avoid one Gradle invocation was not a good trade
|
||||
//! against "smallest honest route" (RUST.md's E5 box) -- especially since
|
||||
@@ -34,7 +34,10 @@ pub fn build(variant: Variant, abis: &[String]) -> Result<PathBuf, Fail> {
|
||||
let repo_root = repo_root()?;
|
||||
let app_dir = repo_root.join("app");
|
||||
let shell_app_dir = app_dir.join("shellApp");
|
||||
let android_shell_dir = repo_root.join("android-shell");
|
||||
// The JNI bridge is the `shell` feature of the one app crate now, not
|
||||
// a crate of its own -- `--no-default-features` is what keeps iris,
|
||||
// wgpu and parley out of a `.so` for an app that draws with Compose.
|
||||
let app_crate_dir = repo_root.join("app-rust");
|
||||
|
||||
let sdk = sdk::find()?;
|
||||
sdk::require_ndk_installed(&sdk.root)?;
|
||||
@@ -49,8 +52,8 @@ pub fn build(variant: Variant, abis: &[String]) -> Result<PathBuf, Fail> {
|
||||
)
|
||||
})?;
|
||||
|
||||
println!("==> Building android-shell for {}", abis.join(", "));
|
||||
build_native_libs(&android_shell_dir, &shell_app_dir, &sdk, abis)?;
|
||||
println!("==> Building the shell JNI bridge for {}", abis.join(", "));
|
||||
build_native_libs(&app_crate_dir, &shell_app_dir, &sdk, abis)?;
|
||||
|
||||
println!("==> Resolving the runtime classpath (one Gradle call -- see apk.rs's module doc)");
|
||||
let classpath_jars = runtime_classpath_jars(&app_dir, &sdk)?;
|
||||
@@ -159,7 +162,14 @@ fn build_native_libs(
|
||||
// segfaults this emulator's driver (RUST.md's E1 entry), and there is
|
||||
// no reason for this crate's debug build to be bigger or slower for a
|
||||
// signing choice that has nothing to do with it.
|
||||
cmd.args(["build", "--release", "-p", "android-shell"]);
|
||||
cmd.args([
|
||||
"build",
|
||||
"--release",
|
||||
"--lib",
|
||||
"--no-default-features",
|
||||
"--features",
|
||||
"shell",
|
||||
]);
|
||||
cmd.env("ANDROID_HOME", &sdk.root);
|
||||
cmd.env("ANDROID_SDK_ROOT", &sdk.root);
|
||||
run_checked(
|
||||
@@ -395,7 +405,7 @@ fn merge(
|
||||
std::fs::remove_dir_all(&stage).ok();
|
||||
}
|
||||
for abi in abis {
|
||||
let so_name = "libandroid_shell.so";
|
||||
let so_name = "libai_app.so";
|
||||
let src = shell_app_dir
|
||||
.join("src/main/jniLibs")
|
||||
.join(abi)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
//! `cargo xtask apk` -- E5 (RUST.md): packages `app/shellApp` into a
|
||||
//! signed, installable APK with no Gradle in the packaging step itself.
|
||||
//! `cargo ndk` cross-compiles `android-shell`; `javac`/`d8` turn its two
|
||||
//! `cargo ndk` cross-compiles the app crate's `shell` feature; `javac`/`d8` turn its two
|
||||
//! Java stub classes (plus the generated pinned-CA constant) into dex;
|
||||
//! `aapt2` compiles the manifest into `resources.arsc`; the dex and native
|
||||
//! libraries are merged into that base APK with `jar`; `zipalign` and
|
||||
|
||||
Reference in new issue
Block a user