-
Notifications
You must be signed in to change notification settings - Fork 191
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
feat: add a target to build Android AAR files with support for reverse Jetify #4
Conversation
I don't have bob experience but I have android native experience, and some typescript, and in general this looks spot-on. I wasn't even sure if bridging the support/AndroidX chasm was going to be possible a couple days ago and now it looks like it won't even hurt much. Very cool |
Hey! Sorry for the late review. This looks great. What do you think about @thymikee's comment? |
@satya164 I've added that in now 👍 |
Is there anything blocking this? I'd like to be able to recommend it - Clip-sub/react-native-bottomsheet#22 |
Sorry, totally forgot about it. Will merge and do a release now. |
Fantastic! thank you (and thanks @matt-oakes) 💪 |
Hey, I'm not an android dev and not sure exactly what this feature does. I think it would be cool to give more explainations on readme. I suppose using this features does not make sense for non-native libs right? (related to this pr: react-navigation/hooks#27) |
### Summary This removes the (non-working) support for `aar` targets. Originally, the `aar` support was added with #4 to support AndroidX. However, it's not needed anymore so we are removing the support. ### Test plan 1. Create a new library with `npx create-react-native-library` 2. Add `aar` to targets 3. run `yarn prepack` 4. Make sure an error is printed and the program stops.
I have a similar problem trying to add a module in android directory: I already configure: include ':library'
project(':library').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fire-tv/android/libs/library') and I added implementation project(':library') but it always shows the error: * Where:
Build file '/Users/binni.cordova/globant/NFL/MyTVApp/node_modules/react-native-fire-tv/android/build.gradle' line: 97
* What went wrong:
A problem occurred evaluating project ':react-native-fire-tv'.
> Project with path ':library' could not be found in project ':react-native-fire-tv'. |
Summary
This PR adds a target which assembles Android AAR files for a library. This is needed to help workaround the migration to AndroidX. See the discussion here for details:
react-native-community/discussions-and-proposals#129
The idea is that we can migrate a library to AndroidX and then generate AAR files which can then be converted back to the Android Support Library using the "reverse jetty" tool.
This target automates this process by running
./gradlew assemble
and then copying the output AAR to the correct folder. This then optionally converts it to the support library using thejetifier
package.Test Plan
You need to add the
aar
target to a project and then runyarn bob build
to test the output. Example output when run:The output files:
These can then be used by the user by changing their project imports in
android/settings.gradle
like this: