plugins {
    id 'com.android.library'
    alias(libs.plugins.kotlinAndroid)
    id 'kotlin-kapt'
    alias(libs.plugins.androidJunit5)
}

android {
    namespace 'com.github.anrimian.musicplayer'

    def config = rootProject.ext

    compileSdkVersion = config.androidCompileSdkVersion
    buildToolsVersion = config.androidBuildToolsVersion
    defaultConfig {
        minSdkVersion config.androidMinSdkVersion
        targetSdkVersion config.androidTargetSdkVersion

        testInstrumentationRunner config.testInstrumentationRunner
        testInstrumentationRunnerArguments["runnerBuilder"] = config.testJunit5Builder

        resourceConfigurations += ['en', 'be', 'cs', 'de', 'el', 'es', 'fr', 'in', 'pt', 'ru', 'tr', 'uk', 'ko', 'zh-Hans', 'zh-Hant']
    }
    buildTypes {
        release {
            minifyEnabled false
            consumerProguardFiles 'proguard-rules.pro'
        }
        QA {
            initWith release
        }
        debug {
            minifyEnabled false
        }
    }
    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'
            ]
        }
    }
    lint {
        abortOnError false
    }
}


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

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

    implementation libs.kotlinStdLib

    implementation libs.appCompat
    implementation libs.appCompatResources
    implementation libs.material
    implementation libs.recyclerView
    implementation libs.constraintLayout
    implementation libs.supportMedia

    implementation libs.rxAndroid

    implementation libs.coroutinesAndroid

    implementation libs.moxy
    implementation libs.moxyAppcompat
    implementation libs.moxyMaterial
    implementation libs.moxyKtx
    kapt libs.moxyCompiler

    implementation libs.dagger
    kapt libs.daggerCompiler

    implementation libs.room
    kapt libs.roomCompiler

    implementation libs.glide
    kapt libs.glideCompiler

    implementation libs.slidr

    implementation libs.chipsLayoutManager

    implementation libs.rotateLayout

    compileOnly libs.javaxAnnotation

    testImplementation libs.junit5
    testImplementation libs.junit5Params
    testRuntimeOnly libs.junit5Engine
    testImplementation libs.mockito

    androidTestImplementation libs.androidXTestRunner
    androidTestImplementation libs.espresso
}