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

buildscript {

	ext {
		buildToolsVersion = "30.0.3"
		minSdkVersion = project.hasProperty('minSdkVersion') ? project.getProperty('minSdkVersion') : 23
        compileSdkVersion = 30
        targetSdkVersion = 30
		kotlin_version = "1.3.50"
		kotlinVersion = "$kotlin_version"
	}
	repositories {
		google()
		mavenCentral()
		gradlePluginPortal()
	}

	dependencies {
		classpath('com.android.tools.build:gradle:4.2.2')
		classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
		// NOTE: Do not place your application dependencies here; they belong
		// in the individual module build.gradle files
	}
}

allprojects {
	repositories {
		mavenLocal()
		maven {		// Replace AAR from original RN with AAR from react-native-v8
			url("$rootDir/../node_modules/react-native-v8/dist")
		}
		maven {
			// prebuilt libv8android.so
			url("$rootDir/../node_modules/v8-android/dist")
		}
		maven {
			// All of Detox' artifacts are provided via the npm module
			url "$rootDir/../node_modules/detox/Detox-android"
		}
		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")
        }
		google()
		mavenCentral()
		maven { url 'https://www.jitpack.io' }
		gradlePluginPortal()
	}

	subprojects {
		afterEvaluate {
			project ->
				if (project.hasProperty("android")) {
					android {
						compileSdkVersion = rootProject.ext.compileSdkVersion
					}
				}
		}
	}
}
