apply plugin: 'com.android.library'

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

android {
    compileSdkVersion safeExtGet("compileSdkVersion", 33)
    buildToolsVersion safeExtGet("buildToolsVersion", '33.0.1')

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    // The version of react-native is set by the React Native Gradle Plugin
    // implementation("com.facebook.react:react-android")

    implementation("com.facebook.react:react-native")

    implementation 'com.github.vietmap-company:maps-sdk-android:2.6.0'

    implementation 'com.github.vietmap-company:vietmap-services-turf-android:1.0.2'
    // Dependencies
    implementation "com.android.support:support-vector-drawable:${safeExtGet('supportLibVersion', '28.0.0')}"
    implementation "com.android.support:support-annotations:${safeExtGet('supportLibVersion', '28.0.0')}"
    implementation "com.android.support:appcompat-v7:${safeExtGet('supportLibVersion', '28.0.0')}"
    implementation "com.squareup.okhttp3:okhttp:${safeExtGet('okhttpVersion', '4.9.0')}"
    implementation "com.squareup.okhttp3:okhttp-urlconnection:${safeExtGet('okhttpVersion', '4.9.0')}"
    implementation("com.github.vietmap-company:maps-sdk-plugin-annotation-android:1.0.0")
    implementation('com.github.vietmap-company:vietmap-services-plugin-markerview:1.0.3')
    implementation('com.github.vietmap-company:maps-sdk-plugin-localization-android:1.0.0')
    implementation('com.github.vietmap-company:maps-sdk-plugin-localization-android:2.0.0')
    implementation 'com.github.vietmap-company:vietmap-services-geojson-android:1.0.0'
    implementation 'com.google.code.gson:gson:2.10.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
}

allprojects {
    repositories {
        maven {
            url = "https://jitpack.io"
        }
    }
}