plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'org.jetbrains.kotlin.plugin.serialization' version '1.4.30'
    id 'androidx.navigation.safeargs.kotlin'
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
    id 'com.google.android.gms.oss-licenses-plugin'
    id 'kotlin-parcelize'
}

android {
    compileSdkVersion Config.compileSdk

    defaultConfig {
        applicationId "dgca.wallet.app.android"
        minSdkVersion Config.minSdk
        targetSdkVersion Config.targetSdk
        versionCode Config.versionCode
        versionName Config.versionName

        testInstrumentationRunner Config.androidTestInstrumentation
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    flavorDimensions "version"

    productFlavors {
        tst {
            dimension "version"
            versionNameSuffix "-tst"
        }

        acc {
            dimension "version"
            versionNameSuffix "-acc"
        }
    }

    compileOptions {
        sourceCompatibility Config.javaVersion
        targetCompatibility Config.javaVersion
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

    buildFeatures {
        viewBinding true
    }

    packagingOptions {
        pickFirst 'META-INF/ASL-2.0.txt'
        pickFirst 'draftv4/schema'
        pickFirst 'draftv3/schema'
        pickFirst 'META-INF/LGPL-3.0.txt'
    }
}

dependencies {
    implementation project(":branches:base")
    implementation project(":branches:dcc")
    implementation project(":branches:icao")
    implementation project(":branches:divoc")
    implementation project(":branches:vc")
    implementation project(":branches:shc")
    implementation project(':decoder')
    implementation project(':engine')

    implementation Deps.kotlin_stdlib
    implementation Deps.androidx_core
    implementation Deps.androidx_appcompat
    implementation Deps.androidx_material
    implementation Deps.androidx_recycler_view
    implementation Deps.androidx_constraint
    implementation Deps.androidx_navigation_fragment
    implementation Deps.androidx_navigation_ui
    implementation Deps.androidx_fragment_ktx
    implementation Deps.room_runtime
    implementation Deps.androidx_worker_ktx
    implementation Deps.room_ktx
    kapt Deps.room_compiler
    implementation Deps.kotlinx_coroutines
    implementation Deps.zxing
    implementation Deps.guava_conflict_resolver
    implementation Deps.biometric
    implementation Deps.jackson_kotlin
    implementation Deps.jackson_datetype
    implementation Deps.android_lifecycle_ktx

    implementation Deps.hilt
    kapt Deps.hilt_compiler
    implementation Deps.hilt_viewmodel
    implementation Deps.hilt_work
    kapt Deps.androidx_hilt_compiler

    implementation Deps.retrofit2
    implementation Deps.retrofit2_converter_scalars
    implementation Deps.log_interceptor
    implementation Deps.gson_converter
    implementation Deps.jackson_kotlin
    implementation Deps.jackson_datetype

    implementation "com.upokecenter:cbor:4.5.1"

    implementation Deps.timber

    testImplementation Deps.test_junit
    testImplementation Deps.mockito_core
    testImplementation Deps.mockito_kotlin
    testImplementation Deps.mockito_inline
    testImplementation Deps.appache_commons

    androidTestImplementation Deps.test_ext
    androidTestImplementation Deps.test_rules

    implementation Deps.bouncy_castle

    implementation Deps.kotlin_stdlib
    implementation Deps.androidx_core
    implementation Deps.kotlinx_coroutines
    implementation Deps.androidx_appcompat
    implementation Deps.androidx_fragment_ktx
    implementation Deps.androidx_material
    implementation Deps.androidx_constraint
    implementation Deps.androidx_navigation_fragment
    implementation Deps.androidx_navigation_ui
    implementation Deps.androidx_worker_ktx
    implementation Deps.fab
    implementation Deps.biometric

    implementation Deps.retrofit2
    implementation Deps.log_interceptor
    implementation Deps.gson_converter
    implementation Deps.jackson_kotlin

    implementation Deps.zxing
    implementation Deps.hilt
    kapt Deps.hilt_compiler
    implementation Deps.hilt_work

    implementation Deps.timber

    testImplementation Deps.test_junit
    androidTestImplementation Deps.test_ext
}
