#1138 / #1139: extract @perryts/google-auth + Android Glance widget build path#1165
Merged
Conversation
f5b44dc to
a083f29
Compare
db1cbf4 to
dfe1bed
Compare
…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.
dfe1bed to
fda7bfc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@perryts/google-authfrom the perry workspace intoPerryTS/google-authas a standalone npm package, with the real GoogleSignIn SDK Swift bridge (iOS/macOS) and androidx.credentials CredentialManager Kotlin bridge (Android). The v0.5.847 MVP shipped as anot-yet-implementedstub — downstream (GSC Master) was blocked from removing itsperry-searchbird-google-authfork.widget_build.rs.[[widget]]entries with aglance_sourcefield used to warn-and-skip; now they get the same treatment asswift_source(sources copied into Gradle project,widget_info_<name>.xmlemitted,<receiver>injected into AndroidManifest).__get_statusMessage,__get_headers) restored tocrates/perry-api-manifest/src/entries.rs— the v0.5.1014 native_table.rs restoration had a manifest-side drift that was failingevery_dispatch_entry_has_manifest_counterparton every PR (e.g. fix(android): unblock build + JNI bridge for the default Android target #1159 cargo-test). Adding the two missing rows makes the gate green.The new
@perryts/google-authrepo's initial commit is PerryTS/google-auth@71dc3e6 (not yet pushed to a remote — please create the GitHub repo + push). The publishednpm install @perryts/google-authflow goes live once the repo is on GitHub and npm publish runs.What lives in this PR vs the new google-auth repo
GIDSignIn.sharedInstance.signIn(withPresenting:...)/restorePreviousSignIn/signOutcrate-ios/swift/google_auth_bridge.swift)CredentialManager.getCredential(GetGoogleIdOption)crate-android/kotlin/PerryGoogleAuth.kt)package.jsonperry.nativeLibrarydeclarations (functions / targets /kotlin_sources/gradle_dependencies)src/index.ts) with typedGoogleSignInResultcrates/perry-ext-google-auth,types/perry/google-auth,well_known_bindings.tomlentry,native_table.rsrows,runtime_decls.rsdecls, api-manifest entries,test_google_auth_compile.tssmokeinject_google_auth_info_plist(writesGIDClientID/GIDServerClientID/GIDDefaultScopesfromperry.toml[google_auth]into the iOS Info.plist)crates/perry/src/commands/compile.rs)inject_google_auth_android_resources(writesgoogle_auth_server_client_idintoapp/src/main/res/values/google_auth.xml)crates/perry/src/commands/run.rs)wire_native_lib_kotlin_sourcesgeneral resolver (scansnode_modulesfornativeLibrary.targets.android.kotlin_sources+gradle_dependenciesand merges them into the Gradle project)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 Rustcrates/perry-ui-android/src/jni_bridge.rs)PerryGoogleAuth.install(this)(no-op when class isn't present)crates/perry-ui-android/template/.../PerryActivity.kt)build_declared_widgets_android— copies Kotlin sources, emitsappwidget-providerXML, injects<receiver>into AndroidManifestcrates/perry/src/commands/compile/widget_build.rs)Test plan
cargo build --release -p perrycargo build --release -p perry-runtime -p perry-stdlibcargo 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)perry-searchbird-google-authfork removal in GSC Master (downstream migration once the npm package publishes)Follow-ups
CFBundleURLSchemesentry for the reversed clientID (com.googleusercontent.apps.<id>) is currently a manual step — users add it topackage.jsonperry.deepLinks.schemesor[ios.info_plist]. Auto-emission needs to merge into the existingCFBundleURLTypesarray without duplicating the key; tracked as a follow-up in @perryts/google-auth: real GoogleSignIn SDK integration (MVP ships a not-yet-implemented stub) — follow-up to #674 #1138's comment thread.PerryTS/google-authrepo to GitHub + run the firstnpm publish --provenance --access public(.github/workflows/publish.ymlis wired and runs on release).watchos_source) still warn-and-skips — that's the remaining Feature request: official @perryts/widgets package for WidgetKit / Glance build glue #676 slice.