apply plugin: 'com.android.library'
apply plugin: 'bugly'
bugly {
    appId = "6b437c22dc" // 注册时分配的App ID
    appKey = "e7391b81-101a-4cce-a6fc-15fcae6d4e7f" // 注册时分配的App Key
}
android {
    compileSdkVersion 26
    buildToolsVersion '26.0.2'

    defaultConfig {
        minSdkVersion 21 //由于使用到NdkMediaCodec，因此最低只能支持21
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        externalNativeBuild {
            cmake {
                //'-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static'此两项是系统默认的，不用配置也可，
                //'-DANDROID_PLATFORM=android-21'官方建议配置minSdkVersion即可
                //详细可见https://developer.android.google.cn/ndk/guides/cmake.html
                //arguments '-DANDROID_PLATFORM=android-21', '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static'
                cppFlags "-frtti -fexceptions -Wno-error=format-security -Wmacro-redefined"
            }
        }

        ndk {
            // Specifies the ABI configurations of your native
            // libraries Gradle should build and package with your APK.
            abiFilters  'armeabi'// ,'arm64-v8a','x86', 'x86_64', 'armeabi-v7a'

        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        debug {
            jniDebuggable true
            renderscriptDebuggable true
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
    //解决升级gradle4后so重复的问题
    packagingOptions {
        pickFirst 'lib/armeabi/libstreamhandler.so'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile 'com.android.support:appcompat-v7:26.0.2'
    testCompile 'junit:junit:4.12'
}
