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

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
    }
}

android {
    namespace 'com.aneonex.bitcoinchecker.tester'

    compileSdkVersion compile_sdk_version
    buildToolsVersion build_tools_version

    buildFeatures {
        compose = true
    }

    defaultConfig {
        applicationId "com.aneonex.bitcoinchecker.tester"
        minSdkVersion min_sdk_version
        targetSdkVersion compile_sdk_version

        versionCode 1
        versionName "1.0"

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

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    composeOptions {
        kotlinCompilerExtensionVersion = "$compose_compiler_version"
    }

    kotlinOptions {
        jvmTarget = '11'
    }

    lint {
        abortOnError true
        disable 'MissingTranslation'
        enable 'LogNotTimber'
    }
}

dependencies {
    implementation project(':dataModule')

    implementation "androidx.core:core-ktx:$core_ktx_version"
    implementation "androidx.appcompat:appcompat:1.6.0"

    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version")

    // DI: Hilt dependencies
    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-android-compiler:$hilt_version"

    // Jetpack Compose
    def composeBom = platform("androidx.compose:compose-bom:$compose_bom_version")
    implementation composeBom
    androidTestImplementation composeBom

    implementation "androidx.compose.material3:material3"

    // Compose Android Studio preview support
    implementation "androidx.compose.ui:ui-tooling-preview"
    implementation "androidx.compose.ui:ui-util"
    debugImplementation "androidx.compose.ui:ui-tooling"

    // Compose dependencies
    implementation "androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1"
    implementation "androidx.navigation:navigation-compose:2.5.3"
//    implementation "androidx.compose.material:material-icons-extended:$compose_version"
    implementation "androidx.hilt:hilt-navigation-compose:1.0.0"

    implementation "androidx.room:room-ktx:$room_version"
    kapt "androidx.room:room-compiler:$room_version"

    implementation("com.squareup.okhttp3:okhttp:$okhttp_version")
    implementation("com.squareup.okhttp3:logging-interceptor:$okhttp_version")

    implementation("androidx.constraintlayout:constraintlayout-compose:1.0.1")

    // Logging
    implementation 'com.jakewharton.timber:timber:5.0.1'
}
