Skip to content
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

Publish an AAR for Android developers. #8303

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DanAlbert
Copy link

This extends the existing Android workflow to collect the validation layer libraries into an AAR that is published to the repository's GitHub Packages Repository. This way, Android Gradle users can point their build at this repository and add a new dependency to their build.gradle.kts file rather than needing to download and manage the artifacts manually.

Fixes #8167

The alternate implementation would be to restructure all of the Android build as a Gradle project. Most of this workflow (and both of the Python scripts it calls) could be deleted since this behavior is all included in the Android Gradle Plugin (AGP). I opted not to do that because it's much more invasive, and people that aren't already Gradle users generally don't like Gradle being added to their projects :) It'd also have an impact on the build speed of the project (but only for this workflow, which only runs for new tags), since AGP builds each ABI in series rather than in parallel like the current workflow does. If you would actually prefer I do it that way, lmk, I don't think it's actually much work to migrate to that, since it's mostly deleting code.

You can see this in action on my fork: https://github.com/DanAlbert/Vulkan-ValidationLayers/actions/runs/9999981314 publishes https://github.com/DanAlbert/Vulkan-ValidationLayers/packages/2208155, which can be used like android/ndk-samples#1072.

Unfortunately I've just found out that GitHub requires authentication to read public packages for maven/gradle registries (everything but docker images?)

https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry

You need an access token to publish, install, and delete private, internal, and public packages.

That actually makes this quite annoying to use (especially for anyone that would want their repository to be easy to build and clone without configuring that, which is probably most). I'd suggested GHR in the feature request because I'd thought it would be easiest. Since that seems to not be true, this should probably be tweaked to publish somewhere like Maven Central?

@CLAassistant
Copy link

CLAassistant commented Jul 19, 2024

CLA assistant check
All committers have signed the CLA.

@ci-tester-lunarg
Copy link
Collaborator

Author DanAlbert not on autobuild list. Waiting for curator authorization before starting CI build.

@DanAlbert
Copy link
Author

Since that seems to not be true, this should probably be tweaked to publish somewhere like Maven Central?

The PR doesn't have to change much for this, but someone on the Khronos side would need to set up an account somewhere (I've never done it, so I'm not sure exactly what's involved, but if you're okay with doing that I'll figure it out as part of reworking the PR and let you know, I expect it's easy). Maven Central would be the easiest on developers since every AGP project already has that repo configured, but if there's a preference for a different host, lmk.

Jitpack is a pseudo-repository for Android (and other) artifacts that
builds AARs from GitHub repos for projects that do not themselves
publish their artifacts to somewhere like Maven Central. Adding this
allows Android app developers to add a dependency on
com.github.khronos:vulkan-validationlayers:$TAG to their build.gradle
file rather than needing to manage the VVL libraries themselves. See the
comment at the top of jitpack.yml for more information.

Fixes KhronosGroup#8167
@ci-tester-lunarg
Copy link
Collaborator

Author DanAlbert not on autobuild list. Waiting for curator authorization before starting CI build.

@DanAlbert
Copy link
Author

DanAlbert commented Jul 29, 2024

Can ignore the CI bot for now, I'll un-draft this once it's ready for review, but I have to push to test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FR] build AAR for android binaries, publish to github pacakges?
3 participants