import java.text.SimpleDateFormat

plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion rootProject.ext.android.compileSdkVersion

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

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

    }
    signingConfigs {
        release {
            storeFile file('airport.jks')
            keyAlias 'airport'
            keyPassword 'airport@123'
            storePassword 'airport@123'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            zipAlignEnabled false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            buildConfigField "String", "API_HOST", rootProject.ext.release.apiHost
            buildConfigField "String", "API_PATH", rootProject.ext.release.apiName
            buildConfigField "String", "FILEAPI_HOST", rootProject.ext.release.fileApiHost
            buildConfigField "String", "FILEAPI_PATH", rootProject.ext.release.fileApiName
        }
        debug {
//            debuggable true // 是否调试
            minifyEnabled false
            zipAlignEnabled false
            signingConfig signingConfigs.release
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "String", "API_HOST", rootProject.ext.debug.apiHost
            buildConfigField "String", "API_PATH", rootProject.ext.debug.apiName
            buildConfigField "String", "FILEAPI_HOST", rootProject.ext.debug.fileApiHost
            buildConfigField "String", "FILEAPI_PATH", rootProject.ext.debug.fileApiName
        }
    }


    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
            aidl.srcDirs = ['src/main/aidl']
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lint {
        abortOnError false
        checkReleaseBuilds false
    }
    namespace 'com.hw.nativeapp'

    android.applicationVariants.all {
        variant ->
            variant.outputs.all {
                //在这里修改apk文件名
                def df = new SimpleDateFormat('yyyyMMdd')
                outputFileName = "PDA_${variant.name}_${df.format(new Date())}_${variant.versionName}_${variant.versionCode}.apk"
            }
    }
}

dependencies {
    implementation fileTree(include: ['*.aar','*.jar'], dir: 'libs')
//    implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.multidex:multidex:2.0.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.navigation:navigation-fragment:2.2.2'
    implementation 'androidx.navigation:navigation-ui:2.2.2'
    implementation 'androidx.viewpager:viewpager:1.0.0'
    testImplementation 'junit:junit:4.+'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'

    implementation 'com.xw.repo:xedittext:2.1.0@aar'

    api 'com.jakewharton:butterknife:10.2.3'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
    implementation 'com.squareup.retrofit2:converter-scalars:2.2.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.2.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.34'
    implementation 'com.jakewharton:butterknife:10.2.3'
    implementation 'com.blankj:utilcode:1.30.5'
    api 'io.reactivex.rxjava2:rxjava:2.0.6'
    api 'io.reactivex.rxjava2:rxandroid:2.0.1'
    implementation 'com.squareup.okhttp3:okhttp:3.8.1'

    implementation 'com.hjq:titlebar:5.0'
//    implementation 'org.xutils:xutils:3.4.0'

    implementation 'com.alibaba:fastjson:1.2.8'
    implementation 'com.google.zxing:core:3.4.1'
    implementation('com.journeyapps:zxing-android-embedded:3.6.0') { transitive = false }

//文件下载--升级
    implementation 'com.liulishuo.filedownloader:library:1.7.4'
//    图片加载
    implementation 'com.squareup.picasso:picasso:2.5.2'

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.2.1'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.1.0'
    implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.1.0'
}

// SH1: 84:DD:2A:D6:4A:63:12:6B:06:9F:24:38:1F:57:32:8F:4D:5F:EE:78