apply plugin: 'com.android.application'// 打包时间static def buildTime() {    return new Date().format("yyyy-MM-dd-HH-mm-ss", TimeZone.getTimeZone("GMT+08:00"))}android {    compileSdkVersion 25    buildToolsVersion '27.0.3'    // 指定签名文件    signingConfigs {        test {            keyAlias 'test'            keyPassword 'test123'            storeFile file('../test.jks')            storePassword 'test123'        }    }    defaultConfig {        applicationId "top.tobin.game"        minSdkVersion 14        targetSdkVersion 25        versionCode 100        versionName "1.0.0"        // dex突破65535的限制        multiDexEnabled true        // 设置AndroidManifest.xml 里面icon 的value默认值        manifestPlaceholders = [app_icon : "@mipmap/ic_launcher"]        resValue "string", "app_name", "Game_Default"    }    //执行lint检查,有任何的错误或者警告提示,都会终止构建,我们可以将其关掉。    lintOptions {        checkReleaseBuilds false        abortOnError false        // 防止在发布的时候出现因MissingTranslation导致Build Failed!        disable 'MissingTranslation'    }    dexOptions {        javaMaxHeapSize "8g"        jumboMode = true        preDexLibraries = false        threadCount ="8"    }    allprojects {        // 加快 Android Studio 编译        tasks.withType(JavaCompile) {            // 使在一个单独的守护进程编译            options.fork = true            // 增量编译            options.incremental = true        }        repositories {            jcenter()        }    }    buildTypes {        release {            minifyEnabled false            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'            signingConfig signingConfigs.test        }        applicationVariants.all { variant ->            variant.outputs.all { output ->                def versionName = variant.versionName                def versionCode = variant.versionCode                def buildType = variant.buildType.name                if (variant.buildType.name == 'debug') {                    outputFileName = "Game_${variant.flavorName}_${versionName}_${versionCode}_${buildType}.apk"                } else {                    outputFileName = "Game_${variant.flavorName}_v${versionName}_${buildTime()}_${buildType}.apk"                }            }        }    }    flavorDimensions "default"    productFlavors {        dev {            dimension "default"            resValue "string", "app_name", "GameMultichannel"            applicationId 'top.tobin.game'            manifestPlaceholders = [ENVIRONMENT: "dev", app_icon : "@mipmap/ic_launcher"]        }        common {            dimension "default"            applicationId 'top.tobin.game.commonsdk'            versionCode 101            versionName "1.0.1"            resValue "string", "app_name", "Game_Common"        }        ysdk {            dimension "default"            applicationId 'top.tobin.game.tencent'            versionCode 105            versionName "1.0.5"            resValue "string", "app_name", "Game_YSDK"        }    }}repositories {    flatDir {        dirs '../YSDK/libs'        dirs 'libs'    }}dependencies {    api fileTree(include: ['*.jar'], dir: 'libs')    testImplementation 'junit:junit:4.12'    androidTestImplementation 'com.android.support.test:runner:1.0.1'    api project(':sdkproxy')    commonApi project(':commonSDK')    ysdkApi project(':YSDK')}

更多相关文章

  1. Android(安卓)增量更新实例
  2. Android(安卓)DEX方法超过64K和gradle编译OOM解决方案
  3. 《Android系统学习》第五章:编译Android的JDK环境
  4. 解决Cocos2d-x3.1编译生成Android程序出现Android(安卓)NDK:Abor
  5. Android(安卓)JNI入门第一篇――HelloWord
  6. Android(安卓)APP增量升级的实现方式
  7. android反编译工具之jadx简介
  8. ubuntu 16.04 编译 android 6.0 错误
  9. android开发环境_反编译

随机推荐

  1. 【转】Ubuntu下Adb调试Android找不到设备
  2. Android(安卓)移植到高清机顶盒csm1201[
  3. Android(安卓)TV机顶盒开发简单介绍
  4. app测试中ios和Android的区别
  5. Android(安卓)使用LeakCanary 检测内存泄
  6. Google Android开发精华教程【转】
  7. Android(安卓)使用非阻塞的方式读写串口
  8. android中Menu介绍
  9. 由 Sense 4.0 说开去: Android(安卓)第三
  10. Android程序开发初级教程(一)