repositories {
    mavenCentral()
	def MAPBOX_DOWNLOADS_TOKEN =  project.hasProperty("MAPBOX_DOWNLOADS_TOKEN") ? project.MAPBOX_DOWNLOADS_TOKEN : "$System.env.MAPBOX_DOWNLOADS_TOKEN"
    maven {
      url 'https://api.mapbox.com/downloads/v2/releases/maven'
      authentication {
          basic(BasicAuthentication)
      }
      credentials {
        // Do not change the username below.
        // This should always be `mapbox` (not your username). 
          username = 'mapbox'
          // Use the secret token you stored in gradle.properties as the password
          password = MAPBOX_DOWNLOADS_TOKEN
      }
    }
}

// see https://www.mapbox.com/android-sdk/
dependencies {
	def mapboxVersion =  project.hasProperty("mapboxVersion") ? project.mapboxVersion : "11.16.2"
	def mapboxServicesVersion =  project.hasProperty("mapboxServicesVersion") ? project.mapboxServicesVersion : "7.8.0"
	def mapboxPluginsVersion =  project.hasProperty("mapboxPluginsVersion") ? project.mapboxPluginsVersion : "v9"
	def mapboxAnnotationPluginVersion =  project.hasProperty("mapboxAnnotationPluginVersion") ? project.mapboxAnnotationPluginVersion : "0.9.0"
	def okHttpVersion =  project.hasProperty("okHttpVersion") ? project.okHttpVersion : "4.9.0"

    println "com.mapbox.maps:android:$mapboxVersion"

    // Core Mapbox Maps SDK v11+. For now use ndk27 to support 16Kb
    implementation "com.mapbox.maps:android-ndk27:$mapboxVersion"

    // GeoJSON / Annotations support (choose correct module name & version)
    implementation "com.mapbox.mapboxsdk:mapbox-sdk-geojson:$mapboxServicesVersion"  // example version
    // implementation "com.mapbox.plugin:maps-annotation:$mapboxVersion"  // plugin example

    // Additional plugins: e.g., location component, gestures, etc.  
    // implementation "com.mapbox.plugin:maps-locationcomponent:$mapboxVersion"
    // implementation "com.mapbox.plugin:maps-gestures:$mapboxVersion"

    implementation "com.squareup.okhttp3:okhttp:$okHttpVersion"

    // If you need Mapbox Search or Navigation SDKs, add here 
    // implementation "com.mapbox.search:autofill:1.0.0-beta.39"
    // implementation "com.mapbox.navigation:android:3.0.0"

}

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}
