top-block-game-cocos-sdk/native/engine/android/app/build.gradle

116 lines
3.8 KiB
Groovy

import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
RES_PATH = RES_PATH.replace("\\", "/")
COCOS_ENGINE_PATH = COCOS_ENGINE_PATH.replace("\\", "/")
buildDir = "${RES_PATH}/proj/build/$project.name"
android {
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
buildToolsVersion PROP_BUILD_TOOLS_VERSION
ndkPath PROP_NDK_PATH
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}", "-DCOCOS_X_PATH=${COCOS_ENGINE_PATH}", "-DANDROID_STL=c++_static", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE", "-DANDROID_LD=gold"
}
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"
}
}
externalNativeBuild {
cmake {
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
}
// resValue "string", "app_name", PROP_APP_NAME
}
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')
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 'com.github.WalletConnect:kotlin-walletconnect-lib:0.9.6'
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.google.code.gson:gson:2.9.1'
}