configureAndroidApp(project)

apply plugin: 'kotlin-kapt'

android {
    namespace 'com.badoo.ribs.sandbox'
    compileSdk 34

    defaultConfig {
        applicationId "com.badoo.ribs.sandbox"
        minSdk deps.build.minSdk
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    }

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

    buildFeatures {
        compose true
    }

    composeOptions {
        kotlinCompilerExtensionVersion = deps.versions.composeCompiler
    }
    packagingOptions {
        jniLibs {
            excludes += ['META-INF/**']
        }
        resources {
            excludes += [
                'META-INF/**',
                'META-INF/licenses/ASM',
                'win32-x86/attach_hotspot_windows.dll',
                'win32-x86-64/attach_hotspot_windows.dll'
            ]
        }
    }
}

dependencies {
    compileOnly deps.apt.javax

    implementation deps.android.appCompat
    implementation deps.android.constraintLayout
    implementation deps.android.design
    implementation deps.android.percent

    implementation deps.external.dagger
    implementation deps.external.mviCore
    implementation deps.external.mviCoreAndroid
    implementation deps.external.mviCoreBinder
    implementation deps.external.rxrelay3
    implementation deps.external.rxandroid3
    implementation deps.external.leakCanary // use debugImplementation in real life apps

    implementation platform(deps.compose.bom)
    implementation "androidx.compose.runtime:runtime"
    implementation "androidx.compose.ui:ui"
    implementation "androidx.compose.material:material"
    implementation "androidx.compose.ui:ui-tooling"
    debugImplementation "androidx.compose.ui:ui-tooling-preview"
    debugImplementation "androidx.compose.ui:ui-test-manifest"
    implementation "androidx.compose.foundation:foundation"

    implementation project(":libraries:rib-base")
    implementation project(":libraries:rib-compose")
    implementation project(":libraries:rib-debug-utils")
    implementation project(":libraries:rib-mvicore")
    implementation project(':libraries:rib-portal-rx3')
    implementation project(':libraries:rib-rx3')

    junitTestImplementation(project)
    testImplementation deps.external.roboelectricBase
    testImplementation deps.test.mockitoKotlin
    testImplementation deps.test.assertj
    testImplementation project(":libraries:rib-base-test")
    testImplementation project(':libraries:rib-base-test-rx3')

    junitAndroidTestImplementation(project)
    androidTestImplementation platform(deps.compose.bom)
    androidTestImplementation project(":libraries:rib-base-test")
    androidTestImplementation deps.androidTest.espresso
    androidTestImplementation deps.androidTest.rules
    androidTestImplementation deps.androidTest.runner
    androidTestImplementation deps.test.mockitoKotlin
    androidTestImplementation "androidx.compose.ui:ui-test"
    androidTestImplementation "androidx.compose.ui:ui-test-junit4"

    debugImplementation project(":libraries:rib-base-test-activity")
}

repositories {
    mavenCentral()
}
