apply plugin: 'com.android.library'

android {
    compileSdkVersion rootProject.ext.compileSdkVersion
//    buildToolsVersion rootProject.ext.buildToolsVersion

    defaultConfig {
        minSdkVersion 15
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0.4"

        sourceSets {
            main {
                jniLibs.srcDir 'libs'
            }
            debug.setRoot('build-types/debug')
            release.setRoot('build-types/release')
        }

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

dependencies {
    api fileTree(include: ['*.jar'], dir: 'libs')
    api 'androidx.appcompat:appcompat:' + rootProject.supportLibraryVersion
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    //第一种
//    api (project(':ijkplayer-exo2')){
//        exclude group: 'tv.danmaku.ijk.media',
//                module: 'ijkplayer-java'
//    }
    //第二种
    api 'com.github.dynckathline:ijkplayer-exo2:1.0'
//    api (project(':ijkplayer-exo2'))
//    api ('com.github.dynckathline:ijkplayer-exo2:1.0'){
//        exclude group: 'tv.danmaku.ijk.media',
//                module: 'ijkplayer-java'
//    }

    api 'com.google.android.exoplayer:exoplayer:' + rootProject.exoplayer
    api 'com.google.android.exoplayer:extension-rtmp:' + rootProject.exoplayer
    api 'tv.danmaku.ijk.media:ijkplayer-java:' + rootProject.ijkplayer
    //    api 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'

    api 'tv.danmaku.ijk.media:ijkplayer-armv7a:' + rootProject.ijkplayer
    //    // Other ABIs: optional
    //    api 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
    //    api 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
    api 'tv.danmaku.ijk.media:ijkplayer-x86:' + rootProject.ijkplayer
    //    api 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'
}

//解决 gradlew 构建错误: 编码 GBK的不可映射字符
tasks.withType(Javadoc) {
//    options.encoding = "UTF-8"
    options.addStringOption('Xdoclint:none', '-quiet')
    options.addStringOption('encoding', 'UTF-8')
}

ext {
    PUBLISH_GROUP_ID = "com.github.dynckathline"
    PUBLISH_ARTIFACT_ID = "ijkplayerlib"
    PUBLISH_VERSION = android.defaultConfig.versionName
}
apply from: "${rootProject.projectDir}/mavencentral.gradle"