buildscript {
    ext {
        kotlinVersion = '1.6.0'
        buildToolsVersion = '29.0.2'
        compileSdkVersion = 29
        targetSdkVersion = 29
        minSdkVersion = 18
    }
    ext.detoxKotlinVersion = ext.kotlinVersion

    repositories {
        mavenCentral()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

def DEFAULT_COMPILE_SDK_VERSION = 28
def DEFAULT_BUILD_TOOLS_VERSION = "28.0.3"
def DEFAULT_TARGET_SDK_VERSION = 28

def safeExtGet(prop, fallback) {
    rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
    compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
    buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    mavenCentral()
}

def _ext = ext

def _kotlinVersion = _ext.has('detoxKotlinVersion') ? _ext.detoxKotlinVersion : '1.3.10'
def _kotlinStdlib = _ext.has('detoxKotlinStdlib') ? _ext.detoxKotlinStdlib : 'kotlin-stdlib-jdk8'

dependencies {
    implementation "androidx.core:core-ktx:1.0.1"

    implementation 'com.facebook.react:react-native:+'

    implementation "org.jetbrains.kotlin:$_kotlinStdlib:$_kotlinVersion"

    implementation 'net.gotev:uploadservice-okhttp:4.7.0'

    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0'
}
