Skip to content

Commit

Permalink
fix: [email protected] sourceSet to maintain support (#2543)
Browse files Browse the repository at this point in the history
# Summary

#2541 is not compatible with `[email protected]`. This PR introduces
sourceSet to maintain support for that version.

## Test Plan

Build app with `[email protected]`

## Compatibility

| OS      | Implemented |
| ------- | :---------: |
| Android |    ✅      |
  • Loading branch information
jakex7 authored Nov 19, 2024
1 parent 81e4692 commit 74b77a6
Show file tree
Hide file tree
Showing 5 changed files with 404 additions and 3 deletions.
17 changes: 14 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] and above
srcDirs += "src/SvgViewManager75/java"
} else {
// Maintain compatibility with [email protected] and [email protected]
srcDirs += "src/SvgViewManager73/java"
}

if (getReactNativeMinorVersion() >= 74) { // new API https://github.com/software-mansion/react-native-svg/pull/2541
// Use for [email protected] and above
srcDirs += "src/SvgPackage74/java"
} else {
srcDirs += "src/transformRn73/java"
// Maintain compatibility with [email protected]
srcDirs += "src/SvgPackage73/java"
}
}
}
Expand Down
Loading

0 comments on commit 74b77a6

Please sign in to comment.