plugins {
    id 'com.android.library'
}


android {
    namespace "com.tencent.qcloud.tuicore"
    compileSdk libs.versions.compileSdk.get().toInteger()

    defaultConfig {
        minSdk libs.versions.minSdk.get().toInteger()
        targetSdk libs.versions.targetSdk.get().toInteger()

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        consumerProguardFiles "consumer-rules.pro"
        ndk {
            abiFilters "armeabi-v7a"
            abiFilters "arm64-v8a"
        }
    }

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

    sourceSets {
        main {
            res.srcDirs += "src/main/res-light"
            res.srcDirs += "src/main/res-lively"
            res.srcDirs += "src/main/res-serious"
        }
    }
}

dependencies {
    api fileTree(include: ['*.jar', '*.aar'], dir: '../../../../tuikit/android/libs')

    implementation 'androidx.appcompat:appcompat:1.3.1'
    api 'com.google.auto.service:auto-service-annotations:1.1.1'

    def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect()
    println "all projects : {$projects}"
    if (projects.contains("imsdk-plus")) {
        api project(':imsdk-plus')
    } else {
        api rootProject.getProperties().containsKey("imSdk") ? rootProject.ext.imSdk : "com.tencent.imsdk:imsdk-plus:8.7.7201"
    }

}
