/*
 *  ---license-start
 *  eu-digital-green-certificates / dcc-revocation-app
 *  ---
 *  Copyright (C) 2021 T-Systems International GmbH and all other contributors
 *  ---
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  ---license-end
 *
 *  Created by mykhailo.nester on 23/12/2021, 13:49
 */

plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'dagger.hilt.android.plugin'
    id 'kotlin-parcelize'
}

android {
    compileSdkVersion Config.compileSdk

    defaultConfig {
        minSdkVersion Config.minSdk
        targetSdkVersion Config.targetSdk
        versionCode Config.versionCode
        versionName Config.versionName

        testInstrumentationRunner Config.androidTestInstrumentation
        consumerProguardFiles Config.proguardConsumerRules

        buildConfigField "String", "REVOCATION_APP_VERSION", "\"1.0.0\""
    }

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

    flavorDimensions "version", "revocationDataSliceType"
    productFlavors {
        tst {
            dimension "version"
        }
        acc {
            dimension "version"
        }
        bloom {
            dimension "revocationDataSliceType"
        }
        hash {
            dimension "revocationDataSliceType"
        }
    }

    compileOptions {
        sourceCompatibility Config.javaVersion
        targetCompatibility Config.javaVersion
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {

    implementation Deps.androidx_core
    implementation Deps.androidx_appcompat
    implementation Deps.androidx_material
    implementation Deps.androidx_constraint
    implementation Deps.androidx_worker_ktx
    implementation Deps.kotlinx_coroutines
    implementation Deps.room_runtime
    implementation Deps.room_ktx

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

    implementation Deps.retrofit2
    implementation Deps.log_interceptor
    implementation Deps.gson_converter
    implementation Deps.gson


    implementation Deps.kotlin_reflect
    implementation Deps.java_cose
    implementation(Deps.json_validation) {
        exclude group: "org.mozilla", module: "rhino"
    }

    implementation Deps.jackson_cbor
    implementation Deps.bouncy_castle
    implementation Deps.appache_compress

    implementation Deps.timber

    testImplementation group: 'com.googlecode.json-simple', name: 'json-simple', version: '1.1.1'
    testImplementation Deps.test_junit
    testImplementation Deps.mockito_core
    testImplementation Deps.mockito_kotlin
}
