plugins {
    id 'com.android.application'
}

android {
    compileSdk 33
    flavorDimensions "mode", "api"

    defaultConfig {
        applicationId "com.fongmi.android.tv"
        minSdk 21
        targetSdk 29
        versionCode 60
        versionName "1.6.0"
        ndk { abiFilters "armeabi-v7a" }
    }

    productFlavors {
        leanback {
            dimension "mode"
        }
        mobile {
            dimension "mode"
        }
        java {
            dimension = "api"
        }
        python {
            dimension = "api"
        }
    }

    buildFeatures {
        viewBinding true
    }

    buildTypes {
        release {
            minifyEnabled true
            zipAlignEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    android.applicationVariants.all { variant ->
        variant.outputs.all { output ->
            outputFileName = "${variant.productFlavors[0].name}-${variant.productFlavors[1].name}.apk"
        }
    }
}

dependencies {
    implementation project(':drpy')
    implementation project(':tvbus')
    implementation project(':zlive')
    implementation project(':catvod')
    implementation project(':forcetech')
    implementation project(':ijkplayer')
    pythonImplementation project(':pyramid')
    implementation project(':exoplayer-library')
    implementation project(':exoplayer-extension-av1')
    implementation project(':exoplayer-extension-rtmp')
    implementation project(':exoplayer-extension-ffmpeg')
    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
    implementation 'androidx.lifecycle:lifecycle-viewmodel:2.5.1'
    implementation 'androidx.preference:preference:1.2.0'
    implementation 'androidx.room:room-runtime:2.5.0'
    implementation 'cat.ereza:customactivityoncrash:2.4.0'
    implementation 'com.github.bassaer:materialdesigncolors:1.0.0'
    implementation 'com.github.bumptech.glide:glide:4.14.2'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'com.google.code.gson:gson:2.10'
    implementation 'com.google.net.cronet:cronet-okhttp:0.1.0'
    implementation 'com.google.zxing:core:3.5.1'
    implementation 'com.guolindev.permissionx:permissionx:1.7.1'
    implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.10'
    implementation 'me.jessyan:autosize:1.2.1'
    implementation 'net.java.dev.jna:jna:5.12.1'
    implementation 'org.apache.commons:commons-compress:1.20'
    implementation 'org.chromium.net:cronet-embedded:101.4951.41'
    implementation 'org.greenrobot:eventbus:3.3.1'
    implementation 'org.nanohttpd:nanohttpd:2.3.1'
    implementation('org.simpleframework:simple-xml:2.7.1') { exclude group: 'stax', module: 'stax-api' exclude group: 'xpp3', module: 'xpp3' }
    leanbackImplementation 'androidx.leanback:leanback:1.2.0-alpha02'
    annotationProcessor 'androidx.room:room-compiler:2.5.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.14.2'
}