plugins {
    id 'com.android.application'
}
apply plugin: 'kotlin-android'

static def releaseTime() {
    return new Date().format("yyyy-MM-dd")
}

static def releaseTimeMin() {
    return new Date().format("HH_mm_ss")
}

android {
    compileSdkVersion 30
    defaultConfig {
        resConfigs('zh-rCN')
        applicationId "cn.dreamn.qianji_auto"
        minSdkVersion 24
        targetSdkVersion 33
        versionCode 190
        versionName "涅槃 3.3.7"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            setAbiFilters(['arm64-v8a'])
        }
    }

    def currentVersionCode = Math.random().toString().substring(2, 5)
    buildTypes {
        release {
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            applicationVariants.all { variant ->
                variant.outputs.all {
                    outputFileName = "${defaultConfig.versionName}_${releaseTime()}.apk"

                }
            }
        }

        debug{
            versionNameSuffix "-${currentVersionCode}"
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    buildFeatures {
        viewBinding true

        //noinspection DataBindingWithoutKapt
       // dataBinding = true
    }
}

dependencies {
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation project(path: ':filechooser')
    implementation project(path: ':material-dialogs-bottomsheets')
    implementation 'com.google.android.material:material:1.4.0'
    implementation project(path: ':timepicker')
    implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
    implementation 'androidx.navigation:navigation-fragment:2.3.5'
    implementation 'androidx.navigation:navigation-ui:2.3.5'


    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    //今日头条屏幕适配方案
    implementation 'me.jessyan:autosize:1.2.1'
    // XPage
    implementation 'com.github.xuexiangjys.XPage:xpage-lib:3.1.1'
    annotationProcessor 'com.github.xuexiangjys.XPage:xpage-compiler:3.1.1'
    // ButterKnife的sdk
    implementation 'com.jakewharton:butterknife:10.2.3'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
    // 腾讯MMKV
    implementation 'com.tencent:mmkv:1.2.10'
    // 主题
    implementation 'com.github.LillteZheng:ZSkinPlugin:v1.2'
    //下拉刷新框架
    implementation 'com.github.xuexiangjys.SmartRefreshLayout:refresh-layout:1.1.5'
    //列表视图
    implementation 'com.yanzhenjie.recyclerview:x:1.3.2'
    //权限授权
    implementation 'com.github.getActivity:XXPermissions:11.5'
    // 吐司框架：https://github.com/getActivity/Toaster
    // 新地址: https://github.com/getActivity/Toaster
    implementation 'com.github.getActivity:Toaster:12.6'
    //自定义imgview
    implementation "com.github.xiaofeidev:round:1.1.1"

    //安卓Room数据库
    def room_version = '2.3.0'

    //noinspection GradleDependency
    implementation "androidx.room:room-runtime:$room_version"
    annotationProcessor "androidx.room:room-compiler:2.3.0"

    // optional - RxJava support for Room
    //noinspection GradleDependency
    implementation "androidx.room:room-rxjava2:$room_version"

    // optional - Guava support for Room, including Optional and ListenableFuture
    //noinspection GradleDependency
    implementation "androidx.room:room-guava:$room_version"

    // optional - Test helpers
    //noinspection GradleDependency
    testImplementation "androidx.room:room-testing:2.3.0"
    //内存泄漏监测leak,就需要加上这个依赖
  //  debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.7'
    //rhino
    implementation 'org.mozilla:rhino:1.7.13'
    //多状态组件
    implementation 'com.github.SheHuan:StatusView:1.0.5'
    //material-dialogs
    implementation 'com.afollestad.material-dialogs:core:3.3.0'
    //implementation 'com.afollestad.material-dialogs:color:3.3.0'
   // implementation 'com.afollestad.material-dialogs:datetime:3.3.0'
    //选择器
    //悬浮按钮
    implementation 'com.getbase:floatingactionbutton:1.10.1'
    //悬浮窗
    implementation 'com.github.xuexiangjys:XFloatView:1.0.2'
    //网络请求库
    implementation('com.squareup.okhttp3:okhttp:5.0.0-alpha.2')
    //WebDav
    implementation 'com.thegrizzlylabs.sardine-android:sardine-android:0.5'
    //FastJSON
    implementation 'com.alibaba:fastjson:1.2.76'
    //Xposed组件库
    compileOnly 'de.robv.android.xposed:api:82'
    compileOnly 'de.robv.android.xposed:api:82:sources'
    //图片加载库
    implementation 'com.github.bumptech.glide:glide:4.12.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
    //xml
    implementation 'com.github.smart-fun:XmlToJson:1.4.5'
    //apache转义工具类
    implementation "org.apache.commons:commons-text:1.3"
    //


}
repositories {
    mavenCentral()
}