feat: add expo support for brownfield gradle plugin #118
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.
Summary
This PR adds support for Expo projects. The changes in this PR relates to embedding the Expo third party dependencies or libraries in the brownfield module AAR. Without this change, there will be a crash at the run-time when react-native tries to invoke
ExpoModuleswhich in turn look for its libraries likeexpo-imageand if it will not be provided with the AAR then a crash will happen, since the classes won't be resolved.We achieve this solution by evaluating the dependencies associated with
expoproject. What this means is that internally expo gradle plugin adds their third party dependencies usingapiand host these either in a local maven repo OR as a subproject. Since,expoproject is linked in settings.gradle file it is available for the brownfield module.Hence we evaluate the
expoproject and get its dependencies. Then we embed these dependencies for the brownfield module.The above changes can be opted in by:
Test plan
Tested these changes on both Expo and bare RN projects - 🟢