fix: attach library component to Maven publication - #3
Merged
Conversation
The release publication only set Maven coordinates without attaching
any artifacts, so publishing to GitHub Packages uploaded a bare POM
with no AAR and no dependency metadata.
- Add `from components.release` so the AAR, sources jar and POM
dependencies are published
- Opt in via `android.publishing.singleVariant("release")`, required
for `components.release` to exist on AGP 8.x
- Remove the debug publication: it shared the exact same GAV
coordinates as the release one, so the two would conflict
- Bump version to 1.4.2
Co-Authored-By: Claude Fable 5 <[email protected]>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughConfigures Maven publishing for the crashreporter module. Adds an android publishing block enabling the release variant with sources JAR, and updates upload_maven.gradle to bump the library version and derive the release publication from components.release instead of explicit coordinates. ChangesMaven Publishing Setup
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
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.
Problem
Publishing via
:crashreporter:publishReleasePublicationToGitHubPackagesRepositoryuploaded only a bare POM — the AAR (and dependency metadata) never made it to GitHub Packages.Root cause
The
MavenPublicationblocks inupload_maven.gradleset the Maven coordinates but never attached the library component (from components.release), so the publication had no artifacts and an empty dependency list.Changes
from components.releaseto the release publication so the AAR, sources jar, Gradle module metadata and POM dependencies are publishedandroid.publishing.singleVariant("release") { withSourcesJar() }tocrashreporter/build.gradle— required on AGP 8.x forcomponents.releaseto existdebugpublication: it used the exact samegroupId:artifactId:versionas the release publication, so the two would clobber each other (GitHub Packages rejects duplicate versions with HTTP 409)lib_versionto 1.4.2Verification
Ran
:crashreporter:publishReleasePublicationToMavenLocal; the publication now contains:crashreporter.aarincludingclasses.jar,jni/arm64-v8a/libbreakpad-core.so(16 KB aligned) andjni/armeabi-v7a/libbreakpad-core.so-sources.jar🤖 Generated with Claude Code
Summary by CodeRabbit