fix: react-native@0.73 sourceSet to maintain support (#2543)

# Summary

#2541 is not compatible with `react-native@0.73`. This PR introduces
sourceSet to maintain support for that version.

## Test Plan

Build app with `react-native@0.73.x`

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |          |
This commit is contained in:
Jakub Grzywacz
2024-11-19 13:54:39 +01:00
committed by GitHub
parent 81e4692885
commit 74b77a672e
5 changed files with 404 additions and 3 deletions
+14 -3
View File
@@ -118,10 +118,21 @@ android {
"src/paper/java",
]
}
if (getReactNativeMinorVersion() >= 75) {
srcDirs += "src/borderRadiusRn75/java"
if (getReactNativeMinorVersion() >= 75) { // borderRadius fix https://github.com/software-mansion/react-native-svg/pull/2415
// Use for react-native@0.75 and above
srcDirs += "src/SvgViewManager75/java"
} else {
srcDirs += "src/transformRn73/java"
// Maintain compatibility with react-native@0.73 and react-native@0.74
srcDirs += "src/SvgViewManager73/java"
}
if (getReactNativeMinorVersion() >= 74) { // new API https://github.com/software-mansion/react-native-svg/pull/2541
// Use for react-native@0.74 and above
srcDirs += "src/SvgPackage74/java"
} else {
// Maintain compatibility with react-native@0.73
srcDirs += "src/SvgPackage73/java"
}
}
}