// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        kotlinVersion = "1.9.24"
        buildToolsVersion = "35.0.0"
        minSdkVersion = 24
        compileSdkVersion = 35
        targetSdkVersion = 35
        ndkVersion = "26.1.10909125"
        zendeskSdkVersion = "2.32.0"

        //todo: for VisionCameraCodeScanner configurations, if required - Can remove these now - Nadav!
        VisionCameraCodeScanner_minSdkVersion = 23
        VisionCameraCodeScanner_compileSdkVersion = 34
        VisionCameraCodeScanner_targetSdkVersion = 34
    }
    repositories {
        google()
        mavenCentral()
        // Required for fedi-android
        mavenLocal()
         // Required for zendesk messaging
        maven {
            url "https://zendesk.jfrog.io/artifactory/repo"
        }
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
        // Used for chat push notifications
        classpath 'com.google.gms:google-services:4.3.15'
    }
}

apply plugin: "com.facebook.react.rootproject"

apply plugin: "com.facebook.react.rootproject"

allprojects {
    repositories {
        google()
        mavenCentral()
        // Required for Detox e2e testing framework
        maven {
            url("$rootDir/../../node_modules/detox/Detox-android")
            url "https://zendesk.jfrog.io/artifactory/repo"
        }
        // Required for fedi-android, using ANDROID_BRIDGE_ARTIFACTS environment variable
        maven {
            def androidBridgeArtifacts = System.getenv('ANDROID_BRIDGE_ARTIFACTS')
            if (androidBridgeArtifacts == null) {
                throw new GradleException("ANDROID_BRIDGE_ARTIFACTS environment variable must be set")
            }
            url("file://${androidBridgeArtifacts}")
        }
    }
}
