Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean.parse string values from gradle properties #2599

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading