apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from : '../common.gradle'

android {

    defaultConfig {
        applicationId "com.hjq.gson.factory.demo"
        minSdkVersion 26
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
    }

    // Apk 签名的那些事：https://www.jianshu.com/p/a1f8e5896aa2
    signingConfigs {
        config {
            storeFile file(StoreFile)
            storePassword StorePassword
            keyAlias KeyAlias
            keyPassword KeyPassword
        }
    }

    buildTypes {
        debug {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }

        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.config
        }
    }
    namespace 'com.hjq.gson.factory.demo'

    applicationVariants.configureEach { variant ->
        // apk 输出文件名配置
        variant.outputs.configureEach { output ->
            outputFileName = rootProject.getName() + '.apk'
        }
    }
}

dependencies {
    // 依赖 libs 目录下所有的 jar 和 aar 包
    implementation fileTree(include: ['*.jar', '*.aar'], dir: 'libs')

    implementation project(':library')

    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

    // Json 解析框架：https://github.com/google/gson
    // noinspection GradleDependency
    androidTestImplementation 'com.google.code.gson:gson:2.13.1'
    implementation 'com.google.code.gson:gson:2.13.1'

    // AndroidX 库：https://github.com/androidx/androidx
    implementation 'androidx.appcompat:appcompat:1.4.0'
    // Material 库：https://github.com/material-components/material-components-android
    implementation 'com.google.android.material:material:1.4.0'

    // 标题栏框架：https://github.com/getActivity/TitleBar
    implementation 'com.github.getActivity:TitleBar:10.5'

    // Bugly 异常捕捉：https://bugly.qq.com/docs/user-guide/instruction-manual-android/?v=20190418140644
    implementation 'com.tencent.bugly:crashreport:4.1.9'
    implementation 'com.tencent.bugly:nativecrashreport:3.9.2'

    implementation 'com.squareup.moshi:moshi:1.12.0'
    implementation "com.squareup.moshi:moshi-kotlin:1.12.0"

    implementation 'com.alibaba:fastjson:2.0.28'
}