plugins {
    id 'com.android.application'
    id 'com.chaquo.python'
}

android {
    compileSdk 35

    defaultConfig {
        applicationId "io.github.anenasa.news"
        // No need to update minSdkVersion to 23
        // to use usesCleartextTraffic.
        // They are ignored in older versions.
        // https://stackoverflow.com/a/27100238
        minSdkVersion 21
        // Need to set this to 29 so file access works on Android TV 11 and above
        //noinspection ExpiredTargetSdkVersion
        targetSdkVersion 29
        versionCode 40000
        versionName "4.0.0"

        ndk {
            abiFilters "armeabi-v7a", "arm64-v8a", "x86_64"
        }
    }

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

    compileOptions {
        coreLibraryDesugaringEnabled true
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    namespace 'io.github.anenasa.news'
    buildFeatures {
        buildConfig true
    }
    lint {
        abortOnError false
    }
}

chaquopy {
    defaultConfig {
        version = "3.11"
    }
}

dependencies {
    coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
    implementation 'androidx.media3:media3-exoplayer:1.6.1'
    implementation 'androidx.media3:media3-exoplayer-hls:1.6.1'
    implementation 'androidx.preference:preference:1.2.1'
    implementation 'androidx.appcompat:appcompat:1.7.0'
    implementation 'com.squareup.okhttp3:okhttp:4.12.0'
    implementation 'org.jsoup:jsoup:1.20.1'
    implementation 'com.github.mendhak:storage-chooser:2.0.4.4b'
    implementation "ch.acra:acra-core:5.12.0"
    compileOnly "com.google.auto.service:auto-service-annotations:1.1.1"
    annotationProcessor "com.google.auto.service:auto-service:1.1.1"
}
