plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'org.jetbrains.kotlin.plugin.serialization'

    id 'kotlin-kapt'

    id 'com.google.devtools.ksp'
    id 'dagger.hilt.android.plugin'
    id 'androidx.navigation.safeargs.kotlin'
}

android {
    namespace 'com.f0x1d.dnsmanager'
    compileSdk 34

    defaultConfig {
        applicationId "com.f0x1d.dnsmanager"
        minSdk 24
        targetSdk 34
        versionCode 7
        versionName "1.0.6"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ksp {
            arg("room.schemaLocation", "$projectDir/schemas")
        }
    }

    applicationVariants.configureEach { variant ->
        variant.outputs.configureEach {
            outputFileName = "DNS-Manager-${variant.versionName}.apk"
        }
    }

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

dependencies {
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialization_version"

    implementation "androidx.room:room-runtime:$room_version"
    ksp "androidx.room:room-compiler:$room_version"
    implementation "androidx.room:room-ktx:$room_version"

    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-compiler:$hilt_version"
    implementation "androidx.hilt:hilt-navigation-compose:$hilt_navigation_version"

    implementation "dev.shreyaspatil.permission-flow:permission-flow-android:$permission_flow_version"

    implementation "androidx.core:core-ktx:$androidx_core_version"
    implementation "androidx.collection:collection-ktx:$androidx_collection_version"
    implementation "androidx.lifecycle:lifecycle-runtime-compose:$androidx_lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:$androidx_lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-viewmodel-compose:$androidx_lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidx_lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidx_lifecycle_version"
    implementation "androidx.datastore:datastore-preferences:$androidx_datastore_version"
    implementation "androidx.activity:activity-compose:$androidx_activity_version"

    implementation "androidx.compose.material3:material3:$material3_version"
    implementation "androidx.compose.ui:ui:$compose_version"
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
    implementation "androidx.compose.foundation:foundation:$compose_version"
    implementation "androidx.compose.runtime:runtime:$compose_version"
    implementation "androidx.compose.runtime:runtime-livedata:$compose_version"

    implementation "com.github.JamalMulla:ComposePrefs3:$compose_prefs_version"

    implementation "androidx.navigation:navigation-fragment-ktx:$navigation_version"
    implementation "androidx.navigation:navigation-ui-ktx:$navigation_version"
    implementation "androidx.navigation:navigation-compose:$navigation_version"

    testImplementation "junit:junit:$junit_version"

    androidTestImplementation "androidx.test.ext:junit:$androidx_junit_version"
    androidTestImplementation "androidx.test.espresso:espresso-core:$androidx_espresso_version"
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"

    debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
    debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
}
