plugins {
    id 'com.android.library'
    id 'kotlin-android'
    id("com.google.devtools.ksp").version("1.9.22-1.0.17")
}

android {
    compileSdk 33
    defaultConfig {
        minSdkVersion 21
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"

        externalNativeBuild {
            cmake {
                cppFlags ""
            }
        }
    }


    packagingOptions {
        exclude 'assets/*'
    }

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

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

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    kotlinOptions {
        jvmTarget = '11'
    }


    composeOptions {
        //https://developer.android.com/jetpack/androidx/releases/compose-compiler?hl=zh-cn
        kotlinCompilerExtensionVersion '1.5.8'
    }

    buildFeatures {
//        compose true
        viewBinding true
        //https://developer.android.com/topic/libraries/view-binding?hl=zh-cn
    }


    sourceSets {
        main {
            java {
                // 忽略所有的 src/main/java/test目录
                exclude 'test/**'
            }
            resources {
                // 打包忽略目录: src/main/resources/img
                exclude '参考图/**'
//                // 打包忽略文件: src/main/resources/icons/scanner.vsdx
//                exclude 'icons/scanner.vsdx'
            }
        }
    }

}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])


    implementation project(":network")
    api project(":base")


    // Kotlin + coroutines
    implementation("androidx.work:work-runtime-ktx:2.8.1")


//    implementation("androidx.webkit:webkit:1.10.0")
    implementation 'androidx.appcompat:appcompat:1.5.1'
//    implementation 'com.google.android.material:material:1.11.0'
//    implementation 'androidx.activity:activity-ktx:1.8.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
//    implementation 'com.google.android.material:material:1.10.0'


    compileOnly 'androidx.appcompat:appcompat:1.5.1'
//    compileOnly 'com.google.android.material:material:1.7.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}