buildscript {
    ext {
        minSdkVersion = 29
        compileSdkVersion = 32
        targetSdkVersion = 32
        ndkVersion = "23.1.7779620"
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        //noinspection AndroidGradlePluginVersion
        classpath('com.android.tools.build:gradle:7.2.1')
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

def isNewArchitectureEnabled() {
    return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
}

apply plugin: 'com.android.library'

if (isNewArchitectureEnabled()) {
    apply plugin: 'com.facebook.react'
}

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

android {
    namespace 'com.qliktrialreactnativestraighttable'
    compileSdkVersion safeExtGet('compileSdkVersion', 32)
    defaultConfig {
        minSdkVersion safeExtGet('minSdkVersion', 29)
        targetSdkVersion safeExtGet('targetSdkVersion', 32)
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
        }
    }
    lintOptions {
        baseline file("lint-baseline.xml")
        disable 'GradleDependency'
        checkDependencies true
        ignoreTestSources true
        abortOnError false
        warningsAsErrors true
        textReport true
    }
}

repositories {
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
        mavenCentral {
            // We don't want to fetch react-native from Maven Central as there are
            // older versions over there.
            content {
                excludeGroup "com.facebook.react"
            }
        }
        google()
        maven { url 'https://www.jitpack.io' }
}

dependencies {
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'com.caverock:androidsvg-aar:1.4'
    implementation 'com.github.bumptech.glide:glide:4.14.2'
}
