plugins {
    id "com.android.application"
}

android {
    namespace = "com.teamone.sihadir"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.teamone.sihadir"
        minSdk = 24
        targetSdk = 33
        versionCode = 1
        versionName = "1.0"

        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }


    buildFeatures {
        viewBinding true
    }

    buildTypes {
        release {
            minifyEnabled true  // Change this line
        }
    }

    compileOptions {
        // Menetapkan kompatibilitas Java untuk proyek Java Anda
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
}

ext {
    kotlinVersion = '1.8.22'
}

dependencies {

    def lifecycle_version = "2.5.1"
    implementation "androidx.lifecycle:lifecycle-viewmodel:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-livedata:$lifecycle_version"

    implementation 'org.json:json:20210307'

    implementation("org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion")
    implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")

    // Dependency Retrofit
    implementation("com.squareup.retrofit2:retrofit:2.9.0")
    implementation("com.squareup.retrofit2:converter-gson:2.9.0")

    // Dependency untuk SwipeRefreshLayout dan Gson
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
    implementation("com.google.code.gson:gson:2.8.9")

    // OkHttp Logging Interceptor untuk debug jaringan
    implementation("com.squareup.okhttp3:logging-interceptor:4.9.0")

    // ML Kit Barcode Scanning
    implementation 'com.google.mlkit:barcode-scanning:17.0.3'


    // Material Components
    implementation("com.google.android.material:material:1.7.0") // Hanya menggunakan versi terbaru

    // Preferences library untuk pengaturan
    implementation("androidx.preference:preference:1.2.0")

    // Dependency lain-lain
    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("androidx.constraintlayout:constraintlayout:2.1.1")
    implementation 'androidx.activity:activity:1.9.3'

    // Testing dependencies
    testImplementation("junit:junit:4.13.2")
    androidTestImplementation("androidx.test.ext:junit:1.1.3")
    androidTestImplementation("androidx.test.espresso:espresso-core:3.4.0")

    // Scanner Barcode
    implementation("com.journeyapps:zxing-android-embedded:4.3.0")

    //buat api login hehe :)
    implementation 'com.squareup.okhttp3:okhttp:4.10.0'
    implementation 'com.google.code.gson:gson:2.8.9'

    //buat activity result launcher :)
    implementation 'androidx.activity:activity-ktx:1.7.2'
    implementation 'androidx.fragment:fragment-ktx:1.6.1'

    //buat absensi :)
    implementation 'com.google.code.gson:gson:2.8.9'

}