import org.apache.tools.ant.taskdefs.condition.Os
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "35.0.0"
        minSdkVersion = 24
        compileSdkVersion = 35
        targetSdkVersion = 35
        ndkVersion = "27.1.12297006"
        kotlinVersion = "2.1.20"
        androidXCore = "1.0.2"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
        classpath 'com.google.gms:google-services:4.4.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.8.1'
    }
}

allprojects {
    repositories {
        maven {
            url "$rootDir/../../../node_modules/detox/Detox-android"
        }
        // this is how Notifee finds it's Android library:
        maven {
            url "$rootDir/../node_modules/@notifee/react-native/android/libs"
        }
    }
}

project(':app') {
    afterEvaluate {
        if (tasks.findByName("preBuild")) {
            tasks.preBuild.doFirst {
                exec {
                    workingDir rootDir
                    commandLine './gradlew', 'generateCodegenArtifactsFromSchema'
                }
            }
        }
    }
}

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