apply plugin: 'com.android.library'

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

def DEFAULT_COMPILE_SDK_VERSION   = 27
def DEFAULT_TARGET_SDK_VERSION    = 27
def DEFAULT_MIN_SDK_VERSION       = 16
def GLIDE_VERSION = safeExtGet("glideVersion", "4.11.0")
def PICTURE_VERSION = safeExtGet("pictureVersion", "v2.7.3-rc08")

android {
    compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
    buildToolsVersion = '28.0.3'

    defaultConfig {
        minSdkVersion rootProject.hasProperty('minSdkVersion') ? rootProject.minSdkVersion : DEFAULT_MIN_SDK_VERSION
        targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
        versionCode 1
    }
    lintOptions {
        abortOnError false
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation 'com.facebook.react:react-native:+'
    implementation "io.github.lucksiege:pictureselector:${PICTURE_VERSION}"
    implementation "com.github.bumptech.glide:glide:${GLIDE_VERSION}"
}
