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

    dependencies {
        //noinspection GradleDependency
        classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '3.4.1')}")
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion safeExtGet('compileSdkVersion', 28)
    //noinspection GradleDependency
    buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 16)
        //noinspection OldTargetApi
        targetSdkVersion safeExtGet('targetSdkVersion', 28)
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    mavenLocal()
    google()
    jcenter()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url "$rootDir/../node_modules/react-native/android"
    }
}

dependencies {
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:${safeExtGet('reactnativeVersion', '+')}"
}
