apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION          = 29
def DEFAULT_BUILD_TOOLS_VERSION          = "29.0.2"
def DEFAULT_MIN_SDK_VERSION              = 16
def DEFAULT_TARGET_SDK_VERSION           = 29
def DEFAULT_GOOGLE_PLAY_SERVICES_VERSION = "18.0.0"

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 safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
    targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
  }

  lintOptions {
    abortOnError false
  }
}

dependencies {
  def googlePlayServicesVersion = safeExtGet('googlePlayServicesVersion', DEFAULT_GOOGLE_PLAY_SERVICES_VERSION)
  googlePlayServicesVersion = safeExtGet('playServicesVersion', googlePlayServicesVersion)
  googlePlayServicesVersion = safeExtGet('playServicesLocationVersion', googlePlayServicesVersion)

  implementation "com.facebook.react:react-native:+"
  implementation 'androidx.appcompat:appcompat:1.0.2'
  implementation "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
}
