123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- import org.apache.tools.ant.taskdefs.condition.Os
- apply plugin: 'com.android.application'
- def releaseTime() {
- return new Date().format("yyyyMMdd", TimeZone.getTimeZone("UTC"))
- }
- android {
- compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
- buildToolsVersion PROP_BUILD_TOOLS_VERSION
- defaultConfig {
- applicationId "com.edufound.mobile"
- minSdkVersion PROP_MIN_SDK_VERSION
- targetSdkVersion PROP_TARGET_SDK_VERSION
- versionCode 91000
- versionName "9.1.0.0.0"
- flavorDimensions "versionCode"
- manifestPlaceholders = [UMENG_CHANNEL_VALUE: "2006"]//添加一个默认渠道号
- ndk {
- abiFilters 'armeabi-v7a'
- }
- externalNativeBuild {
- ndkBuild {
- if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
- // skip the NDK Build step if PROP_NDK_MODE is none
- targets 'cocos2djs'
- arguments 'NDK_TOOLCHAIN_VERSION=clang'
- def module_paths = [project.file("G:/CocosCreator/cocoscreator_ide/CocosCreator_v2.4.0_20200622_win/resources/cocos2d-x"),
- project.file("G:/CocosCreator/cocoscreator_ide/CocosCreator_v2.4.0_20200622_win/resources/cocos2d-x/cocos"),
- project.file("G:/CocosCreator/cocoscreator_ide/CocosCreator_v2.4.0_20200622_win/resources/cocos2d-x/external")]
- if (Os.isFamily(Os.FAMILY_WINDOWS)) {
- arguments 'NDK_MODULE_PATH=' + module_paths.join(";")
- } else {
- arguments 'NDK_MODULE_PATH=' + module_paths.join(':')
- }
- arguments '-j' + Runtime.runtime.availableProcessors()
- abiFilters.addAll(PROP_APP_ABI.split(':').collect { it as String })
- }
- }
- }
- }
- sourceSets.main {
- java.srcDirs "../src", "src"
- res.srcDirs "../res", 'res'
- jniLibs.srcDirs "../libs", 'libs'
- manifest.srcFile "AndroidManifest.xml"
- }
- externalNativeBuild {
- ndkBuild {
- if (!project.hasProperty("PROP_NDK_MODE") || PROP_NDK_MODE.compareTo('none') != 0) {
- // skip the NDK Build step if PROP_NDK_MODE is none
- path "jni/Android.mk"
- }
- }
- }
- signingConfigs {
- release {
- if (project.hasProperty("RELEASE_STORE_FILE")) {
- storeFile file(RELEASE_STORE_FILE)
- storePassword RELEASE_STORE_PASSWORD
- keyAlias RELEASE_KEY_ALIAS
- keyPassword RELEASE_KEY_PASSWORD
- }
- }
- }
- buildTypes {
- release {
- debuggable false
- jniDebuggable false
- renderscriptDebuggable false
- minifyEnabled true
- shrinkResources true
- zipAlignEnabled true
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- if (project.hasProperty("RELEASE_STORE_FILE")) {
- signingConfig signingConfigs.release
- }
- applicationVariants.all { variant ->
- variant.outputs.each { output ->
- def outputFile = output.outputFileName
- if (outputFile != null && output.outputFileName.endsWith('.apk')) {
- def fileName = "efunbox_tv_v${defaultConfig.versionCode}_${releaseTime()}_${variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE}_r.apk"
- def channel = variant.productFlavors[0].manifestPlaceholders.UMENG_CHANNEL_VALUE;
- def newoutputFile = "";
- if (channel == ("2006")) {
- newoutputFile = "\\义方\\"
- } else if (channel == ("2001")) {
- newoutputFile = "\\应用宝\\"
- } else if (channel == ("2002")) {
- newoutputFile = "\\360应用市场\\"
- } else if (channel == ("2003")) {
- newoutputFile = "\\百度手机助手\\"
- } else if (channel == ("2008")) {
- newoutputFile = "\\小米\\"
- } else if (channel == ("2012")) {
- newoutputFile = "\\华科\\"
- } else if (channel == ("2013")) {
- newoutputFile = "\\步步高\\"
- } else if (channel == ("2015")) {
- newoutputFile = "\\状元才子\\"
- } else if (channel == ("2011")) {
- newoutputFile = "\\广西优学\\"
- } else if (channel == ("2007")) {
- newoutputFile = "\\vivo\\"
- }
- output.outputFileName = new File(newoutputFile, fileName)
- }
- }
- }
- externalNativeBuild {
- ndkBuild {
- arguments 'NDK_DEBUG=0'
- }
- }
- }
- // debug {
- // debuggable true
- // jniDebuggable true
- // renderscriptDebuggable true
- // externalNativeBuild {
- // ndkBuild {
- // arguments 'NDK_DEBUG=1'
- // }
- // }
- // }
- }
- productFlavors {
- //义方
- channel_efunbox {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2006",
- appIcon: "@drawable/icon",
- ]
- }
- //应用宝
- channel_yyb {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2001",
- appIcon: "@drawable/icon",
- ]
- }
- //360应用市场
- channel_360 {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2002",
- appIcon: "@drawable/icon",
- ]
- }
- //百度手机助手
- channel_bdsjzs {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2003",
- appIcon: "@drawable/icon",
- ]
- }
- //vivo
- channel_vivo {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2007",
- appIcon: "@drawable/icon",
- ]
- }
- //小米
- channel_xiaomi {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2008",
- appIcon: "@drawable/icon",
- ]
- }
- //华科
- channel_huake {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2012",
- appIcon: "@drawable/icon",
- ]
- }
- //步步高
- channel_bubugao {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2013",
- appIcon: "@drawable/icon",
- ]
- }
- //状元才子
- channel_zhuangyuancaizi {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2015",
- appIcon: "@drawable/icon",
- ]
- }
- //广西优学
- channel_guangxiyouxue {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2011",
- appIcon: "@drawable/icon",
- ]
- }
- //字节跳动
- channel_bytedance {
- signingConfig signingConfigs.release
- manifestPlaceholders = [
- appCode: "2020",
- appIcon: "@drawable/icon",
- ]
- }
- }
- productFlavors.all {
- flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: manifestPlaceholders.appCode, icon: manifestPlaceholders.appIcon]
- }
- }
- android.applicationVariants.all { variant ->
- // delete previous files first
- delete "${buildDir}/intermediates/merged_assets/${variant.dirName}"
- variant.mergeAssets.doLast {
- def sourceDir = "${buildDir}/../../../../.."
- copy {
- from "${sourceDir}/assets"
- into "${outputDir}/assets"
- }
- copy {
- from "${sourceDir}/src"
- into "${outputDir}/src"
- }
- copy {
- from "${sourceDir}/jsb-adapter"
- into "${outputDir}/jsb-adapter"
- }
- copy {
- from "${sourceDir}/main.js"
- from "${sourceDir}/project.json"
- into outputDir
- }
- }
- }
- dependencies {
- implementation fileTree(dir: '../libs', include: ['*.jar', '*.aar'])
- implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
- implementation "com.android.support:appcompat-v7:28.0.0"
- implementation fileTree(dir: "G:/CocosCreator/cocoscreator_ide/CocosCreator_v2.4.0_20200622_win/resources/cocos2d-x/cocos/platform/android/java/libs", include: ['*.jar'])
- implementation 'com.google.code.gson:gson:2.8.6'
- implementation 'com.google.android.gms:play-services-instantapps:16.0.0'
- //微信登录、微信支付等
- implementation "com.tencent.mm.opensdk:wechat-sdk-android-with-mta:+"
- implementation project(':libcocos2dx')
- // 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
- implementation 'com.umeng.umsdk:common:9.4.4'// (必选)
- implementation 'com.umeng.umsdk:asms:1.4.1'// asms包依赖必选
- // implementation 'com.umeng.umsdk:abtest:1.0.0'//使用U-App中ABTest能力,可选
- //友盟Push依赖
- api 'com.umeng.umsdk:push:6.4.5'
- //友盟P厂商推送渠道(小米)
- api 'com.umeng.umsdk:xiaomi-umengaccs:1.2.6'
- implementation 'com.umeng.umsdk:xiaomi-push:4.8.1'
- //友盟P厂商推送(华为)
- api 'com.umeng.umsdk:huawei-umengaccs:1.3.5'
- api 'com.huawei.hms:push:5.3.0.304'
- //友盟厂商推送(魅族)
- api 'com.umeng.umsdk:meizu-umengaccs:1.1.5'
- api 'com.umeng.umsdk:meizu-push:4.1.4'
- //友盟厂商推送(OPPO)
- api 'com.umeng.umsdk:oppo-umengaccs:1.0.7-fix'
- implementation 'com.umeng.umsdk:oppo-push:2.1.0'
- //友盟厂商(ViVo)
- api 'com.umeng.umsdk:vivo-umengaccs:1.1.5'
- implementation 'com.umeng.umsdk:vivo-push:3.0.0.3'
- }
|