Allow overriding Android library loading logic#78
Open
fourlastor wants to merge 2 commits intolibgdx:masterfrom
Open
Allow overriding Android library loading logic#78fourlastor wants to merge 2 commits intolibgdx:masterfrom
fourlastor wants to merge 2 commits intolibgdx:masterfrom
Conversation
Member
|
This is an interesting one, and doesn't look like much as-is, but being able to painlessly use ReLinker for any native libraries that use gdx-jnigen would be great. It seems like Android has had a need for ReLinker to avoid some nasty library loading bugs for a long time. |
| static private final HashSet<String> loadedLibraries = new HashSet<>(); | ||
| static private final Random random = new Random(); | ||
|
|
||
| static private AndroidLibraryLoader androidLibraryLoader = new AndroidLibraryLoader() { |
Member
There was a problem hiding this comment.
Just pointing out that this could use a method reference if we can use language level 8.
tommyettinger
approved these changes
Nov 13, 2024
Member
tommyettinger
left a comment
There was a problem hiding this comment.
I don't see any possible breakage here; this is only an extension point for other code to use. And I think that other code could really benefit.
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.
This PR adds the ability to configure how
SharedLibraryLoaderloads libraries in Android. This is to allow libraries to be loaded in different ways, for example by using ReLinker.Initial discussion in libgdx/gdx-liftoff#158, where I was suggested this is a better place for the configuration to exist, as it's also used in other projects (for example box2d bindings).