Skip to content

Commit

Permalink
fix: Fix Boolean.parse string values from gradle properties (#2599)
Browse files Browse the repository at this point in the history
* parse string booleans from gradle properties

* Define separate safeExtGetBool function

---------

Co-authored-by: Jonas Thuresson <[email protected]>
  • Loading branch information
jthure and Jonas Thuresson authored Feb 26, 2024
1 parent 79ebae5 commit bca9472
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

def safeExtGetBool(prop, fallback) {
Boolean.parseBoolean("${safeExtGet(prop, fallback)}")
}

def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
Expand All @@ -68,10 +72,10 @@ static def findNodeModules(baseDir) {

def nodeModules = findNodeModules(projectDir)

def hasWorklets = !safeExtGet("VisionCamera_disableFrameProcessors", false) && findProject(":react-native-worklets-core") != null
def hasWorklets = !safeExtGetBool('VisionCamera_disableFrameProcessors', false) && findProject(":react-native-worklets-core") != null
logger.warn("[VisionCamera] react-native-worklets-core ${hasWorklets ? "found" : "not found"}, Frame Processors ${hasWorklets ? "enabled" : "disabled"}!")

def enableCodeScanner = safeExtGet("VisionCamera_enableCodeScanner", false)
def enableCodeScanner = safeExtGetBool('VisionCamera_enableCodeScanner', false)

repositories {
google()
Expand Down

0 comments on commit bca9472

Please sign in to comment.