buildscript {
    apply from: './rninfo.gradle'

    ext {
        isOfficialDetoxLib = true
        kotlinVersion = '1.9.24'
        dokkaVersion = '1.9.10'
        buildToolsVersion = '35.0.0'
        compileSdkVersion = 35
        targetSdkVersion = 35
        minSdkVersion = 24
    }
    ext.detoxKotlinVersion = ext.kotlinVersion

    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        if (!rnInfo.isRN71OrNewer) {
            classpath "com.facebook.react:react-native-gradle-plugin"
        }
        classpath 'com.android.tools.build:gradle'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
        classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"

        // Needed by Spek (https://spekframework.org/setup-android)
        classpath 'de.mannodermaus.gradle.plugins:android-junit5:1.7.1.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        mavenLocal()

        // In RN's below 71, the native code comes from within node_modules/ rather
        // than from maven-central.
        if (!rnInfo.isRN71OrNewer) {
            maven {
                url "$projectDir/../../node_modules/react-native/android"
            }
        }
    }
}

subprojects {
    afterEvaluate { p ->
        if (p.hasProperty('android')) {
            android {
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
        }
    }
}
