buildscript {
    repositories {
        jcenter()
        google()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.3'
    }
}

apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION = 27
def DEFAULT_BUILD_TOOLS_VERSION = "27.0.3"
def DEFAULT_TARGET_SDK_VERSION = 27
def DEFAULT_SUPPORT_LIBRARY_VERSION = "27.1.1"

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

    //use legacy for android 6.0
    useLibrary 'org.apache.http.legacy'

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
        versionCode 1
        versionName "1.0.0"
    }
    lintOptions {
        abortOnError false
        warning 'InvalidPackage'
    }
}

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

dependencies {
    def supportLibVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIBRARY_VERSION
    api fileTree(dir: 'libs', include: ['*.jar'])
    api 'com.facebook.react:react-native:+'
    implementation "androidx.annotation:annotation:1.0.0"
}
