buildscript {
    if (project == rootProject) {
        repositories {
            google()
        }

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

apply plugin: 'com.android.library'

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

android {
    compileSdkVersion safeExtGet('RNApxorRTMPlugin_compileSdkVersion', 29)
    buildToolsVersion safeExtGet('RNApxorRTMPlugin_buildToolsVersion', '29.0.2')
    defaultConfig {
        minSdkVersion safeExtGet('RNApxorRTMPlugin_minSdkVersion', 16)
        targetSdkVersion safeExtGet('RNApxorRTMPlugin_targetSdkVersion', 29)
        versionCode 1
        versionName "1.0"

    }

    buildTypes {
        release {
            minifyEnabled false
        }
    }
    lintOptions {
        disable 'GradleCompatible'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

repositories {
    mavenLocal()
    maven {
        // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
        url("$rootDir/../node_modules/react-native/android")
    }
    google()
    mavenCentral()
    maven {
        url "https://repo.apxor.com/artifactory/list/libs-release-android/"
        }
  maven { url "https://repo.apxor.com/artifactory/list/libs-qa-android/" }
}

dependencies {
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules

    api 'com.apxor.androidx:apxor-android-sdk-core:3.0.9@aar'
    api 'com.apxor.androidx:apxor-android-sdk-qe:1.7.4@aar'
    api 'com.apxor.androidx:apxor-android-sdk-rtm:2.4.6@aar'
}
