group 'com.mapbox.mapboxgl'
version '1.0-SNAPSHOT'

buildscript {
    repositories {
        google()
        mavenCentral()
    }

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

rootProject.allprojects {
    def token = System.getenv('SDK_REGISTRY_TOKEN') ?: project.properties['MAPBOX_DOWNLOADS_TOKEN']
    if (token == null || token.empty) {
        throw new Exception("SDK Registry token is null. See README.md for more information.")
    }
    repositories {
        google()
        mavenCentral()
        maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                username = "mapbox"
                password = token
            }
        }
    }
}

apply plugin: 'com.android.library'

android {
    namespace "com.mapbox.mapboxgl"
    compileSdkVersion 31
    ndkVersion "20.1.5948944"

    defaultConfig {
        minSdkVersion 20
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }
    lintOptions {
        disable 'InvalidPackage'
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    dependencies {
        implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:9.6.2"
        implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v9:0.9.0"
        implementation "com.mapbox.mapboxsdk:mapbox-android-plugin-localization-v9:0.12.0"
        implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-offline-v9:0.7.0'
        implementation 'com.squareup.okhttp3:okhttp:4.9.0'
        implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:5.1.0'
    }
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}
