plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'dagger.hilt.android.plugin'
    id 'com.google.devtools.ksp'
}

android {
    compileSdk 34

    defaultConfig {
        applicationId "com.aregyan.compose"
        minSdk 23
        targetSdk 34
        versionCode 1
        versionName "1.0"

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        compose true
        buildConfig = true
    }
    composeOptions {
        kotlinCompilerExtensionVersion = "1.5.8"
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
    namespace 'com.aregyan.compose'
}

dependencies {
    def composeBom = platform('androidx.compose:compose-bom:2024.01.00')
    implementation composeBom
    androidTestImplementation composeBom
    implementation "androidx.compose.ui:ui"
    implementation "androidx.compose.material3:material3"
    implementation "androidx.compose.ui:ui-tooling-preview"
    androidTestImplementation "androidx.compose.ui:ui-test-junit4"
    debugImplementation "androidx.compose.ui:ui-tooling"

    implementation 'androidx.core:core-ktx:1.12.0'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0'
    implementation 'androidx.activity:activity-compose:1.8.2'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

    //==================== Dependency Injection ====================
    def hilt_version = "2.50"
    implementation "com.google.dagger:hilt-android:$hilt_version"
    ksp "com.google.dagger:hilt-compiler:$hilt_version"
    implementation 'androidx.hilt:hilt-navigation-compose:1.1.0'

    //==================== Networking ====================
    def retrofit_version = '2.9.0'
    def okhttp_version = '4.12.0'
    implementation "com.squareup.retrofit2:retrofit:$retrofit_version"
    implementation "com.squareup.retrofit2:converter-moshi:$retrofit_version"
    implementation "com.squareup.okhttp3:okhttp:$okhttp_version"
    implementation "com.squareup.okhttp3:logging-interceptor:$okhttp_version"

    //==================== Database ====================
    def room_version = '2.6.1'
    implementation "androidx.room:room-runtime:$room_version"
    ksp "androidx.room:room-compiler:$room_version"
    implementation "androidx.room:room-ktx:$room_version"

    //==================== Deserializer ====================
    def moshi_version = '1.14.0'
    ksp "com.squareup.moshi:moshi-kotlin-codegen:$moshi_version"
    implementation "com.squareup.moshi:moshi:$moshi_version"
    implementation "com.squareup.moshi:moshi-kotlin:$moshi_version"
    implementation "com.squareup.moshi:moshi-adapters:$moshi_version"

    //==================== Logging ====================
    implementation "com.jakewharton.timber:timber:5.0.1"

    //==================== Image Loading ====================
    implementation "io.coil-kt:coil-compose:2.5.0"

    //==================== Navigation ====================
    implementation "androidx.navigation:navigation-compose:2.7.6"

    //==================== Memory Leak Detection ====================
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.9.1'
}