buildscript {
    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" }
        maven { url "https://jitpack.io" }
        google()

    }

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

}

plugins {
    id 'maven-publish'
    id "com.github.hierynomus.license" version "0.16.1"
}

allprojects {
    apply plugin: "com.github.hierynomus.license"

    license {
        header rootProject.file('LICENSE_HEADER')
        strictCheck true
        include "**/*.java"
        include "**/*.xml"
        include "**/*.html"
        exclude "**/MoreObjects.java"
        exclude "**/Preconditions.java"
    }

    repositories {
        mavenLocal()
        mavenCentral()
        maven { url "https://plugins.gradle.org/m2/" }
        maven { url "https://jitpack.io" }
        google()
        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 = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
            }
        }
    }
}

ext {
    androidPlugin = 'com.android.tools.build:gradle:3.1.2'
    minSdkVersion = 24
    compileSdkVersion = 33
    targetSdkVersion = 33
    buildToolsVersion = '30.0.2'
    versionCode = 64
    versionName = "2.2.10"
    ndkVersion = "21.4.7075529"

    javaCompileVersion = JavaVersion.VERSION_1_8

    // Android dependencies.
    supportV4 = 'androidx.legacy:legacy-support-v4:1.0.0'
    supportV7 = 'androidx.appcompat:appcompat:1.2.0'
    supportDesign = 'com.google.android.material:material:1.3.0'
    supportCardview = 'androidx.cardview:cardview:1.0.0'
    supportRecyclerview = 'androidx.recyclerview:recyclerview:1.2.0'
    supportConstraintLayout = 'androidx.constraintlayout:constraintlayout:2.0.1'

    androidxPreference = 'androidx.preference:preference:1.1.1'
    androidRoom = 'androidx.room:room-runtime:2.2.5'
    androidRoomRxJava = 'androidx.room:room-rxjava2:2.2.5'
    supportRoom = 'androidx.room:room-compiler:2.2.5'


    def lifecycle_version = "2.2.0"
    supportLifecycleExtension = "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    supportLifecycleRuntime = "androidx.lifecycle:lifecycle-runtime:$lifecycle_version"
    supportLifecycleCompiler = "androidx.lifecycle:lifecycle-compiler:$lifecycle_version"

    // database dependencies
    def sqlite_version = "2.1.0"
    supportSqlite = "androidx.sqlite:sqlite:$sqlite_version"
    supportSqliteFramework = "androidx.sqlite:sqlite-framework:$sqlite_version"
    sqlBrite = 'com.squareup.sqlbrite3:sqlbrite:3.2.0'

    // Dependency injection, view injection, event bus...
    dagger = 'com.google.dagger:dagger:2.35.1'
    daggerCompiler = 'com.google.dagger:dagger-compiler:2.35.1'
    butterKnife = 'com.jakewharton:butterknife:10.2.3'
    butterknifeCompiler = 'com.jakewharton:butterknife-compiler:10.2.3'
    otto = 'com.squareup:otto:1.3.8'

    // Retrofit2 dependencies.
    def retrofit_version = "2.6.1"
    retrofit2 = "com.squareup.retrofit2:retrofit:$retrofit_version"
    retrofitGson2 = "com.squareup.retrofit2:converter-gson:$retrofit_version"
    retrofitAdapters2 = "com.squareup.retrofit2:retrofit-adapters:$retrofit_version"
    retrofitRxJava2 = "com.squareup.retrofit2:adapter-rxjava2:$retrofit_version"

    // RxJava dependencies.
    rxJava = 'io.reactivex.rxjava2:rxjava:2.2.21'
    rxAndroid = 'io.reactivex.rxjava2:rxandroid:2.1.1'
    rxPreferences = 'com.f2prateek.rx.preferences2:rx-preferences:2.0.1'

    // RxBindings
    def rxbinding_version = "3.1.0"
    rxBindingCore = "com.jakewharton.rxbinding3:rxbinding-core:$rxbinding_version"
    rxBindingAppCompat = "com.jakewharton.rxbinding3:rxbinding-appcompat:$rxbinding_version"


    // Google dependencies
    gson = 'com.google.code.gson:gson:2.8.6'
    //guava = 'com.google.guava:guava:18.0'
    findBugs = 'com.google.code.findbugs:jsr305:3.0.2'
    playServicesLocation = 'com.google.android.gms:play-services-location:18.0.0'
    playCore =  'com.google.android.play:core:1.10.0'

    //acra
    acra = 'ch.acra:acra-core:5.7.0'

    // other third party dependencies.
    materialDialogs = 'com.afollestad.material-dialogs:core:0.9.6.0'
    helloCharts = 'com.github.lecho:hellocharts-library:1.5.8@aar'
    fabProgressCircle = 'com.github.jorgecastilloprz:fabprogresscircle:1.01'
    mapbox = 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'
    segmentedUIController = 'info.hoang8f:android-segmented:1.0.6'
    apacheCommons = 'org.apache.commons:commons-compress:1.20'
    openCSVReader = 'com.opencsv:opencsv:4.6'

    // Testing
    junit = 'junit:junit:4.13.2'

}
