plugins {
    id("com.android.application")
    id("io.objectbox")
}

android {
    namespace "com.bokecc.vod"
    compileSdkVersion AppCompileSdkVersion as int
    buildToolsVersion AppBuildToolsVersion
    defaultConfig {
        minSdkVersion AppMinSdkVersion as int
        targetSdkVersion AppTargetSdkVersion as int
        applicationId "com.bokecc.vod"
        versionCode AppCode as int
        versionName AppVersion

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

        multiDexEnabled true
    }

    //
    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField("String","videoId","\"${videoId}\"")
            buildConfigField("String","userId","\"${USER_ID}\"")
            buildConfigField("String","key","\"${API_KEY}\"")
            buildConfigField("Boolean","isShowCustomMarquee","${isShowCustomMarquee}")
            buildConfigField("Boolean","isDefaultMode","${isDefaultMode}")
            buildConfigField("Boolean","isShowSignin","${isShowSignin}")
            buildConfigField("Integer","VerificationVersion","${VerificationVersion}")
        }
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField("String","videoId","\"${videoId}\"")
            buildConfigField("String","userId","\"${USER_ID}\"")
            buildConfigField("String","key","\"${API_KEY}\"")
            buildConfigField("Boolean","isShowCustomMarquee","${isShowCustomMarquee}")
            buildConfigField("Boolean","isDefaultMode","${isDefaultMode}")
            buildConfigField("Boolean","isShowSignin","${isShowSignin}")
            buildConfigField("Integer","VerificationVersion","${VerificationVersion}")
        }
    }

    // 打包改名
    applicationVariants.all { variant ->
        variant.outputs.all { output ->
            if (outputFileName.endsWith('.apk')) {
                def fileName = "Vod_"+AppVersion+"_release.apk"
                outputFileName = fileName
            }
        }
    }

    //
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/beans.xml'
    }

    buildFeatures {
        buildConfig true  // 启用 BuildConfig 生成
    }
}

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:2.0.4'

    implementation "androidx.multidex:multidex:2.0.1"
    implementation 'com.github.bumptech.glide:glide:4.9.0'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'
    implementation 'com.google.code.gson:gson:2.8.5'

    // 二维码扫描库
    implementation 'com.google.zxing:core:3.3.3'
    //弹幕库
    implementation project(':DanmakuFlameMaster')

    //使用投屏功能需要引用
    implementation  ('com.bokecc:ProjectionLib:1.7.0') {
        exclude group: 'org.eclipse.jetty.orbit', module: 'javax.servlet'
    }
    implementation 'javax.servlet:javax.servlet-api:3.1.0'
    //使用Vr播放功能时需要引入
    implementation 'com.bokecc:VrPlayLib:2.5.1'
    //上传视频时使用压缩功能时需要引用
    implementation 'com.bokecc:CompressVideoLib:1.0.0'
    //隐身跑马灯
    implementation 'com.bokecc.module:marquee:1.0.0'

    //点播sdk
    implementation ('com.bokecc:CCVOD:3.23.3')

    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.10.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
    implementation 'androidx.fragment:fragment:1.8.9'
}
