/*
 * Copyright (c) 2018.
 *
 * This file is part of MoneyWallet.
 *
 * MoneyWallet is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * MoneyWallet is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with MoneyWallet.  If not, see <http://www.gnu.org/licenses/>.
 */

apply plugin: 'com.android.application'

android {
    compileSdkVersion 29
    defaultConfig {
        applicationId "com.oriondev.moneywallet"
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 75
        versionName "4.0.5.10"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        testInstrumentationRunnerArguments clearPackageData: 'true'
        multiDexEnabled true
        manifestPlaceholders = [
                DropBoxApiKey: ApiKey_Dropbox.replaceAll('"', ''),
                GoogleApiKey : ApiKey_Google
        ]
        buildConfigField('String', 'API_KEY_DROPBOX', ApiKey_Dropbox)
        buildConfigField('String', 'API_KEY_OPEN_EXCHANGE_RATES', ApiKey_OpenExchangeRates)
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            applicationIdSuffix ".dev"
            debuggable true
        }
    }
    flavorDimensions "version", "map"
    productFlavors {
        // version
        proprietary {
            dimension "version"
        }
        floss {
            dimension "version"
        }
        // map
        gmap {
            dimension "map"
        }
        osm {
            dimension "map"
        }
    }
    // test libraries
    useLibrary 'android.test.runner'
    useLibrary 'android.test.base'
    useLibrary 'android.test.mock'
}

configurations {
    all {
        exclude module: 'commons-logging'
    }
}

dependencies {
    // common dependencies
    implementation supportDependencies.appcompat
    implementation supportDependencies.constraintlayout
    implementation supportDependencies.recyclerview
    implementation supportDependencies.cardview
    implementation supportDependencies.annotations
    implementation supportDependencies.design
    implementation supportDependencies.preference
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
    implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
    implementation('com.mikepenz:materialdrawer:6.0.8@aar') {
        transitive = true
    }
    implementation 'com.pnikosis:materialish-progress:1.7'
    implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.1'
    implementation('com.philliphsu:bottomsheetpickers:2.4.1') {
        exclude group: 'com.android.support', module: 'appcompat-v7'
        exclude group: 'com.android.support', module: 'design'
    }
    implementation 'com.github.florent37:expansionpanel:1.1.1'
    implementation 'commons-io:commons-io:2.6'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.activity:activity:1.2.0-alpha08'
    implementation 'androidx.fragment:fragment:1.3.0-alpha08'
    implementation 'net.lingala.zip4j:zip4j:1.3.2'
    implementation 'com.github.daniel-stoneuk:material-about-library:2.2.4'
    implementation 'com.github.apl-devs:appintro:v4.2.3'
    implementation 'com.andrognito.pinlockview:pinlockview:2.1.0'
    implementation 'com.andrognito.patternlockview:patternlockview:1.0.0'
    implementation 'com.multidots:fingerprint-auth:1.0.1'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    implementation 'com.github.ronaldsmartin:Material-ViewPagerIndicator:1.0.4'
    implementation 'com.jaredrummler:material-spinner:1.2.5'
    implementation 'org.dmfs:lib-recur:0.11.1'
    implementation 'com.opencsv:opencsv:4.4'
    implementation 'net.sourceforge.jexcelapi:jxl:2.6.12'
    implementation 'com.itextpdf:itextpdf:5.5.13'
    implementation 'me.weishu:free_reflection:2.2.0'
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
    // google play dependencies
    proprietaryImplementation('com.dropbox.core:dropbox-core-sdk:3.0.8')
    proprietaryImplementation googlePlayServices.auth
    proprietaryImplementation googlePlayServices.signin
    proprietaryImplementation googlePlayServices.drive
    // google-map dependencies
    gmapImplementation googlePlayServices.places
    // floss dependencies
    osmImplementation 'org.osmdroid:osmdroid-android:6.1.1'
    // test dependencies (local tests)
    testImplementation 'junit:junit:4.12'
    testImplementation 'org.mockito:mockito-core:3.6.28'
    // android test dependencies (on-device tests)
    androidTestImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:core:1.2.0'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test:rules:1.2.0'
    androidTestUtil "androidx.test:orchestrator:1.2.0"
}