plugins {
    id 'com.android.library'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-kapt'
    id 'kotlin-parcelize'
}

android {
    compileSdkVersion rootProject.ext.compileSdkVersion

    defaultConfig {

        javaCompileOptions {
            annotationProcessorOptions {
                arguments = [eventBusIndex: 'com.gh.EventBusIndex']
            }
        }

        vectorDrawables.useSupportLibrary = true

        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode rootProject.ext.versionCode
        versionName rootProject.ext.versionName

        renderscriptTargetApi 18
        renderscriptSupportModeEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        /**
         * Build Time 供区分 jenkins 打包时间用
         * IS_NIGHT_MODE_ON 供区分深色模式功能是否启用
         */
        buildConfigField "long", "BUILD_TIME", "0"
        buildConfigField "boolean", "IS_DARK_MODE_ON", "true"
        buildConfigField "boolean", "IS_VGAME_ON", "true"
    }

    buildFeatures {
        viewBinding true
    }

    kapt {
        arguments {
            arg("AROUTER_MODULE_NAME", project.name)
        }
    }

    buildTypes {
        release {
            consumerProguardFiles 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    api fileTree(include: ['*.jar', '*.aar'], dir: 'libs')
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    api "androidx.constraintlayout:constraintlayout:${constraintLayout}"
    kapt "com.alibaba:arouter-compiler:$arouterVersion"
    api "com.louiscad.splitties:splitties-views-dsl:${splitties}"
    api "com.louiscad.splitties:splitties-views-dsl-constraintlayout:${splitties}"
    api "com.github.nichbar:AndroidRomChecker:${romChecker}"
    api "androidx.cardview:cardview:${cardView}"
    api "com.google.android.material:material:${material}"
    api "com.scwang.smartrefresh:SmartRefreshLayout:${smartRefreshLayout}"
    api "com.daimajia.swipelayout:library:${swipeLayout}"
    api "com.github.PhilJay:MPAndroidChart:${chart}"
    api "org.greenrobot:eventbus:${eventbus}"
    kapt "org.greenrobot:eventbus-annotation-processor:${eventbusApt}"
    api "com.tencent.mm.opensdk:wechat-sdk-android-without-mta:${mta}"
    api "androidx.room:room-runtime:${room}"
    api "androidx.room:room-rxjava2:${room}"
    kapt "androidx.room:room-compiler:${room}"
    api "androidx.collection:collection-ktx:${collection}"
    api "androidx.activity:activity:${activity}"
    api "androidx.activity:activity-ktx:${activity}"
    api "com.aliyun.openservices:aliyun-log-android-sdk:${aliyunLog}"
    debugApi "com.lg:chucker:${chucker}"
    releaseApi "com.lg:chucker-no-op:${chucker}"
    debugApi "com.squareup.okhttp3:logging-interceptor:${okHttp}"
    api "pub.devrel:easypermissions:${easypermissions}"
    api "com.aliyun.dpa:oss-android-sdk:${oss}"
    api "io.github.sinaweibosdk:core:${weiboSDK}"
    api "com.lg:skeleton:${skeleton}"
    api "com.google.android:flexbox:${flexbox}"

    debugApi "com.squareup.okhttp3:okhttp-tls:${okHttpForDebug}"
    debugApi "com.squareup.okio:okio:2.2.2"
    debugApi "junit:junit:4.12"

    api(project(path: ":module_core"))
}