apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'

android {
    defaultConfig {
        applicationId "com.antest1.kcanotify"
        minSdkVersion 24
        targetSdkVersion 33
        versionCode 300012
        versionName "3.0r12"

        multiDexEnabled true
        externalNativeBuild {
            cmake {
                cppFlags ""
                arguments "-DANDROID_PLATFORM=android-21"
                // https://developer.android.com/ndk/guides/cmake.html
            }
        }

        buildConfigField "long", "BUILD_TIME", System.currentTimeMillis() + "L"
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles.add(file('proguard-rules.pro'))
        }
    }

    buildFeatures {
        buildConfig = true
    }

    externalNativeBuild {
        cmake {
            path file('CMakeLists.txt')
            version "3.22.1"
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    ndkVersion '26.1.10909125'
    namespace 'com.antest1.kcanotify'
    compileSdk 33
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation "androidx.fragment:fragment:1.6.1"
    implementation "androidx.preference:preference:1.2.1"
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.viewpager2:viewpager2:1.0.0'
    implementation 'com.google.android.material:material:1.9.0'
    api 'com.google.guava:guava:31.1-android'
    implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
    implementation 'org.brotli:dec:0.1.2'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
    implementation (group: 'commons-httpclient', name: 'commons-httpclient', version: '3.1') {
        exclude group: 'commons-logging', module: 'commons-logging'
    }
    implementation 'com.squareup.okhttp3:okhttp:4.10.0'
    implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.5'
    implementation 'net.lingala.zip4j:zip4j:2.11.1'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
    implementation 'com.github.woxthebox:draglistview:1.5.2'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    implementation 'androidx.navigation:navigation-fragment:2.5.3'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

    implementation 'com.github.amitshekhariitbhu:PRDownloader:1.0.2'
    implementation 'com.mariten:kanatools:1.3.0'
    implementation 'androidx.browser:browser:1.5.0'

    implementation 'com.google.firebase:firebase-analytics:22.2.0'
    implementation 'com.google.firebase:firebase-crashlytics:19.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'

    constraints {
        implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
            because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
        }
        implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
            because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
        }
    }
}
