apply plugin: 'com.android.library'
def projects = this.rootProject.getAllprojects().stream().map { project -> project.name }.collect()

android {
    namespace "com.tencent.cloud.tuikit.roomkit"
    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
    }
}

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

    implementation "de.hdodenhof:circleimageview:3.1.0"
    implementation "com.github.bumptech.glide:glide:4.12.0"
    implementation 'com.google.zxing:core:3.5.3'
    implementation "androidx.appcompat:appcompat:1.0.0"
    implementation "com.google.code.gson:gson:2.9.1"
    implementation 'com.google.android.material:material:1.4.0'
    implementation "androidx.constraintlayout:constraintlayout:1.1.3"
    implementation 'androidx.core:core:1.0.2'
    implementation 'com.tencentcloudapi:tencentcloud-sdk-java:3.1.1113'

    implementation project(':timcommon')

    api rootProject.getProperties().containsKey("common") ? rootProject.ext.common : "io.trtc.uikit:common:2.8.0.634"
    api rootProject.getProperties().containsKey("roomEngineSdk") ? rootProject.ext.roomEngineSdk : "io.trtc.uikit:rtc_room_engine:3.2.3.844"
    api rootProject.getProperties().containsKey("liteavSdk") ? rootProject.ext.liteavSdk : "com.tencent.liteav:LiteAVSDK_Professional:12.5.+"
    api rootProject.getProperties().containsKey("liteavScreenCaptureSdk") ? rootProject.ext.liteavScreenCaptureSdk : "com.tencent.liteav:LiteAVSDK_ScreenCapture:12.5.+"
    if (projects.contains("tuicore")) {
        api project(':tuicore')
    } else {
        api "com.tencent.liteav.tuikit:tuicore:8.5.+"
        implementation rootProject.getProperties().containsKey("imSdk") ? rootProject.ext.imSdk : "com.tencent.imsdk:imsdk-plus:8.5.+"
    }
}
