Skip to content

#1138 / #1139: extract @perryts/google-auth + Android Glance widget build path#1165

Merged
proggeramlug merged 1 commit into
mainfrom
worktree-issues-1138-1139
May 20, 2026
Merged

#1138 / #1139: extract @perryts/google-auth + Android Glance widget build path#1165
proggeramlug merged 1 commit into
mainfrom
worktree-issues-1138-1139

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Summary

The new @perryts/google-auth repo's initial commit is PerryTS/google-auth@71dc3e6 (not yet pushed to a remote — please create the GitHub repo + push). The published npm install @perryts/google-auth flow goes live once the repo is on GitHub and npm publish runs.

What lives in this PR vs the new google-auth repo

Concern Lives in
Swift bridge over GIDSignIn.sharedInstance.signIn(withPresenting:...) / restorePreviousSignIn / signOut new google-auth repo (crate-ios/swift/google_auth_bridge.swift)
Kotlin bridge over CredentialManager.getCredential(GetGoogleIdOption) new google-auth repo (crate-android/kotlin/PerryGoogleAuth.kt)
Rust shims (iOS + Android crate-android + crate-stub) new google-auth repo
package.json perry.nativeLibrary declarations (functions / targets / kotlin_sources / gradle_dependencies) new google-auth repo
TS shim (src/index.ts) with typed GoogleSignInResult new google-auth repo
Remove crates/perry-ext-google-auth, types/perry/google-auth, well_known_bindings.toml entry, native_table.rs rows, runtime_decls.rs decls, api-manifest entries, test_google_auth_compile.ts smoke THIS PR
inject_google_auth_info_plist (writes GIDClientID / GIDServerClientID / GIDDefaultScopes from perry.toml [google_auth] into the iOS Info.plist) THIS PR (crates/perry/src/commands/compile.rs)
inject_google_auth_android_resources (writes google_auth_server_client_id into app/src/main/res/values/google_auth.xml) THIS PR (crates/perry/src/commands/run.rs)
wire_native_lib_kotlin_sources general resolver (scans node_modules for nativeLibrary.targets.android.kotlin_sources + gradle_dependencies and merges them into the Gradle project) THIS PR (crates/perry/src/commands/run.rs)
perry_android_jvm() weak extern (extern "C" fn perry_android_jvm() -> *mut JavaVM) used by external nativeLibrary crates that need to JNI-call into Kotlin from Rust THIS PR (crates/perry-ui-android/src/jni_bridge.rs)
PerryActivity reflection-call to PerryGoogleAuth.install(this) (no-op when class isn't present) THIS PR (crates/perry-ui-android/template/.../PerryActivity.kt)
build_declared_widgets_android — copies Kotlin sources, emits appwidget-provider XML, injects <receiver> into AndroidManifest THIS PR (crates/perry/src/commands/compile/widget_build.rs)

Test plan

  • cargo build --release -p perry
  • cargo build --release -p perry-runtime -p perry-stdlib
  • cargo test --release -p perry widget_build (9/9 green; 5 new tests cover receiver-class detection, XML escaping, Kotlin source filtering)
  • cargo test --release -p perry-codegen --test manifest_consistency (4/4 green after the 2 IncomingMessage rows were added)
  • cargo test --release --workspace --exclude perry-ui-{ios,tvos,watchos,visionos,android,windows,gtk4} — passes (workspace test command from CLAUDE.md)
  • Not exercised in this session — end-to-end iOS GoogleSignIn flow against a real device + GoogleSignIn.framework on path
  • Not exercised in this session — end-to-end Android CredentialManager flow against a real emulator + Play Services
  • Not exercised in this session — Android Glance widget render against GSC Master's 3-widget suite (TopSites / QuickStats / DailyChange)
  • Out of scopeperry-searchbird-google-auth fork removal in GSC Master (downstream migration once the npm package publishes)

Follow-ups

@proggeramlug proggeramlug force-pushed the worktree-issues-1138-1139 branch from f5b44dc to a083f29 Compare May 20, 2026 09:25
@proggeramlug proggeramlug changed the title v0.5.1015 — #1138 / #1139: extract @perryts/google-auth + Android Glance widget build path v0.5.1016 — #1138 / #1139: extract @perryts/google-auth + Android Glance widget build path May 20, 2026
@proggeramlug proggeramlug force-pushed the worktree-issues-1138-1139 branch 3 times, most recently from db1cbf4 to dfe1bed Compare May 20, 2026 11:10
@proggeramlug proggeramlug changed the title v0.5.1016 — #1138 / #1139: extract @perryts/google-auth + Android Glance widget build path #1138 / #1139: extract @perryts/google-auth + Android Glance widget build path May 20, 2026
…uild path

#1138: extract @perryts/google-auth to standalone npm package + real SDK integration. The v0.5.847 MVP shipped the binding as crates/perry-ext-google-auth with all three FFI entry points resolving "not-yet-implemented" on every platform — downstream (GSC Master) couldn't migrate off its perry-searchbird-google-auth fork.

Now extracted to PerryTS/google-auth (sibling to PerryTS/storekit / play-billing / etc.) with the real Swift bridge over GoogleSignIn SDK (iOS/macOS, opt-in via PERRY_GOOGLE_SIGN_IN_FRAMEWORK_DIR) and Kotlin bridge over androidx.credentials CredentialManager + GetGoogleIdOption (Android, via JNI from crate-android using a new perry_android_jvm() weak extern that perry-ui-android exports from JNI_OnLoad).

Perry-side wiring lives here:
- removed crates/perry-ext-google-auth/, types/perry/google-auth/, test_google_auth_compile.ts, well_known_bindings.toml entry, native_table.rs NativeModSig rows, runtime_decls.rs declarations, api-manifest entries — the npm package's nativeLibrary.functions drives codegen ffi_signatures, same path as other @perryts/* deps.
- inject_google_auth_info_plist writes GIDClientID / GIDServerClientID / GIDDefaultScopes from [google_auth] in perry.toml into the iOS Info.plist.
- inject_google_auth_android_resources writes res/values/google_auth.xml's google_auth_server_client_id from [google_auth] for the Android Kotlin bridge to read.
- wire_native_lib_kotlin_sources is a general resolver: scans node_modules for perry.nativeLibrary.targets.android.kotlin_sources + gradle_dependencies and merges them into the Gradle project.
- perry-ui-android's PerryActivity.onCreate reflection-calls PerryGoogleAuth.install(this) when the class is on the classpath (no-op otherwise).

#1139: Android Glance widget build path — [[widget]] entries with a glance_source field used to warn-and-skip ("Android Glance build path not yet wired — follow-up issue #676 (Glance)."). Now wired: build_declared_widgets_android in widget_build.rs mirrors the iOS slice — copies sources into app/src/main/java/<pkg>/widgets/<name>/, emits res/xml/widget_info_<name>.xml, and injects a <receiver> block into AndroidManifest.xml's <application>. Called from build_and_run_android after the deeplinks injection + [google_auth] Android resource write.

Also folds in 2 pre-existing manifest_consistency drifts from v0.5.1014: http::__get_statusMessage and http::__get_headers had no API_MANIFEST counterpart for IncomingMessage. The test every_dispatch_entry_has_manifest_counterpart was failing on every PR opened after v0.5.1014 (e.g. #1159's cargo-test failure); the two missing rows in entries.rs make the gate green.

Tests: 5 new widget_build unit tests + manifest_consistency now passes 4/4. cargo test -p perry widget_build green (9/9). End-to-end on-device sign-in + widget render not exercised in this session — Ralph/downstream-GSC-Master will validate against real iOS device + Android emulator next.

Version bump + CHANGELOG entry intentionally omitted — Ralph applies those at merge time (per CLAUDE.md "External contributor PRs" guidance, avoiding the patch-version collisions that have hit this PR twice already as main bumps in parallel).

Closes #1138, closes #1139.
@proggeramlug proggeramlug force-pushed the worktree-issues-1138-1139 branch from dfe1bed to fda7bfc Compare May 20, 2026 11:39
@proggeramlug proggeramlug merged commit 01e7f70 into main May 20, 2026
9 checks passed
@proggeramlug proggeramlug deleted the worktree-issues-1138-1139 branch May 20, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant