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()
            mavenCentral()
        }
        dependencies {
            // This should reflect the Gradle plugin version used by
            // the minimum React Native version supported.
            classpath 'com.android.tools.build:gradle:3.4.1'
        }
    }
}

rootProject.allprojects {
    repositories {
        mavenCentral()
        google()
        maven {
            url 'https://gitlab.com/api/v4/projects/25706948/packages/maven'
        }
    }
}

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

android {
    compileSdkVersion safeExtGet('compileSdkVersion', 28)


    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 16)
        targetSdkVersion safeExtGet('targetSdkVersion', 28)
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled true
            consumerProguardFiles 'consumer-rules.pro'
        }
    }
}

dependencies {
    implementation 'com.facebook.react:react-native:+'
    implementation 'in.slanglabs.assistants:slang-retail-assistant:8.9.2'
}