apply plugin: 'com.android.application'

static def releaseTime() {
    return new Date().format("yyyy-MM-dd_hh-mm-ss", TimeZone.getTimeZone("GMT+08:00"))
}

def keystorePropertiesFile = rootProject.file("keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {

    signingConfigs {
        releaseSign {
            keyAlias keystoreProperties["keyAliasRelease"]
            keyPassword keystoreProperties["keyPasswordRelease"]
            storeFile file(keystoreProperties['storeFileRelease'])
            storePassword keystoreProperties["storePasswordRelease"]
        }
        debugSign {
            keyAlias keystoreProperties["keyAliasRelease"]
            keyPassword keystoreProperties["keyPasswordRelease"]
            storeFile file(keystoreProperties['storeFileRelease'])
            storePassword keystoreProperties["storePasswordRelease"]
        }
    }

    compileSdkVersion build_versions.compile_sdk
    buildToolsVersion build_versions.build_tools
    defaultConfig {
        applicationId "com.wildeyess.player"
        minSdkVersion build_versions.min_sdk
        targetSdkVersion build_versions.target_sdk
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        ndk {
            abiFilters "armeabi", "armeabi-v7a"
/*, "x86", "x86_64"*//*, "arm64-v8a", "x86", "x86_64", "mips", "mips64"*/
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    flavorDimensions "default"
    productFlavors {
        develop {}
        check {}
        product {}
        productFlavors.all { flavor ->
            flavor.dimension = "default"
            flavor.manifestPlaceholders = [
                                           app_name_launcher  : "AiPlayer",
                                           app_icon           : "@drawable/icon_product"
            ]
            android.applicationVariants.all { variant ->
                variant.outputs.all {
                    outputFileName = "player_${defaultConfig.versionName}_${variant.flavorName}_${variant.buildType.name}_${releaseTime()}.apk"
                }
            }
        }
    }

    dataBinding {
        enabled = true
    }

    //支持lambda语法
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'

    implementation 'com.github.bumptech.glide:glide:4.11.0'

    implementation 'com.jakewharton:butterknife:10.2.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1'

    implementation 'com.gyf.immersionbar:immersionbar:3.0.0'

    implementation "com.google.android.material:material:1.2.1"

    //noinspection GradleCompatible
    implementation 'com.android.support:design:28.0.0'

    implementation 'com.androidkun:XTabLayout:1.1.4'

    implementation 'io.reactivex:rxjava:1.1.0'

    implementation 'com.airbnb.android:lottie:2.8.0'


}
