apply from: '../versions.gradle'
apply plugin: 'com.android.application'

//Crashlytics
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
//Crashlytics end

android {
    namespace "com.fgl27.twitch"
    compileSdk 35

    buildFeatures {
        buildConfig = true
    }

    defaultConfig {
        applicationId "com.fgl27.twitch"

        minSdkVersion 21
        targetSdkVersion 35
        compileSdk 35

        versionCode versions.publishVersionCode
        versionName versions.publishVersion + versions.publishVersionCode

    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles = [
                    getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'
            ]
        }
        debug {
            applicationIdSuffix ".debug"
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

        coreLibraryDesugaringEnabled true
    }

    productFlavors {
    }

    lint {
        abortOnError false
        disable 'SetJavaScriptEnabled', 'GoogleAppIndexingWarning', 'IconMissingDensityFolder', 'IconLauncherShape', 'RtlHardcoded', 'ObsoleteLintCustomCheck'
        lintConfig file('lint.xml')
    }

    dependenciesInfo {
        includeInApk false
        includeInBundle false
    }

    gradle.projectsEvaluated {
        tasks.withType(JavaCompile).tap {
            configureEach {
                options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
            }
        }
    }
}

repositories {
    mavenCentral()
}

dependencies {
    //Exoplayer
    implementation project(':media3-lib-exoplayer')
    implementation project(':media3-lib-ui')
    implementation project(':media3-lib-exoplayer-hls')
    //implementation project(':media-lib-decoder-av1')

    //Crashlytics
    implementation platform('com.google.firebase:firebase-bom:33.14.0')
    implementation 'com.google.firebase:firebase-analytics'
    implementation 'com.google.firebase:firebase-crashlytics'
    //Crashlytics end

    implementation 'androidx.leanback:leanback:1.2.0'
    implementation 'androidx.webkit:webkit:1.14.0'
    implementation 'com.google.code.gson:gson:2.13.2'
    implementation 'com.github.GCX-HCI:tray:v0.12.0'
    implementation 'androidx.tvprovider:tvprovider:1.1.0'

    // coreLibraryDesugaringEnabled
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'

}
