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

buildscript {
    ext {
        minSdkVersion = 21
        targetSdkVersion = 26
        targetSdkVersionForGooglePlay = 28
        compileSdkVersion = 28
    }
    repositories {
        google()
        jcenter()
        mavenLocal()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:3.4.2")

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        maven {
            url 'https://maven.google.com'
        }
        maven {
            url "https://jitpack.io"
        }
        google()
        jcenter()
    }
}

subprojects { subproject ->
    afterEvaluate {
        if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                variantFilter { variant ->
                    def names = variant.flavors*.name
                    if (names.contains("reactNative51")) setIgnore(true)
                    if (names.contains("reactNative55")) setIgnore(true)
                    if (names.contains("reactNative56")) setIgnore(true)
                    if (names.contains("reactNative57")) setIgnore(true)
                    if (names.contains("reactNative57_5")) setIgnore(true)
                    if (names.contains("reactNative57WixFork")) setIgnore(true)
                    if (names.contains("reactNative59")) setIgnore(true)
                }
            }
        }
    }
}
