155 lines
5.0 KiB
Groovy
155 lines
5.0 KiB
Groovy
import org.apache.tools.ant.taskdefs.condition.Os
|
|
|
|
apply plugin: 'com.android.application'
|
|
apply plugin: 'com.google.gms.google-services'
|
|
|
|
RES_PATH = RES_PATH.replace("\\", "/")
|
|
COCOS_ENGINE_PATH = COCOS_ENGINE_PATH.replace("\\", "/")
|
|
|
|
buildDir = "${RES_PATH}/proj/build/${project.name ==~ /^[_a-zA-Z0-9-]+$/ ? project.name : 'CocosGame'}"
|
|
android {
|
|
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
|
|
buildToolsVersion PROP_BUILD_TOOLS_VERSION
|
|
ndkVersion PROP_NDK_VERSION
|
|
namespace APPLICATION_ID
|
|
|
|
compileOptions {
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
}
|
|
|
|
defaultConfig {
|
|
applicationId APPLICATION_ID
|
|
minSdkVersion PROP_MIN_SDK_VERSION
|
|
targetSdkVersion PROP_TARGET_SDK_VERSION
|
|
versionCode 1
|
|
versionName "1.0"
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
targets "cocos"
|
|
arguments "-DRES_DIR=${RES_PATH}", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
|
|
}
|
|
ndk { abiFilters PROP_APP_ABI.split(':') }
|
|
}
|
|
}
|
|
|
|
sourceSets.main {
|
|
java.srcDirs "../src", "src"
|
|
res.srcDirs "../res", 'res'
|
|
jniLibs.srcDirs "../libs", 'libs'
|
|
manifest.srcFile "AndroidManifest.xml"
|
|
assets.srcDir "${RES_PATH}/data"
|
|
jniLibs {
|
|
// Vulkan validation layer
|
|
// srcDir "${android.ndkDirectory}/sources/third_party/vulkan/src/build-android/jniLibs"
|
|
}
|
|
}
|
|
|
|
packagingOptions {
|
|
jniLibs {
|
|
useLegacyPackaging Boolean.parseBoolean(PROP_ENABLE_COMPRESS_SO)
|
|
}
|
|
}
|
|
|
|
externalNativeBuild {
|
|
cmake {
|
|
version "3.22.1"
|
|
path "../CMakeLists.txt"
|
|
buildStagingDirectory "${RES_PATH}/proj/build"
|
|
}
|
|
}
|
|
|
|
signingConfigs {
|
|
|
|
release {
|
|
if (project.hasProperty("RELEASE_STORE_FILE") && !RELEASE_STORE_FILE.isEmpty()) {
|
|
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 {
|
|
cmake {
|
|
// switch HIDE_SYMBOLS to OFF to skip compilation flag `-fvisibility=hidden`
|
|
arguments "-DHIDE_SYMBOLS=ON"
|
|
}
|
|
}
|
|
|
|
if (!Boolean.parseBoolean(PROP_IS_DEBUG)) {
|
|
getIsDefault().set(true)
|
|
}
|
|
|
|
}
|
|
|
|
debug {
|
|
debuggable true
|
|
jniDebuggable true
|
|
renderscriptDebuggable true
|
|
// resValue "string", "app_name", "${PROP_APP_NAME}-dbg"
|
|
// applicationIdSuffix ".debug"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation fileTree(dir: '../libs', include: ['*.jar','*.aar'])
|
|
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
|
|
implementation fileTree(dir: "${COCOS_ENGINE_PATH}/cocos/platform/android/java/libs", include: ['*.jar'])
|
|
implementation project(':libservice')
|
|
implementation project(':libcocos')
|
|
if (Boolean.parseBoolean(PROP_ENABLE_INPUTSDK)) {
|
|
implementation 'com.google.android.libraries.play.games:inputmapping:1.1.0-beta'
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.10"
|
|
}
|
|
|
|
// Google
|
|
implementation 'com.google.android.gms:play-services-location:21.2.0'
|
|
implementation 'com.google.android.gms:play-services-auth:21.0.0'
|
|
implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1'
|
|
implementation 'com.android.billingclient:billing:7.0.0'
|
|
implementation 'com.google.android.gms:play-services-games:23.1.0'
|
|
|
|
// Firebase
|
|
implementation platform('com.google.firebase:firebase-bom:32.3.1')
|
|
implementation 'com.google.firebase:firebase-messaging'
|
|
implementation 'com.google.firebase:firebase-analytics'
|
|
|
|
// Adjust
|
|
implementation 'com.adjust.sdk:adjust-android:4.38.3'
|
|
implementation 'com.android.installreferrer:installreferrer:2.2'
|
|
|
|
// Bugly
|
|
implementation 'com.tencent.bugly:crashreport:4.0.0'
|
|
implementation 'com.tencent.bugly:nativecrashreport:3.9.2'
|
|
|
|
// Zego
|
|
implementation 'im.zego:express-audio:3.18.0'
|
|
|
|
// Glide
|
|
implementation 'com.github.bumptech.glide:glide:4.11.0'
|
|
|
|
// PictureSelector
|
|
implementation 'io.github.lucksiege:pictureselector:v3.11.1'
|
|
implementation 'io.github.lucksiege:compress:v3.11.1'
|
|
implementation 'io.github.lucksiege:ucrop:v3.11.1'
|
|
implementation 'io.github.lucksiege:camerax:v3.11.1'
|
|
|
|
implementation 'org.jetbrains:annotations:15.0'
|
|
}
|