apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.mg.axechen.wanandroid"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 2
        versionName "1.2"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }

    def keystoreFilepath = ''
    def keystorePSW = ''
    def keystoreAlias = ''
    def keystoreAliasPSW = ''
    def keyfile = file('s.keystore.temp')

    Properties properties = new Properties()
    properties.load(project.rootProject.file('local.properties').newDataInputStream())
    keystoreFilepath = properties.getProperty("keystore.path")

    if (keystoreFilepath) {
        keystorePSW = properties.getProperty("keystore.password")
        keystoreAlias = properties.getProperty("keystore.alias")
        keystoreAliasPSW = properties.getProperty("keystore.alias_password")
        keyfile = file(keystoreFilepath)
    }

    signingConfigs {
        config {
            keyAlias keystoreAlias
            keyPassword keystoreAliasPSW
            storeFile keyfile
            storePassword keystorePSW
        }
    }

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

        debug {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }


}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"

    // 网络请求方面
    compile "io.reactivex.rxjava2:rxjava:2.1.0"
    compile "io.reactivex.rxjava2:rxandroid:2.0.1"
    compile 'com.squareup.retrofit2:retrofit:2.3.0'
    compile 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
    compile 'com.squareup.retrofit2:converter-gson:2.3.0'
    compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'

    // 沉浸式状态栏
    compile 'com.gyf.barlibrary:barlibrary:2.3.0'

    // 换肤框架
    compile 'com.bilibili:magicasakura:0.1.8@aar'

    // cardView
    compile 'com.android.support:cardview-v7:26.1.0'

    // baseAdapter
    compile 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'

    // 图片请求框架
    compile 'com.github.bumptech.glide:glide:4.0.0'

    // webView
    compile 'com.just.agentweb:agentweb:3.0.0'

    // floatMenu
    compile 'com.getbase:floatingactionbutton:1.10.1'
}
