/*
 * ********************************************************************************************************************
 *
 *               iFHS7.
 *              ;BBMBMBMc                  rZMBMBR              BMB
 *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
 *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
 *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
 *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
 *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
 *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
 *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
 *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
 *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
 *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
 *         i0BM: SWKHKGO  MBDv
 *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2019.  斯伯坦机器人
 *              ,  XMW  ..
 *                  r                                                                     All rights reserved.
 *
 * ********************************************************************************************************************
 */

/*apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'*/
plugins {
    id 'com.android.application'
    id 'kotlin-android'
   /// id 'kotlin-android-extensions'
    // kotlin("kapt")
    id 'org.jetbrains.kotlin.kapt'
    id 'kotlin-parcelize'
    id 'org.jetbrains.kotlin.plugin.serialization' version '1.5.31'
}

android {
    compileSdkVersion 31
    // buildToolsVersion ANDROID_BUILD_TOOLS_VERSION

    defaultConfig {
        minSdkVersion 28
        targetSdkVersion 31
        versionCode SAGA_CODE.toInteger()
        versionName SAGA_ANDROID_VERSION

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        ndk {
            //选择要添加的对应cpu类型的.so库。
            abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64'
            // 还可以添加 abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a'

        }

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
            }
        }
    }

    buildTypes {
        release {
            // minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    // 解决lint语法检查错误（kotlin语法无法通过lint）
    lintOptions {
        abortOnError false
    }

    kotlinOptions {
        jvmTarget = JVM_TARGET
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
    sourceSets {
        main {
            //jni库的调用会到资源文件夹下libs里面找so文件
            jniLibs.srcDirs = ['libs']
        }
    }

    configurations {
        cleanedAnnotations
        compile.exclude group: 'com.intellij', module: 'annotations'
    }
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation files('libs/zbardecoder.jar')
    implementation files('libs/universal-image-loader-1.9.4-with-sources.jar')
    implementation files('libs/httpclient-4.3.5.jar')
    implementation files('libs/httpcore-4.3.2.jar')
    testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-api', version: JUNIT_VERSION
    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // kotlin 依赖
    implementation group: 'org.jetbrains.kotlin', name: 'kotlin-stdlib-jdk8', version: KOTLIN_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // android支持
    implementation 'androidx.core:core-ktx:1.5.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'

    // implementation group: 'androidx.appcompat', name: 'appcompat', version: ANDROID_SUPPORT_VERSION
    // implementation group: 'com.google.android.material', name: 'material', version: ANDROID_SUPPORT_VERSION
    // implementation group: 'androidx.legacy', name: 'legacy-support-v4', version: ANDROID_SUPPORT_VERSION
    // implementation group: 'androidx.constraintlayout', name: 'constraintlayout', version: CONSTRAINT_VERSION

    implementation 'com.github.bumptech.glide:glide:4.0.0'
    implementation 'com.github.bumptech.glide:okhttp3-integration:4.0.0'
    kapt 'com.github.bumptech.glide:compiler:4.0.0'
    implementation 'com.contrarywind:Android-PickerView:4.1.3'
    implementation 'com.bm.photoview:library:1.4.1'
    implementation 'com.yuyh.imgsel:library:1.3.8'
    implementation 'com.github.chrisbanes:PhotoView:1.2.6'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.1.2'
    implementation 'commons-logging:commons-logging:1.2'

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // anko依赖
    // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-commons
    implementation group: 'org.jetbrains.anko', name: 'anko-commons', version: ANKO_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 图片加载框架
    // https://mvnrepository.com/artifact/com.squareup.picasso/picasso
    implementation group: 'com.squareup.picasso', name: 'picasso', version: PICASSO_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // anko依赖
    // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-common
    implementation group: 'org.jetbrains.anko', name: 'anko-common', version: ANKO_VERSION
    // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-sdk25
    implementation group: 'org.jetbrains.anko', name: 'anko-sdk25', version: ANKO_VERSION
    // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-appcompat-v7
    implementation group: 'org.jetbrains.anko', name: 'anko-appcompat-v7', version: ANKO_VERSION
    // https://mvnrepository.com/artifact/org.jetbrains.anko/anko-design
    implementation group: 'org.jetbrains.anko', name: 'anko-design', version: ANKO_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 运行时权限申请
    // https://mvnrepository.com/artifact/pub.devrel/easypermissions
    implementation group: 'pub.devrel', name: 'easypermissions', version: EASYPERMISSIONS_VERSION

//    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//    // 谷歌JSON解析
//    // https://mvnrepository.com/artifact/com.google.code.gson/gson
//    implementation group: 'com.google.code.gson', name: 'gson', version: GSON_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // JSON解析
    // https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core
    implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: JACKSON_VERSION

    // https://mvnrepository.com/artifact/org.greenrobot/eventbus
    implementation group: 'org.greenrobot', name: 'eventbus', version: EVENTBUS_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // https://mvnrepository.com/artifact/javax.persistence/persistence-api
    implementation group: "javax.persistence", name: "persistence-api", version: PERSISTENCE_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // 二维码与条形码
    // https://mvnrepository.com/artifact/com.google.zxing/core
    implementation group: 'com.google.zxing', name: 'core', version: ZXING_VERSION
    // https://mvnrepository.com/artifact/com.google.zxing/android-core
    implementation group: 'com.google.zxing', name: 'android-core', version: ZXING_VERSION

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    // Sybotan依赖
    implementation group: 'cn.sagacloud', name: 'saga-kotlin-base', version: SAGA_KOTLIN_VERSION
    implementation project(':sybotan-android-base')
    implementation project(':sybotan-android-database')
//    implementation project(':sybotan-android-devices')
//    implementation project(':sybotan-android-views')
    implementation project(':sybotan-android-graphy')
//    implementation project(':sybotan-android-works')
    implementation project(':cadengine')
    // Sybotan依赖
    implementation group: 'cn.sagacloud', name: 'saga-kotlin-database', version: SAGA_KOTLIN_VERSION
//    implementation group: 'cn.sagacloud', name: 'sybotan-android-base', version: SYBOTAN_ANDROID_VERSION
//    implementation group: 'cn.sagacloud', name: 'sybotan-android-graphy', version: SYBOTAN_ANDROID_VERSION
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.9'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'com.trello.rxlifecycle2:rxlifecycle:2.2.1'
    implementation 'com.trello.rxlifecycle2:rxlifecycle-android:2.2.1'
    implementation 'com.trello.rxlifecycle2:rxlifecycle-components:2.2.1'

    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.9.0'

    implementation 'org.kodein.di:kodein-di:7.8.0'

    //implementation 'org.kodein.di:kodein-di-framework-android-support:7.8.0'
    implementation 'org.kodein.di:kodein-di-framework-android-core:7.8.0'
    implementation 'org.kodein.di:kodein-di-framework-android-x:7.8.0'
    implementation 'org.kodein.di:kodein-di-framework-android-x-viewmodel:7.8.0'

    // kotlin
    implementation 'org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.0'

    implementation 'com.arashivision.sdk:sdkcamera:1.3.10'
    implementation 'com.arashivision.sdk:sdkmedia:1.3.10'
    implementation 'com.lzy.net:okgo:3.0.4'
    implementation 'com.afollestad.material-dialogs:core:0.9.6.0'

    androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })

    // room
    implementation('androidx.room:room-runtime:2.4.0-alpha05', {
        exclude group: 'com.intellij', module: 'annotations'
    })
    kapt('androidx.room:room-compiler:2.4.0-alpha05', {
        exclude group: 'com.intellij', module: 'annotations'
    })
    implementation('androidx.room:room-ktx:2.4.0-alpha05', {
        exclude group: 'com.intellij', module: 'annotations'
    })

    // lifecycle
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0-rc01'
    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.4.0-rc01'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.4.0-rc01'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.5.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.14.4'

    debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
}
