plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.kotlinAndroid)
    id 'kotlin-kapt'
}

android {

    signingConfigs {
        test {
            keyAlias '123456'
            keyPassword '123456'
            storeFile file("test.jks")
            storePassword '123456'
        }
    }

    namespace 'com.github.anrimian.musicplayer.lite'

    def config = rootProject.ext

    compileSdk config.androidCompileSdkVersion

    defaultConfig {
        minSdkVersion config.androidMinSdkVersion
        targetSdkVersion config.androidTargetSdkVersion

        applicationId 'com.github.anrimian.musicplayer'
        versionCode 181
        versionName "0.9.8.2"
        testInstrumentationRunner config.testInstrumentationRunner
        testApplicationId "${applicationId}.test"
        base.archivesName = "$applicationId-v$versionName-b$versionCode"
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro', 'proguard-rules-lite.pro'
        }
        QA {
            initWith release
            signingConfig signingConfigs.test
            applicationIdSuffix ".QA"
        }
        debug {
            minifyEnabled false
            shrinkResources false
            applicationIdSuffix ".debug"
        }
    }
    buildFeatures {
        viewBinding true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }
    packagingOptions {
        jniLibs {
            excludes += ['**/kotlin/**']
        }
        resources {
            excludes += [
                    '/META-INF/*.kotlin_module',
                    '**/kotlin/**',
                    '**/*.txt',
                    '**/*.xml',
                    '/*.properties',
                    'DebugProbesKt.bin'
            ]
        }
    }
}

dependencies {
    implementation project(':domain')
    implementation project(':data')
    implementation project(':app')

    implementation project(':libs:fsync:core')

    implementation libs.appCompat

    implementation libs.rxAndroid

    implementation libs.coroutinesAndroid

    implementation libs.dagger
    kapt libs.daggerCompiler

    compileOnly libs.javaxAnnotation
}