// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

buildscript {
    repositories {
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
    }
}

allprojects {
    repositories {
        jcenter()
        maven { url "$projectDir/../node_modules/react-native/android" }
    }
}

apply plugin: 'com.android.library'

android {
    compileSdkVersion safeExtGet('compileSdkVersion', 28)
    buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')

    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 16)
        targetSdkVersion safeExtGet('targetSdkVersion', 28)
        versionCode 1
        versionName "1.0"
        ndk {
            abiFilters "armeabi-v7a", "x86"
        }
    }
    lintOptions {
        warning 'InvalidPackage'
    }
}

repositories {
    mavenCentral()
    maven {
        url 'https://maven.google.com/'
        name 'Google'
    }
}

dependencies {
    compileOnly "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
    implementation 'io.card:android-sdk:5.5.1'
}
