/*
 * Copyright (C) 2018 Drake, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "kotlin-kapt"
apply plugin: 'kotlinx-serialization'

android {
    compileSdkVersion 30
    signingConfigs {
        signed {
            storeFile file("../signed")
            storePassword "s73dfyUxkjuq"
            keyAlias "key0"
            keyPassword "s73dfyUxkjuq"
        }
    }
    defaultConfig {
        applicationId "com.drake.net.sample"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        multiDexEnabled true
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.signed
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
        }
    }

    dataBinding {
        enabled = true
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    applicationVariants.all {
        it.outputs.each { output ->
            output.outputFileName = "net-sample.apk"
        }
    }

}

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "androidx.appcompat:appcompat:1.2.0"
    implementation "androidx.core:core-ktx:1.3.2"
    implementation "androidx.constraintlayout:constraintlayout:2.0.4"
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation "junit:junit:4.13.2"
    androidTestImplementation "androidx.test:runner:1.3.0"
    androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
    implementation "androidx.recyclerview:recyclerview:1.2.0"
    implementation "com.google.android.material:material:1.3.0"
    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.5'

    implementation project(path: ":net")
    implementation "com.squareup.okhttp3:okhttp:$okhttp_version"

    // ------------------------------配合Net使用的库-------------------------------------
    implementation "com.github.liangjingkanji:BRV:$brv_version" // 提供自动分页/缺省页/自动下拉刷新功能
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutine_version" // 协程基础库
    implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutine_version"
    implementation "com.github.chuckerteam.chucker:library:3.5.2" // 通知栏监听网络日志


    // ------------------------------JSON解析-------------------------------------
    implementation "com.squareup.moshi:moshi-kotlin:1.8.0"
    kapt "com.squareup.moshi:moshi-kotlin-codegen:1.8.0"
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.alibaba:fastjson:1.2.73'
    implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2"

    // ------------------------------其他库-------------------------------------
    implementation "com.github.bumptech.glide:glide:$glide_version" // 图片加载库
    implementation 'com.github.liangjingkanji:StatusBar:2.0.2' // 透明状态栏
    implementation 'com.github.liangjingkanji:debugkit:1.3.0' // 开发调试窗口工具
    implementation "com.github.liangjingkanji:Tooltip:1.2.1" // 吐司工具
    implementation 'com.github.liangjingkanji:Engine:0.0.64'
}
