plugins {
    alias(libs.plugins.androidApplication)
    alias(libs.plugins.kotlinAndroid)
    alias(libs.plugins.hilt)
//    alias(libs.plugins.ksp)
    alias(libs.plugins.protobuf)
    id 'kotlin-kapt'
    id("com.google.gms.google-services")
    id("com.google.firebase.crashlytics")
}

android {
    namespace = "com.viddin.videos.free"
    compileSdk libs.versions.compileSdk.get().toInteger()

    defaultConfig {
        applicationId "com.viddin.videos.free"
        minSdk libs.versions.minSdk.get().toInteger()
        targetSdk libs.versions.targetSdk.get().toInteger()
        versionCode libs.versions.versionCode.get().toInteger()
        versionName libs.versions.versionName.get().toString()

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility libs.versions.javaVersion.get().toInteger()
        targetCompatibility libs.versions.javaVersion.get().toInteger()
    }
    kotlinOptions {
        jvmTarget = libs.versions.javaVersion.get().toInteger()
    }
    buildFeatures {
        viewBinding = true
    }
}


protobuf {
    protoc {
        artifact = libs.protobuf.protoc.get().toString()
    }
    generateProtoTasks {
        all().forEach { task ->
            task.builtins {
                register("java") {
                    option("lite")
                }
                register("kotlin") {
                    option("lite")
                }
            }
        }
    }
}



dependencies {
    implementation project(':base')
    implementation project(':notification')
    testImplementation(libs.junit)
    androidTestImplementation(libs.androidx.test.ext.junit)
    androidTestImplementation(libs.espresso.core)

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation(project(":core:network"))
    implementation(project(":core:architecture"))
    //api(project(":core:architecture-reflect"))
    implementation(project(":core:network"))
    implementation(project(":bill"))
    implementation(project(":youtube:core"))
    implementation(project(":youtube:custom-ui"))
    implementation(project(":StatisticReporter"))

    implementation libs.androidx.navigation.fragment.ktx
    implementation(libs.startup)
    implementation(libs.hilt.android)
    kapt(libs.hilt.compiler)
    //ksp(libs.hilt.compiler)
    implementation(libs.material)
    implementation(libs.datastore)
    implementation(libs.protobuf.kotlin.lite)
    implementation(libs.kotlinx.serialization.json)
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation(libs.glide) // ImageLoader在用
    implementation(libs.okhttp.logging)
    implementation(libs.retrofit)
    implementation(libs.retrofit.kotlin.serialization)
    //implementation 'com.github.hyy920109:GuidePro:1.0.3'


}