def DEFAULT_COMPILE_SDK_VERSION = 28
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
def DEFAULT_MIN_SDK_VERSION     = 16
def DEFAULT_TARGET_SDK_VERSION  = 28

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

apply plugin: 'com.android.library'

buildscript {
  // The Android Gradle plugin is only required when opening the android folder stand-alone.
  // This avoids unnecessary downloads and potential conflicts when the library is included as a
  // module dependency in an application project.
  // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
  if (project == rootProject) {
    repositories {
      google()
      jcenter()
    }
    dependencies {
      classpath 'com.android.tools.build:gradle:3.5.3'
    }
  }
}

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)
    versionCode      1
    versionName      "1.0"
  }
  lintOptions {
    abortOnError false
  }
}

repositories {
  jcenter()
}

dependencies {
  implementation 'com.facebook.react:react-native:+'  // From node_modules
  implementation 'com.usebutton:android-sdk:6.+'
}

