apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    defaultConfig {
        applicationId "com.longtu.sample"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 10
        versionName "2.0.8"

        ndk {
            // Specifies the ABI configurations of your native
            // libraries Gradle should build and package with your APK.
//             abiFilters 'armeabi','armeabi-v7a','arm64-v8a','x86','x86_64'
            abiFilters 'armeabi-v7a', 'x86'
        }
    }


    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

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

        }
    }

    sourceSets {
        main {
            jniLibs.srcDirs = ["libs"]
            assets.srcDirs = ['src/main/assets', 'src/main/assets/']
        }
    }


    android.applicationVariants.all { variant ->
        variant.outputs.all {
            def fileName = "LTBaseSdk_Demo_V${variant.versionName}_${variant.buildType.name}_${buildTime()}.apk"
            if ("debug" == variant.buildType.name) {
                fileName = "LTBaseSdk_Demo_V${variant.versionName}_${variant.buildType.name}.apk"
            }
            outputFileName = fileName
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation fileTree(dir: 'libs', include: ['*.aar'])
    implementation fileTree(dir: 'libs', include: ['*so'])

}

def buildTime() {
    def date = new Date()
    def formattedDate = date.format('MMddHHmm')
    return formattedDate
}

