apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "com.aplusinformatique.aplusmanager"
        minSdkVersion 16
        targetSdkVersion 28
        versionCode 31
        versionName "1.13.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        // setting custom name for apk
        project.ext.set("archivesBaseName", "AplusManager-" + defaultConfig.versionName + "-v" + defaultConfig.versionCode)
    }
    signingConfigs {
        release {
            storeFile file('C:\\Android_signature_APK\\DISTRIMOBILE.jks')
            storePassword "aplus9406"
            keyAlias "manager"
            keyPassword "aplus9406"
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
    flavorDimensions "client"
    productFlavors {
        aplus {
            dimension "client"
        }
        guisnel {
            dimension "client"
        }
    }
    variantFilter { variant ->
        def namesFlavor = variant.flavors*.name
        def namesBuild = variant.buildType.name
        if (namesFlavor.contains("guisnel") && namesBuild.contains("debug")) {
            setIgnore(true)
        }
    }
    // Added to be able to use the OkHttp lib
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

ext {
    roomVersion = '2.2.5'
    playServicesMaps = '17.0.0'
}

dependencies {
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation files('libs/Honeywell.jar')
    implementation files('libs/device.sdk.jar')
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation "com.google.android.gms:play-services-maps:$playServicesMaps"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.intentfilter:android-permissions:2.0.49'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.koushikdutta.ion:ion:2.2.1'
    implementation 'com.jaredrummler:android-processes:1.0.9'
    implementation 'com.google.android.material:material:1.1.0'

    // Use Retrofit for API interaction
    implementation 'com.squareup.retrofit2:retrofit:2.8.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.14.2'

    // Room components
    implementation "androidx.room:room-runtime:$roomVersion"
    annotationProcessor "androidx.room:room-compiler:$roomVersion"

    //Sygic
    implementation project(path: ':RemoteApi')
}
