apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    buildToolsVersion '28.0.3'

    defaultConfig {
        applicationId "org.easydarwin.easyrtmp"
        minSdkVersion 19
        targetSdkVersion 26
//        versionCode generateVersionCode()
//        versionName generateVersionName()
        versionCode 14250116
        versionName '1.4.25.0116'
        testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
        flavorDimensions "versionCode"

        if (project.hasProperty('RTMP_KEY')) {
            println("RTMPKEY IS :" + RTMP_KEY)
            buildConfigField 'String', 'RTMP_KEY', RTMP_KEY
        } else {
            println("NO RTMPKEY FOUND")

            /*
            *本Key为3个月临时授权License，如需商业使用，请邮件至support@easydss.com了解此产品的授权信息。
            */
            buildConfigField 'String', 'RTMP_KEY', "\"79736C36655A36526D3430414F35746C6D6D544570656876636D63755A57467A65575268636E64706269356C59584E35636E52746346634D5671442F70654A4659584E355247467964326C755647566862556C7A5647686C516D567A64434D794D4445354F57566863336B3D\""
        }

        ndk {
            //设置支持的SO库架构
            abiFilters 'armeabi', 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
        }
    }

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

    dataBinding {
        enabled = true
    }

    android.applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "EasyRTMP-" + variant.versionCode + "-" + variant.versionName + ".apk"
        }
    }

    compileOptions {
        sourceCompatibility = '1.8'
        targetCompatibility = '1.8'
    }
}

repositories {
    flatDir {
        dirs 'libs'
    }
    mavenCentral()
    google()
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation(name: 'update-release', ext: 'aar')

    testImplementation 'junit:junit:4.12'

    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    implementation 'com.android.support:preference-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.squareup.okhttp3:okhttp:3.4.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.android.support:cardview-v7:26.1.0'
//    implementation 'com.github.chrisbanes:PhotoView:1.3.0'
    implementation 'com.squareup:otto:1.3.8'

    androidTestImplementation 'com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    }

    implementation 'com.budiyev.android:code-scanner:1.9.4'

    implementation project(':library')

    implementation 'android.arch.lifecycle:extensions:1.0.0'
    implementation 'android.arch.lifecycle:reactivestreams:1.0.0'
    implementation 'android.arch.lifecycle:extensions:1.0.0'
    implementation 'android.arch.lifecycle:reactivestreams:1.0.0'
    annotationProcessor "android.arch.lifecycle:compiler:1.0.0"
    annotationProcessor "android.arch.lifecycle:compiler:1.0.0"

    implementation(name: 'libuvccamera-release', ext: 'aar') {
        exclude module: 'support-v4'
        exclude module: 'appcompat-v7'
    }
}
