-
Notifications
You must be signed in to change notification settings - Fork 4
RU-T46 Fixing build #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RU-T46 Fixing build #201
Conversation
📝 WalkthroughWalkthroughReads Android base package name from Changes
Sequence Diagram(s)sequenceDiagram
participant CLI as Plugin (withMediaButtonModule)
participant FS as File System
participant Gradle as android/app/build.gradle(.kts)
participant MainApp as android/app/src/.../MainApplication.kt
CLI->>FS: read projectRoot config
CLI->>Gradle: probe for namespace via regex
Gradle-->>CLI: return basePackageName (or fallback)
CLI->>MainApp: open MainApplication.kt
CLI->>MainApp: insert import using basePackageName
CLI->>FS: write patched MainApplication.kt
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@plugins/withMediaButtonModule.js`:
- Around line 487-495: Extract the namespace-parsing logic into a helper (e.g.,
getAndroidNamespace or resolveBasePackageName) and replace the duplicated blocks
at the sites that build the package name (the blocks around the existing
namespaceMatch usage and the duplicate at lines near 448 and 492) with calls to
that helper; the helper should probe both android/app/build.gradle and
android/app/build.gradle.kts (and fall back to the existing default
'com.resgrid.unit'), read file content, and use an expanded regex that accepts
an optional equals sign such as /namespace\s*(?:=)?\s*['"]([^'"]+)['"]/ to
reliably capture the namespace across Groovy and Kotlin DSLs, then return the
captured namespace or the fallback.
🧹 Nitpick comments (1)
plugins/withMediaButtonModule.js (1)
481-495: Consider extracting namespace resolution into a helper.The same build.gradle parsing logic now exists in two places (Android mod and MainApplication update). A small helper (e.g.,
getAndroidNamespace(projectRoot)) would keep behavior consistent and reduce maintenance overhead.
|
Approve |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is approved.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.