Make sourcemaps script compatible with flavors #530
Merged
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.
What does this PR do?
Make sourcemaps script compatible with builds using flavors for RN >=0.71 (cf #528).
Since RN 0.71, the path are no longer defined in the
react.gradle
file but in the react-native-gradle-plugin. In the plugin, thetargetPath
isvariant.name
and no longervariant.dirName
.Additional Notes
There is a other possibility for when RN >= 0.71 to get the sourcemaps and bundle path as attributes of the bundle task.
Even if this could potentially be more stable in the long run, I feel it could make the script more complex and in the end harder to maintain.
The proposed fix is a bit simpler and has less potential to break on other versions of RN.
Review checklist (to be filled by reviewers)