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

RNGP - Add Variant Support #35063

Closed
wants to merge 5 commits into from
Closed

Conversation

cortinico
Copy link
Contributor

Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm add Variant support to RNGP via the Variant API from AGP 7.x

A short summary of changes:

  • I've pushed a number of breaking changes to ReactExtension (we should document them in the release notes). Specifically I've removed properties which I believe were unnecessary and confusing
  • I've removed all the extra logic to do the .so cleanups and use the new tasks that use the Artifacts API
  • I've introduced only a debuggableVariants to make all the decisions for the bundling and minification which should be sufficient for users
  • I've removed all the funcional interfaces are replaced them with lists as they're easy to handle and understand for users.

Changelog:
[Android] [Changed] - Added Flavor Support to React Native Gradle Plugin (RNGP)

Reviewed By: cipolleschi

Differential Revision: D40335028

cortinico and others added 5 commits October 24, 2022 06:08
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm creating a new task BundleAndHermesCTask that is variant-aware.
Historically we had problems with the Bundle and the Hermes task being separated and overriding their own output. Consolidating those two steps in a single one will make it easier to support seaprate variants.

I'm going to use this task in a subsequent diff.

Changelog:
[Internal] [Changed] - RNGP - Introduce the BundleAndHermesCTask

Differential Revision: D40633108

fbshipit-source-id: eb5e5eeef2933c4296b1b117f2a9d1035337f1a5
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm renaming the top level property to enable hermes from `enableHermes` to `hermesEnabled`. We have a bunch of other properties which are called *Enabled. This one was following a different convention.

I'm retaining the backward compatibility for users using `project.ext.react.enableHermes` so this is not going to be a breakign change.

Changelog:
[Internal] [Changed] - RNGP - Top level property enableHermes -> hermesEnabled

Differential Revision: D40633109

fbshipit-source-id: 5b6904eebd675a9f6a857dda86237207a46e379c
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Historically we used to enable the codegen only for library modules. This is not working well for apps like RN Tester which don't have library modules but are running the codegen.

Therefore I'm introducing the `enableCodegenInApps` that is allowing apps to turn off the codegen if needed.

Changelog:
[Internal] [Changed] - RNGP - Introduce enableCodegenInApps

Differential Revision: D40633106

fbshipit-source-id: beee31eeae370465c88318fcde3ada6699c61ec2
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

I'm extending RNGP to do autoconfiguration of dependencies for React Native and Hermes Engine using the Utils classes which were introduced before.

Changelog:
[Internal] [Changed] - RNGP - Automatically Configure Dependencies for ReactNative & Hermes

Differential Revision: https://internalfb.com/D40633487

fbshipit-source-id: 71fc4136974d5b078decdabef0a17090e4da782b
Summary:
This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm add Variant support to RNGP via the Variant API from AGP 7.x

A short summary of changes:
- I've pushed a number of breaking changes to ReactExtension (we should document them in the release notes). Specifically I've removed properties which I believe were unnecessary and confusing
- I've removed all the extra logic to do the .so cleanups and use the new tasks that use the Artifacts API
- I've introduced only a `debuggableVariants` to make all the decisions for the bundling and minification which should be sufficient for users
- I've removed all the funcional interfaces are replaced them with lists as they're easy to handle and understand for users.

Changelog:
[Android] [Changed] - Added Flavor Support to React Native Gradle Plugin (RNGP)

Reviewed By: cipolleschi

Differential Revision: D40335028

fbshipit-source-id: 483930f71521d7c1ecbc8ab00e05e84bbc11cae8
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner fb-exported labels Oct 24, 2022
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D40335028

@react-native-bot react-native-bot added the Platform: Android Android applications. label Oct 24, 2022
@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 9a87db2
Branch: main

@pull-bot
Copy link

PR build artifact for f23dbb5 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@pull-bot
Copy link

PR build artifact for f23dbb5 is ready.
To use, download tarball from "Artifacts" tab in this CircleCI job then run yarn add <path to tarball> in your React Native project.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by @cortinico in 8ad86c7.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Oct 24, 2022
OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Pull Request resolved: facebook#35063

This is part of a series of tasks to make the React Native Gradle Plugin (RNGP) variant-aware.

Here I'm add Variant support to RNGP via the Variant API from AGP 7.x

A short summary of changes:
- I've pushed a number of breaking changes to ReactExtension (we should document them in the release notes). Specifically I've removed properties which I believe were unnecessary and confusing
- I've removed all the extra logic to do the .so cleanups and use the new tasks that use the Artifacts API
- I've introduced only a `debuggableVariants` to make all the decisions for the bundling and minification which should be sufficient for users
- I've removed all the funcional interfaces are replaced them with lists as they're easy to handle and understand for users.

Changelog:
[Android] [Changed] - Added Flavor Support to React Native Gradle Plugin (RNGP)

Reviewed By: cipolleschi

Differential Revision: D40335028

fbshipit-source-id: d9ac1437de8a27db2e93df15b13772b221e036b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged This PR has been merged. p: Facebook Partner: Facebook Partner Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants