// Apply the Android plugin to Gradle and make the "android" block available
apply plugin: 'com.android.application'

// Build options
android
{
    // API level used to compile the application
    compileSdk var_compile_sdk

    defaultConfig
    {
        // Application identifier
        applicationId var_package
        namespace var_package

        // Minimum API required and API used for compilation
        minSdkVersion var_min_sdk
        targetSdkVersion var_compile_sdk

        // Versioning
        versionCode 70
        versionName "v7.8.2"
    }

    buildTypes
    {
        debug
        {
            // Allow usage of the version name in XML
            resValue "string", "app_version", "${defaultConfig.versionName}.dbg"
        }
        release
        {
            // Enable code shrinking, obfuscation and optimization to lower APK size
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

            // Allow usage of the version name in XML
            resValue "string", "app_version", "${defaultConfig.versionName}"
        }
    }

    buildFeatures
    {
        // Allow usage of BuildConfig.DEBUG in logging methods of Utils.java
        buildConfig = true
    }
}

// External requirements
dependencies
{
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.recyclerview:recyclerview:1.3.2'
    implementation('androidx.preference:preference:1.2.1') {
                // Workaround for bug https://issuetracker.google.com/issues/238425626
                exclude group: 'androidx.lifecycle', module:'lifecycle-viewmodel'
                exclude group: 'androidx.lifecycle', module:'lifecycle-viewmodel-ktx'
            }
}
