fix(android,build): commit Android AARs to git and auto-clone SwiftGodot#21
Conversation
…dot (#20) - Un-gitignore addons/godot-iap/android/*.aar so Asset Library installs include pre-built AARs (matching how iOS frameworks are already committed) - Add GodotIap.gdap file for Android plugin configuration - Auto-generate GDAP file in `make android` target - Sync GDAP openiap-google version via sync-versions.sh and pre-commit hook - Auto-clone SwiftGodot in `make setup` so `make ios` works without manual steps Closes #20 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe PR addresses missing Android artifacts and iOS build failures by enabling git tracking of Android Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the project's build and dependency management for both Android and iOS platforms. It aims to improve developer experience by automating the setup of critical dependencies and ensuring consistent inclusion of pre-built binaries for asset distribution. These changes streamline the build process, reduce manual steps, and ensure better compatibility with the Godot Asset Library. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces several build system improvements, including committing Android AARs, auto-cloning the SwiftGodot dependency, and adding generation for the GodotIap.gdap file. The changes are logical and well-structured. I have one suggestion for the Makefile to improve the robustness and maintainability of the new script logic for generating the .gdap file, primarily by replacing fragile shell parsing with a more reliable method and improving the script's readability.
There was a problem hiding this comment.
🧹 Nitpick comments (2)
Makefile (1)
132-141: Consider using a more robust JSON parser for version extraction.The current approach
grep '"google"' | cut -d'"' -f4works but is sensitive to JSON formatting. If the JSON structure changes (e.g., different whitespace, key ordering), this could break silently.
sync-versions.shalready uses Python'sjsonmodule for robust parsing. Consider aligning this extraction method for consistency:♻️ Suggested improvement
- `@OPENIAP_VERSION`=$$(cat $(PROJECT_ROOT)/openiap-versions.json | grep '"google"' | cut -d'"' -f4); \ + `@OPENIAP_VERSION`=$$(python3 -c "import json; print(json.load(open('$(PROJECT_ROOT)/openiap-versions.json'))['google'])"); \This also applies to the duplicate GDAP generation in the
test-setuptarget (lines 271-279).🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@Makefile` around lines 132 - 141, Replace the brittle OPENIAP_VERSION extraction that uses grep/cut with a robust JSON parse (e.g., call Python's json module or jq) so the Makefile target that builds OPENIAP_VERSION (the shell block that sets OPENIAP_VERSION=$$(cat ... | grep '"google"' | cut -d'"' -f4)) reliably reads the "google" value; update that same pattern in the duplicate GDAP generation in the test-setup target as well so both places use the same json-parsing approach (refer to the OPENIAP_VERSION variable and the GDAP generation echo block for locations to change).addons/godot-iap/android/GodotIap.gdap (1)
1-8: Update documentation and consider centralizing thebillinglibrary version.The
com.android.billingclient:billing:7.1.1version is hardcoded in the Makefile (lines 141 and 279) and not centralized likeopeniap-google. Additionally, the documentation indocs/guides/troubleshooting.mdstill references the outdatedbilling:7.0.0, creating a discrepancy with the actual implementation.Either centralize the billing version in
gradle.propertiesoropeniap-versions.json(aligned with theopeniap-googleversion management approach), or at minimum ensure the documentation is updated to reflect7.1.1.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@addons/godot-iap/android/GodotIap.gdap` around lines 1 - 8, The billing library version is hardcoded as "com.android.billingclient:billing:7.1.1" in GodotIap.gdap while docs/guides/troubleshooting.md still reference 7.0.0; either centralize this version (add a billing_version property to gradle.properties or include it in openiap-versions.json and update the Makefile to reference that variable) or update the troubleshooting doc to state 7.1.1 to match GodotIap.gdap; locate references by searching for "com.android.billingclient:billing" in GodotIap.gdap, the Makefile targets that assemble dependencies, and docs/guides/troubleshooting.md and make the versions consistent.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@addons/godot-iap/android/GodotIap.gdap`:
- Around line 1-8: The billing library version is hardcoded as
"com.android.billingclient:billing:7.1.1" in GodotIap.gdap while
docs/guides/troubleshooting.md still reference 7.0.0; either centralize this
version (add a billing_version property to gradle.properties or include it in
openiap-versions.json and update the Makefile to reference that variable) or
update the troubleshooting doc to state 7.1.1 to match GodotIap.gdap; locate
references by searching for "com.android.billingclient:billing" in
GodotIap.gdap, the Makefile targets that assemble dependencies, and
docs/guides/troubleshooting.md and make the versions consistent.
In `@Makefile`:
- Around line 132-141: Replace the brittle OPENIAP_VERSION extraction that uses
grep/cut with a robust JSON parse (e.g., call Python's json module or jq) so the
Makefile target that builds OPENIAP_VERSION (the shell block that sets
OPENIAP_VERSION=$$(cat ... | grep '"google"' | cut -d'"' -f4)) reliably reads
the "google" value; update that same pattern in the duplicate GDAP generation in
the test-setup target as well so both places use the same json-parsing approach
(refer to the OPENIAP_VERSION variable and the GDAP generation echo block for
locations to change).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 04fbdc4b-0dfa-4331-b57e-85faba271474
📒 Files selected for processing (7)
.gitignoreMakefileaddons/godot-iap/android/GodotIap.debug.aaraddons/godot-iap/android/GodotIap.gdapaddons/godot-iap/android/GodotIap.release.aarscripts/pre-commitscripts/sync-versions.sh
Replace fragile grep/cut JSON parsing with python3 and multiple echo+append with single printf for better robustness and readability. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
make setupso iOS source builds work out of the boxCloses #20
Changes
.gitignore
*.aar→android/*.aarto only ignore AARs in the android build diraddons/godot-iap/android/*.aarso pre-built binaries are committedAndroid plugin (addons/godot-iap/android/)
GodotIap.release.aarandGodotIap.debug.aarto gitGodotIap.gdapwith proper dependency declarationsBuild system (Makefile)
SWIFT_GODOT_VERSIONvariable (v0.74.0)make setupif not presentmake androidtargetVersion sync (scripts/)
sync-versions.sh: Update GDAP file's openiap-google version on syncpre-commit: Auto-stage GDAP file when versions changeTest plan
make setupclones SwiftGodot automaticallymake iossucceeds without manual SwiftGodot clonemake androidgenerates GDAP file with correct version🤖 Generated with Claude Code
Summary by CodeRabbit