apply plugin: 'com.android.application'


android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    defaultConfig {

        applicationId "com.ezreal.ezchat"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion

        versionCode 1
        versionName "1.0.1"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    defaultConfig {
        ndk {
            abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86","arm64-v8a","x86_64"
        }

        multiDexEnabled true
    }

//    // 统一Android依赖库版本
//    configurations.all {
//        resolutionStrategy.eachDependency {  details ->
//            def requested = details.requested
//            if (requested.group == 'com.android.support') {
//                //且其名字不是以multi dex开头的
//                if (!requested.name.startsWith("multidex")) {
//                    details.useVersion '26.1.0'
//                }
//            }
//        }
//    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

afterEvaluate {
    tasks.matching {
        it.name.startsWith('dex')
    }.each { dx ->
        if (dx.additionalParameters == null) {
            dx.additionalParameters = []
        }
        dx.additionalParameters += '--multi-dex' // enable multidex
    }
}

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

    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0')

    testImplementation 'junit:junit:4.12'

    implementation 'androidx.multidex:multidex:2.0.1'

    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'

    implementation 'com.jakewharton:butterknife:10.0.0'

    annotationProcessor ('com.jakewharton:butterknife-compiler:10.0.0'){
        exclude group: 'com.android.support'
    }

    implementation 'com.joooonho:selectableroundedimageview:1.0.1'

    implementation 'com.jcodecraeer:xrecyclerview:1.5.9'

    implementation 'com.otaliastudios:cameraview:2.1.0'

    implementation 'com.daimajia.numberprogressbar:library:1.4@aar'

    implementation 'com.hyman:flowlayout-lib:1.1.2'

    implementation 'com.bm.photoview:library:1.4.1'


    // rx java + retrofit
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.13'
    implementation 'com.squareup.retrofit2:retrofit:2.3.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'

    // 基础功能 (必需)
    implementation 'com.netease.nimlib:basesdk:4.4.0'
    // 音视频需要
    implementation 'com.netease.nimlib:avchat:4.4.0'
    // 音视频需要
    implementation 'com.netease.nimlib:nrtc:4.4.0'
    // 聊天室需
    // compile 'com.netease.nimlib:chatroom:4.4.0'
    // 实时会话服务需要
    // compile 'com.netease.nimlib:rts:4.4.0'
    // 全文检索服务需要
    implementation 'com.netease.nimlib:lucene:4.4.0'


    // 高德地图，定位相关
    implementation 'com.amap.api:map2d:5.2.0'
    implementation 'com.amap.api:location:4.5.0'
    implementation 'com.amap.api:search:6.5.0.1'

    implementation project(':commonlibrary')
    implementation project(':dragpointview')
    implementation project(':audiorecordbutton')
    implementation project(':emojilibrary')
    implementation project(':photoselector')
    implementation project(':timeselectview')
}
