plugins {
    id "com.android.application"
    id "kotlin-android"
    id "kotlin-kapt"
    id "dagger.hilt.android.plugin"
}

android {
    compileSdkVersion 31
    buildToolsVersion "31.0.0"

    defaultConfig {
        applicationId "com.rtbishop.look4sat"
        minSdkVersion 21
        resConfigs "en,ru"
        targetSdkVersion 31
        versionCode 255
        versionName "2.5.5"

        kapt {
            arguments {
                arg("room.schemaLocation", "$projectDir/schemas")
                arg("room.incremental", "true")
                arg("room.expandProjection", "true")
            }
        }
    }

//    def props = new Properties()
//    file("../securityKeys.properties").withInputStream { props.load(it) }

    buildTypes {
        release {
//            buildConfigField "String", "ApiKey", props.getProperty("apiKey")
//            minifyEnabled true
//            shrinkResources true
//            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            postprocessing {
                removeUnusedCode true
                removeUnusedResources true
                obfuscate false
                optimizeCode true
            }
        }
    }
    buildFeatures {
        viewBinding true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    kotlinOptions {
        jvmTarget = "$jvm_version"
    }
}

dependencies {
    implementation project(':core')
    implementation "com.google.android.material:material:$material_version"
    implementation "androidx.core:core-splashscreen:$splash_screen_version"
    implementation "androidx.constraintlayout:constraintlayout:$constraint_layout_version"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
    implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
    implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
    implementation "androidx.preference:preference-ktx:$preference_version"
    implementation "androidx.room:room-runtime:$room_version"
    implementation "androidx.room:room-ktx:$room_version"
    kapt "androidx.room:room-compiler:$room_version"

    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-android-compiler:$hilt_version"

    implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
    implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"

    implementation "org.osmdroid:osmdroid-android:$osmdroid_version"
    implementation "com.jakewharton.timber:timber:$timber_version"

    testImplementation "junit:junit:$junit_version"
    testImplementation "org.mockito:mockito-android:$mockito_version"
    testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version"
    debugImplementation "com.squareup.leakcanary:leakcanary-android:$leak_canary_version"
}
