-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feature-request: add android_library support to maven distribution #233
Comments
Hi! Unfortunately, we have no plans for that in the foreseeable future (we're not building Android products as a company). What you can do instead is to create your own distribution repository, and it can depend on this repository if you feel that you can build it on top of existing functionalities which we provide. Closing this issue for now. |
@jagobagascon, did you end up solving this another way? Was looking into doing the same :) |
@cpsauer I ended up writing my own Bazel rule. As I say in my first comment, I had to split the deployment in two: pom generation and the deployment itself. The rule to create the # generate pom
generate_pom(
name = 'generate_pom',
target = ':my_android_lib', # android_library (only used to generate the pom)
project_url = project_url,
project_name = 'my_android_lib',
packaging = 'aar',
)
# publish calling `bazel run :publish --define version=1.2.3`
publish_to_artifactory(
name = 'publish',
pom_file = ':generate_pom',
target = ':my_android_lib.aar', # deployed artifact
sources = ':libmy_android_lib-src.jar',
url = deployment_url,
requires_auth = True,
user = GITHUB_ACTOR,
password = GITHUB_TOKEN,
) Our repo is not currently public but you can take a look at the relevant Bazel code here: https://gist.github.com/jagobagascon/4e9499eaf69934f14578d3677afc3539 |
Thanks so much @jagobagascon! I (and everyone else who comes across this in the future) really appreciate it. |
@jagobagascon, you didn't also solve the issue of bundling up the transitive deps (minus maven deps) into the aar, by any chance, did you? Was tackling that full on and it looks a bit...gnarly. |
I have a bunch of |
I'm trying to deploy an
android_library
to maven, but maven assemble and deployment rules only work with jars, and I need to upload anaar
artifact.I tried modifying the rules myself to make a PR
but for some reason aspects are not working when I define thebut I couldn't make it work without having to completely change the deployment rule.aar
as target (and thus pom generation fails). I think it may be a bug with Bazel or the Android rulesThe
aar
artifact is an implicit output of theandroid_library
rule, which means it's just a file and aspects do not work on them.To make it work I had to modify the deployment so I could generate the pom and then explicitly choose the deployed file:
Are there any plans on supporting Android
aar
files?The text was updated successfully, but these errors were encountered: