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

android {
    compileSdk 31
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.javalon.xpensewhiz"
        minSdk 21
        targetSdk 31
        versionCode 1
        versionName "1.0.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary true
        }

        javaCompileOptions {
            annotationProcessorOptions {
                arguments += [
                        "room.schemaLocation":"$projectDir/schemas".toString(),
                        "room.incremental":"true",
                        "room.expandProjection":"true"]
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion compose_version
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/AL2.0'
        exclude 'META-INF/LGPL2.1'
        exclude "**/attach_hotspot_windows.dll"
        exclude "META-INF/licenses/**"
    }
}

dependencies {

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation "androidx.compose.ui:ui:$compose_version"
    implementation "androidx.compose.material:material:$compose_version"
    implementation("androidx.compose.ui:ui-tooling:$compose_version") {
        version {
            strictly("1.0.0-beta09")
        }
    }
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.1'
    implementation 'androidx.activity:activity-compose:1.6.0-alpha01'
    testImplementation 'junit:junit:4.+'
    testImplementation "org.mockito.kotlin:mockito-kotlin:4.0.0"
    testImplementation "androidx.arch.core:core-testing:2.1.0"
    testImplementation "com.google.truth:truth:1.1.3"
    testImplementation 'app.cash.turbine:turbine:0.7.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation "com.google.truth:truth:1.1.3"
    androidTestImplementation 'app.cash.turbine:turbine:0.7.0'
    androidTestImplementation "androidx.arch.core:core-testing:2.1.0"
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"

    // Navigation Compose
    implementation("androidx.navigation:navigation-compose:2.5.0-alpha03")

    // Pager and Indicators - Accompanist
    implementation "com.google.accompanist:accompanist-pager:$accompanist_version"
    implementation "com.google.accompanist:accompanist-pager-indicators:$accompanist_version"
    implementation "com.google.accompanist:accompanist-flowlayout:$accompanist_version"

    // DataStore Preferences
    implementation("androidx.datastore:datastore-preferences:1.0.0")

    // Dagger - Hilt
    implementation "com.google.dagger:hilt-android:2.38.1"
    kapt "com.google.dagger:hilt-android-compiler:2.38.1"
    kapt 'androidx.hilt:hilt-compiler:1.0.0'
    implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'

    // Compose Constraint Layout
    implementation "androidx.constraintlayout:constraintlayout-compose:1.0.0"

    def room_version = "2.4.2"
    implementation "androidx.room:room-runtime:$room_version"
    implementation "androidx.room:room-ktx:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
    testImplementation "androidx.room:room-testing:$room_version"
    androidTestImplementation "androidx.room:room-testing:$room_version"

    // Gson
    implementation 'com.google.code.gson:gson:2.9.0'

    def work_version = "2.7.1"

    // Kotlin + coroutines
    implementation("androidx.work:work-runtime-ktx:$work_version")

    // sentry sdk
    implementation 'io.sentry:sentry-android:5.7.3'

}