apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'dagger.hilt.android.plugin'
apply plugin: 'com.didi.dokit'
apply from: '../uploadpgy.gradle'

android {
    compileSdkVersion rootProject.ext.android.compileSdkVersion
    buildToolsVersion rootProject.ext.android.buildToolsVersion

    defaultConfig {
        applicationId rootProject.ext.android.applicationId
        minSdkVersion rootProject.ext.android.minSdkVersion
        targetSdkVersion rootProject.ext.android.targetSdkVersion
        versionCode rootProject.ext.android.versionCode
        versionName rootProject.ext.android.versionName

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    signingConfigs {
        release {
            keyAlias 'eyepetizer'
            keyPassword 'fmt123456'
            storeFile file('../eyepetizer')
            storePassword 'fmt123456'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    buildFeatures {
        dataBinding = true
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}

dokitExt {
    //通用设置
    comm {
        //地图经纬度开关
        gpsSwitch true
        //网络开关
        networkSwitch true
        //大图开关
        bigImgSwitch true
        //webView js 抓包
        webViewSwitch true
    }

    slowMethod {
        //0:默认模式 打印函数调用栈 需添加指定入口  默认为application onCreate 和attachBaseContext
        //1:普通模式 运行时打印某个函数的耗时 全局业务代码函数插入
        strategy 0
        //函数功能开关
        methodSwitch true

        //调用栈模式配置
        stackMethod {
            //默认值为 5ms 小于该值的函数在调用栈中不显示
            thresholdTime 10
            //调用栈函数入口
            enterMethods = ["com.didichuxing.doraemondemo.MainDebugActivity.test1"]
            //黑名单 粒度最小到类 暂不支持到方法
            methodBlacklist = ["com.facebook.drawee.backends.pipeline.Fresco"]
        }
        //普通模式配置
        normalMethod {
            //默认值为 500ms 小于该值的函数在运行时不会在控制台中被打印
            thresholdTime 500
            //需要针对函数插装的包名
            packageNames = ["com.didichuxing.doraemondemo"]
            //不需要针对函数插装的包名&类名
            methodBlacklist = ["com.didichuxing.doraemondemo.dokit"]
        }
    }
}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    testImplementation rootProject.ext.androidx["junit"]
    androidTestImplementation rootProject.ext.androidx["androidx.test.espresso:espresso-core"]

    api rootProject.ext.dependencies["hilt-android"]
    kapt rootProject.ext.dependencies["hilt-android-compiler"]
    kapt rootProject.ext.androidx["hilt-compiler"]

    debugImplementation rootProject.ext.dependencies["dokitx"]
    releaseImplementation rootProject.ext.dependencies["dokitx-no-op"]
    debugImplementation rootProject.ext.dependencies["doraemonkit-leakcanary"]

    implementation project(path: ':biz_home')
    implementation project(path: ':biz_daily')
    implementation project(path: ':biz_discover')
    implementation project(path: ':biz_hot')
    implementation project(path: ':biz_person')
    implementation project(path: ':biz_player')
}
