123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- import org.apache.tools.ant.taskdefs.condition.Os
- apply plugin: 'com.android.application'
- 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"
- 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
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
- if (project.hasProperty("RELEASE_STORE_FILE")) {
- signingConfig signingConfigs.release
- }
- externalNativeBuild {
- ndkBuild {
- arguments 'NDK_DEBUG=0'
- }
- }
- }
- // debug {
- // debuggable true
- // jniDebuggable true
- // renderscriptDebuggable true
- // externalNativeBuild {
- // ndkBuild {
- // arguments 'NDK_DEBUG=1'
- // }
- // }
- // }
- }
- }
- 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')
- }
|