import org.apache.tools.ant.taskdefs.condition.Os plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-android-extensions' } android { compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger() buildToolsVersion PROP_BUILD_TOOLS_VERSION defaultConfig { applicationId "com.shjc.cebg" minSdkVersion PROP_MIN_SDK_VERSION targetSdkVersion PROP_TARGET_SDK_VERSION versionCode 3 versionName "1.0.2" ndk{ abiFilters 'armeabi-v7a','arm64-v8a' } 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("/Applications/CocosCreator.app/Contents/Resources/cocos2d-x"), project.file("/Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos"), project.file("/Applications/CocosCreator.app/Contents/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.srcDir "src" res.srcDir "res" jniLibs.srcDir "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}/res" into "${outputDir}/res" } copy { from "${sourceDir}/subpackages" into "${outputDir}/subpackages" } 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: "/Applications/CocosCreator.app/Contents/Resources/cocos2d-x/cocos/platform/android/java/libs", include: ['*.jar']) implementation project(':libcocos2dx') implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: []) implementation "org.java-websocket:Java-WebSocket:1.4.0" implementation "com.github.komputing:khex:1.0.0-RC6" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin}" implementation "androidx.appcompat:appcompat:$versions.androidx_app_compat" implementation "androidx.multidex:multidex:$versions.multidex" implementation 'com.squareup.moshi:moshi:1.8.0' implementation "com.squareup.okhttp3:okhttp:$versions.okhttp" implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0' implementation 'com.github.WalletConnect:kotlin-walletconnect-lib:0.9.6' }