apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'

android {
    compileSdkVersion rootProject.ext.android["compileSdkVersion"]
    buildToolsVersion rootProject.ext.android["buildToolsVersion"]

    compileOptions {
        targetCompatibility JavaVersion.VERSION_1_8
        sourceCompatibility JavaVersion.VERSION_1_8
    }
    defaultConfig {
        applicationId "com.peng.lottery"
        versionCode rootProject.ext.android["versionCode"]
        versionName rootProject.ext.android["versionName"]
        minSdkVersion rootProject.ext.android["minSdkVersion"]
        targetSdkVersion rootProject.ext.android["targetSdkVersion"]

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            // 设置支持的SO库架构
            abiFilters 'armeabi' //, 'x86', 'armeabi-v7a', 'x86_64', 'arm64-v8a'
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "Lottery_${variant.versionName}-${variant.buildType.name}.apk"
        }
    }
    signingConfigs {
        release {
            storeFile file('../keystore/peng.jks')
            storePassword '000000'
            keyAlias 'pengKey'
            keyPassword '000000'
        }
    }
    buildTypes {
        release {
            minifyEnabled true
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }

        debug {
            signingConfig signingConfigs.release
        }
    }

    greendao {
        schemaVersion 2
        daoPackage 'com.peng.lottery.mvp.model.db.bean'
        targetGenDir 'src/main/java'
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    configurations {
        all*.exclude group: 'com.android.support', module: 'support-v13'
    }

    /* Support */
    implementation rootProject.ext.dependencies["androidx"]
    implementation rootProject.ext.dependencies["material"]
    implementation rootProject.ext.dependencies["recyclerview"]
    implementation rootProject.ext.dependencies["refreshlayout"]
    implementation rootProject.ext.dependencies["multidex"]
    /* RRD(RxJava + Retrofit + Dagger) */
    implementation rootProject.ext.dependencies["rxjava"]
    implementation rootProject.ext.dependencies["rxandroid"]
    api rootProject.ext.dependencies["rxbus"]
    api rootProject.ext.dependencies["rxpermissions"]
    api rootProject.ext.dependencies['rxerrorhandler']
    implementation rootProject.ext.dependencies["retrofit"]
    implementation rootProject.ext.dependencies["retrofit-converter-gson"]
    implementation rootProject.ext.dependencies["retrofit-adapter-rxjava"]
    implementation rootProject.ext.dependencies["dagger2"]
    annotationProcessor rootProject.ext.dependencies["dagger2-compiler"]
    /* ButterKnife */
    implementation rootProject.ext.dependencies["butterknife"]
    annotationProcessor rootProject.ext.dependencies["butterknife-compiler"]
    /* greenDAO */
    implementation rootProject.ext.dependencies["greendao"]

    /* AgentWeb */
    implementation rootProject.ext.dependencies["agentweb"]
    /* RecyclerViewAdapter */
    implementation rootProject.ext.dependencies["recycler-adapter"]
    /* material-edit */
    implementation rootProject.ext.dependencies["material-edit"]

    /* Bugly */
    implementation rootProject.ext.dependencies["bugly-upgrade"]
    implementation rootProject.ext.dependencies["bugly-native"]

    /* Test */
    testImplementation rootProject.ext.dependencies["junit"]
}
