buildscript {
    ext.safeExtGet = { prop, fallback ->
        return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
    }

    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet('kotlinVersion', '1.5.0')}"
    }
}

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

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

android {
    compileSdkVersion 32
    // buildToolsVersion safeExtGet('buildToolsVersion', '30.0.3')

    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', "23")
        targetSdkVersion safeExtGet('targetSdkVersion', "32")
    }
}

repositories {
    google()
    jcenter()
    mavenCentral()
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib:${safeExtGet('kotlinVersion', '1.5.0')}"
    //noinspection GradleDynamicVersion
    implementation 'com.facebook.react:react-native:+'
}
