apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "org.cocos2dx.DobiParkour"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
multiDexEnabled true
manifestPlaceholders = [CHANNEL_VALUE: "Youmi"]
}
signingConfigs {
release {
}
}
buildTypes {
debug{
}
release {
buildConfigField "boolean","LOG_DEBUG","false"
minifyEnabled false
zipAlignEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
signingConfig signingConfigs.release
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = "DobiParkour_${variant.productFlavors[0].name}.apk"
output.outputFile = new File(outputFile.parent,fileName)
}
}
}
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
assets.srcDirs= ['assets']
}
}
productFlavors {
Youmi {}
Xindian {}
Saile {}
Youyoucun {}
Kuhua {}
Sikai {}
Damengshikong {}
jimeichuanmei {}
Dianle {}
Manleyou {}
Gude {}
}
productFlavors.all { flavor ->
flavor.manifestPlaceholders = [CHANNEL_VALUE: name]
}
}
dependencies {
compile fileTree(dir: 'libs',include: ['*.jar','.so'])
compile project(':libcocos2dx')
compile files('libs/alipaysdk.jar')
compile files('libs/alipaysecsdk.jar')
compile files('libs/alipayutdid.jar')
compile files('libs/android-support-v4.jar')
compile files('libs/BmobPay_V1.0.2.jar')
compile files('libs/EAccount_SDK_Android_V3.0.9_build201509091117.jar')
compile files('libs/fastjson-1.2.5.jar')
compile files('libs/MobLogCollector.jar')
compile files('libs/MobTools.jar')
compile files('libs/open_sdk_r5509.jar')
compile files('libs/ShareSDK-Core-2.6.3.jar')
compile files('libs/ShareSDK-QQ-2.6.3.jar')
compile files('libs/ShareSDK-QZone-2.6.3.jar')
compile files('libs/ShareSDK-SinaWeibo-2.6.3.jar')
compile files('libs/ShareSDK-Wechat-2.6.3.jar')
compile files('libs/ShareSDK-Wechat-Core-2.6.3.jar')
compile files('libs/ShareSDK-Wechat-Moments-2.6.3.jar')
compile files('libs/volley.jar')
}
以上写法包含了多渠道打包的方法以及打包.so库和cocos2dx中resources的方法。
原文链接:https://www.f2er.com/cocos2dx/340349.html