Skip to content

Commit 37d3b3f

Browse files
committed
Handle pre-release versions
1 parent b2f611a commit 37d3b3f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/react-native-gesture-handler/android/build.gradle

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ def getExternalLibVersion(project){
7474
def libVerision = json.version as String
7575
def (major, minor, patch) = libVerision.tokenize('.')
7676

77-
return [Integer.parseInt(major), Integer.parseInt(minor), Integer.parseInt(patch)]
77+
// Handle cases where version is a pre-release one, e.g. "2.3.0-alpha.1"
78+
def patchVersion = patch.find(/(\d+)/) ? patch.find(/(\d+)/) : "0"
79+
80+
return [Integer.parseInt(major), Integer.parseInt(minor), Integer.parseInt(patchVersion)]
7881
}
7982

8083
// Check whether Reanimated 2.3 or higher is installed alongside Gesture Handler

0 commit comments

Comments
 (0)