apply plugin: 'com.android.application' //apply plugin: 'io.fabric' repositories { mavenCentral() mavenLocal() flatDir { dirs 'libs' } } def bakPath = file("${buildDir}/bakApk/") android { compileSdkVersion 28 defaultConfig { applicationId "com.smileflowpig.money" minSdkVersion 19 targetSdkVersion 28 versionCode 14 versionName "2.2.1" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } //签名 signingConfigs { myConfig { storeFile file("bangnidai.jks") //签名文件 storePassword "bangnidai123" keyAlias "bangnidai" keyPassword "bangnidai123" //签名密码 } } buildTypes { release { signingConfig signingConfigs.myConfig multiDexEnabled true minifyEnabled false proguardFiles 'proguard-rules.pro' applicationVariants.all { variant -> // 更新至Android Studio 3.3 gradle 4.10.1 variant.outputs.all { outputFileName = "xiaohuazhu_${variant.flavorName}_${variant.versionCode}-${variant.versionName}-${releaseTime()}.apk" } // variant.outputs.each { output -> // if (output.outputFile != null && output.outputFile.name.endsWith('.apk') // && 'release'.equals(variant.buildType.name)) { // def apkFile = new File( // output.outputFile.getParent(), // "xiaohuazhu${variant.flavorName}_v${variant.versionName}_${releaseTime()}.apk") // output.outputFile = apkFile // } // } // } } } debug { signingConfig signingConfigs.myConfig minifyEnabled false multiDexEnabled true proguardFiles 'proguard-rules.pro' } } flavorDimensions "default" productFlavors { aoppo { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1006"] buildConfigField 'String', 'CHANNLE', '"1006"' } a360 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1002"] buildConfigField 'String', 'CHANNLE', '"1002"' } ayingyongbao { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1001"] buildConfigField 'String', 'CHANNLE', '"1001"' } axiaomi { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1004"] buildConfigField 'String', 'CHANNLE', '"1004"' } ahuawei { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1005"] buildConfigField 'String', 'CHANNLE', '"1005"' } ameizu { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1007"] buildConfigField 'String', 'CHANNLE', '"1007"' } avivo { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "1003"] buildConfigField 'String', 'CHANNLE', '"1003"' } search360 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "4001"] buildConfigField 'String', 'CHANNLE', '"4001"' } smss01 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40002"] buildConfigField 'String', 'CHANNLE', '"40002"' } smss02 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40003"] buildConfigField 'String', 'CHANNLE', '"40003"' } smss03 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40004"] buildConfigField 'String', 'CHANNLE', '"40004"' } smss07 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40005"] buildConfigField 'String', 'CHANNLE', '"40005"' } smss08 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40006"] buildConfigField 'String', 'CHANNLE', '"40006"' } smss09 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40007"] buildConfigField 'String', 'CHANNLE', '"40007"' } smss10 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40008"] buildConfigField 'String', 'CHANNLE', '"40008"' } smss11 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40009"] buildConfigField 'String', 'CHANNLE', '"40009"' } smss13 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40025"] buildConfigField 'String', 'CHANNLE', '"40025"' } aqy01 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40013"] buildConfigField 'String', 'CHANNLE', '"40013"' } aqy02 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40014"] buildConfigField 'String', 'CHANNLE', '"40014"' } aqy03 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40015"] buildConfigField 'String', 'CHANNLE', '"40015"' } aqy04 { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40016"] buildConfigField 'String', 'CHANNLE', '"40016"' } tuiguan { manifestPlaceholders = [UMENG_CHANNEL_VALUE: "40085"] buildConfigField 'String', 'CHANNLE', '"40085"' } } } def releaseTime() { return new Date().format("yyyy-MM-dd", TimeZone.getTimeZone("UTC")) } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') androidTestImplementation 'com.android.support.test:runner:1.0.2' androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' // compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') { // transitive = true; // } implementation(name: 'base', ext: 'aar') // compile "com.android.support:appcompat-v7:$rootProject.ext.supportVersion" // compile "com.android.support:recyclerview-v7:$rootProject.ext.supportVersi // on" // compile "com.android.support:design:$rootProject.ext.supportVersion" implementation "net.qiujuer.genius:ui:$rootProject.ext.geniusVersion" implementation "net.qiujuer.genius:res:$rootProject.ext.geniusVersion" implementation "de.hdodenhof:circleimageview:$rootProject.ext.circleimageviewVersion" implementation 'com.github.bumptech.glide:glide:3.7.0' implementation "com.jakewharton:butterknife:$rootProject.ext.butterknifeVersion" annotationProcessor "com.jakewharton:butterknife-compiler:$rootProject.ext.butterknifeVersion" implementation "pub.devrel:easypermissions:$rootProject.ext.easyPMVersion" // 空气面板 implementation "net.qiujuer.widget:airpanel:$rootProject.ext.airpanelVersion" implementation project(':common') implementation project(':lang') implementation project(':factory') implementation project(':PhotoPicker') implementation 'com.liulishuo.filedownloader:library:1.6.5' implementation 'org.jsoup:jsoup:1.9.2' implementation 'com.lovedise:permissiongen:0.0.6' implementation 'q.rorbin:badgeview:1.1.2' implementation 'com.youth.banner:banner:1.4.9' implementation 'com.github.addappcn:android-pickers:1.0.3' implementation 'com.contrarywind:Android-PickerView:4.1.6' implementation 'com.android.support.constraint:constraint-layout:1.0.2' // compile 'com.android.support:support-v4:25.+' implementation 'com.scwang.smartrefresh:SmartRefreshLayout:1.0.3' implementation 'com.scwang.smartrefresh:SmartRefreshHeader:1.0.3' implementation 'com.github.ittianyu:BottomNavigationViewEx:1.2.1' implementation 'org.greenrobot:eventbus:3.0.0' implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.30' testImplementation 'junit:junit:4.12' implementation 'com.github.lsjwzh.RecyclerViewPager:lib:v1.1.2' implementation 'com.github.mcxtzhang:SuspensionIndexBar:V1.0.0' implementation 'com.squareup.retrofit2:retrofit:2.3.0' implementation 'com.squareup.retrofit2:converter-gson:2.3.0' implementation 'io.reactivex.rxjava2:rxjava:2.1.6' implementation 'io.reactivex.rxjava2:rxandroid:2.0.1' implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0' implementation 'com.zhy:autolayout:1.4.5' implementation 'com.xhb:xbanner:1.4.1' implementation 'com.flyco.tablayout:FlycoTabLayout_Lib:2.1.2@aar' implementation 'com.contrarywind:Android-PickerView:4.1.6' implementation 'com.tbruyelle.rxpermissions2:rxpermissions:0.9.4@aar' implementation 'com.amap.api:location:latest.integration' implementation 'me.yokeyword:indexablerecyclerview:1.3.0' implementation 'com.umeng.umsdk:analytics:latest.integration' implementation 'com.umeng.umsdk:common:latest.integration' implementation 'com.android.support:cardview-v7:25.2.0' implementation files('libs/umeng-share-wechat-simplify-6.9.3.jar') implementation files('libs/MiPush_SDK_Client_3_6_9.jar') implementation 'com.huawei.android.hms:push:2.6.1.301' implementation 'com.huawei.android.hms:hwid:2.6.1.301' implementation files('libs/vivo_pushsdk_v2.3.1.jar') implementation 'com.alibaba:fastjson:1.2.54' implementation 'com.alibaba:fastjson:1.1.70.android' implementation 'com.github.franmontiel:PersistentCookieJar:v1.0.1' implementation project(':ocr_ui') } def product_name = "bangnidai_v" + android.defaultConfig.versionName def time = "1367" task initTimeScape << { println "first time" println "$time" def gCalendar = new GregorianCalendar() time = gCalendar.time.format("MMddHHmm") println "second time" println "$time" } task initReleaseApkProduct_name(dependsOn: ['initTimeScape']) << { //初始化release包名 product_name = product_name + "_" + time + "R.apk" def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_" println "$outputName" } task initDebugApkProduct_name(dependsOn: ['initTimeScape']) << { //初始化release包名 product_name = product_name + "_" + time + "D.apk" def outputName = "_OUT:>PRODUCT_FILENAME=" + product_name + ";_" println "$outputName" } task release(dependsOn: ['assembleRelease', 'initReleaseApkProduct_name']) << { copy { from('build/outputs/apk') { include('**/*-release.apk') rename '(.*)-release.apk', product_name } from('build/proguard/release') { include('**/mapping.txt') rename '(.*).txt', product_name + ".map" } into('products') } } task debug(dependsOn: ['assembleDebug', 'initDebugApkProduct_name']) << { copy { from('build/outputs/apk') { include('**/*.apk') rename '(.*).apk', product_name } into('products') } }