maven_export
support for bundling AARs
#1049
Open
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.
This PR adds (limited) support for bundling AARs for distribution with
maven_publish
. It optimistically uses an.aar
fromAndroidLibraryAarInfo
as the basis for bundling and then merges the transitive closure with the nestedclasses.jar
using the existing logic.Usage of
AndroidLibraryAarInfo
requires an--experimental_google_legacy_api
flag, which is pretty undesirable given it would require consumers to configure the same flag, even if not using for publishing Android artifacts. As such, I understand this PR probably isn't acceptable from a generic standpoint, but I wanted to open it up for feedback, ideas, and inspiration. This is what we'll be using to publish our Android targets until we can find a better alternative.Example usages:
External example (we're using an Android databinding wrapper which does work to create a base
.aar
instead ofandroid_library
):https://github.com/player-ui/player/blob/78345ac70c5bb34fcd58147ab49e38f22d3524fd/android/player/BUILD#L10-L27
Semi-relevant:
bazelbuild/bazel#348