apply plugin: 'com.android.application'
apply from: "../app-common/build_common.gradle"
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

//如果有用到kapt添加如下配置
kapt {
    useBuildCache = true
    javacOptions {
        option("-Xmaxerrs", 500)
    }
}

android {
    compileSdkVersion rootProject.ext.compileVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
    lintOptions {
        abortOnError false
    }
    defaultConfig {
        applicationId "ezviz.ezopensdk"
        minSdkVersion rootProject.ext.minSdk
        targetSdkVersion rootProject.ext.targetSdk
        versionCode 5120
        versionName "v5.12"
        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a"
        }
        
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_8
            targetCompatibility JavaVersion.VERSION_1_8
        }
    }

    signingConfigs {
        myConfig {
            storeFile file("test.jks")
            storePassword "abcd1234"
            keyAlias "key0"
            keyPassword "abcd1234"
            v2SigningEnabled true
            v1SigningEnabled true //gradle升级到5.4.1之后，取值会默认为false。此时打出的包无法在Android7.0以下机型安装
        }
    }

    //在Android代码块中添加如下配置：（可优化最上图中transformClassDexBuilderForDebug的时间）
    dexOptions {
        preDexLibraries true
        maxProcessCount 8
    }
    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.myConfig //签名
        }
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.myConfig //签名
        }
    }
    productFlavors {
    }
}


dependencies {
    /*萤石SDK核心模块，必须*/
    implementation 'io.github.ezviz-open:ezviz-sdk:5.12'
    // 4.19.0版本之后需要自行依赖okhttp和gson库
    implementation 'com.squareup.okhttp3:okhttp:3.12.1'
    implementation 'com.google.code.gson:gson:2.8.5'

    /*视频通话模块，按需使用*/
    implementation 'io.github.ezviz-open:videotalk:1.3.0'

    /*视频通话模块，按需使用*/
    implementation 'io.github.ezviz-open:streamctrl:1.3.0'

    /*demo的依赖项*/
    implementation project(path: ':app-common')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'cn.bingoogolapple:bga-qrcode-zxing:1.3.4'

//    implementation fileTree(include: ['*.aar'], dir: '../videotalk/libs')
}

//repositories {
//    maven { url 'https://dl.bintray.com/open-ezviz/mobile-sdk'}
//}

