axmol/templates/common/proj.android/app/build.gradle

128 lines
3.5 KiB
Groovy
Raw Normal View History

2019-11-23 20:27:39 +08:00
apply plugin: 'com.android.application'
2022-10-01 16:24:52 +08:00
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2019-11-23 20:27:39 +08:00
android {
namespace "org.axmol.dummy"
compileSdk PROP_COMPILE_SDK_VERSION.toInteger()
2019-11-23 20:27:39 +08:00
// Setup native build tools: ndk & cmake
2024-01-18 21:09:36 +08:00
def nbtInfo = axutils.findNativeBuildTools(project, '3.28.1+')
ndkVersion = nbtInfo[0]
if(nbtInfo[1]) {
ndkPath = nbtInfo[1]
2021-05-15 00:12:41 +08:00
}
def cmakeVer = nbtInfo[2]
def cmakeOptions = Eval.me(nbtInfo[3])
2022-01-28 18:25:50 +08:00
2019-11-23 20:27:39 +08:00
defaultConfig {
applicationId "org.axmol.dummy"
2019-11-23 20:27:39 +08:00
minSdkVersion PROP_MIN_SDK_VERSION
targetSdkVersion PROP_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
externalNativeBuild {
cmake {
arguments = []
arguments.addAll(cmakeOptions)
2019-11-23 20:27:39 +08:00
cppFlags "-frtti -fexceptions -fsigned-char"
}
}
ndk {
abiFilters = __1K_ARCHS.split(':').collect{it as String}
2019-11-23 20:27:39 +08:00
}
}
sourceSets.main {
java.srcDir "src"
res.srcDir "res"
manifest.srcFile "AndroidManifest.xml"
assets.srcDir "build/assets"
2019-11-23 20:27:39 +08:00
}
externalNativeBuild {
cmake {
2022-01-28 18:25:50 +08:00
version "$cmakeVer"
2019-11-23 20:27:39 +08:00
path "../../CMakeLists.txt"
}
}
signingConfigs {
release {
if (project.hasProperty("KEY_STORE_FILE")) {
storeFile file(KEY_STORE_FILE)
storePassword KEY_STORE_PASSWORD
keyAlias KEY_ALIAS
keyPassword KEY_PASSWORD
2019-11-23 20:27:39 +08:00
}
}
}
buildTypes {
release {
debuggable false
jniDebuggable false
renderscriptDebuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (project.hasProperty("KEY_STORE_FILE")) {
signingConfig signingConfigs.release
2019-11-23 20:27:39 +08:00
}
}
debug {
debuggable true
jniDebuggable true
renderscriptDebuggable true
}
}
aaptOptions {
Release 2.1.5 (#2076) * Fix unexpected libpng used * Fix string format incorrect for tests * Fix #1751, use coroutine control AutoTest flow * Update CHANGELOG.md * Added OpenType font (.otf) to the noCompress list. (#2077) * Update 1k & copyright notice in some sources * Move doctest to axmol 3rdparty * Fix ci * Update 1kdist to v90 * Update 1kiss.ps1 * DrawNodeV2 0.95.1 (#2079) * Rename remaining legacy engine related spells and improve code style * Update 3rdparty README.md * Fix checkReallySupportsASTC does not work on ios device reported by @BIGCATDOG in https://github.com/axmolengine/axmol/issues/2078 * Fix ci * FastRNG: add missing include for AXASSERT (#2081) * Delete unused files * Improve FileUtils - Rename FileUtils::createDirectory to FileUtils::createDirectories - Use splitpath_cb to optimize FileUtils::createDirectories - Rename FileUtils::getFileShortName to FileUtils::getPathBaseName - Rename FileUtils::getFileExtension to FileUtils::getPathExtension - Add FileUtils::getPathDirName - Add FileUtils::getPathBaseNameNoExtension - Mark all renamed FileUtils stubs old name deprecated - Mark all FileUtils offthread APIs deprecated * Update box2d to v2.4.2 * Disable /sdl checks explicitly for winuwp For axmol deprecated policy, we need disable /sdl checks explicitly to avoid compiler traits invoking deprecated functions as error * Update cppwinrt to 2.0.240405.15 * Update simdjson to 3.10.0 * Fix box2d testbed compile error * Improve file path to url * Fix FileUtils::createDirectories unix logic * axmol-cmdline: remove arch suffix for host build output directory * Update CHANGELOG.md * Update lua bindings --------- Co-authored-by: Dani Alias <danielgutierrezalias@gmail.com> Co-authored-by: aismann <icesoft@freenet.de> Co-authored-by: smilediver <smilediver@outlook.com>
2024-08-11 21:11:35 +08:00
noCompress 'mp3','ogg','wav','mp4','ttf','ttc','otf'
}
buildFeatures {
aidl true
}
2019-11-23 20:27:39 +08:00
}
android.applicationVariants.configureEach { variant ->
def variantName = variant.name.capitalize()
tasks.register("copy${variantName}ContentToAssets") {
doFirst {
delete "${projectDir}/build/assets"
}
doLast {
copy {
from "${projectDir}/../../Content"
into "${projectDir}/build/assets"
exclude "**/*.gz"
}
copy {
from "${projectDir}/build/runtime/axslc"
into "${projectDir}/build/assets/axslc"
}
}
2019-11-23 20:27:39 +08:00
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
2022-10-01 16:24:52 +08:00
implementation project(':libaxmol')
2019-11-23 20:27:39 +08:00
}
project.afterEvaluate {
android.applicationVariants.configureEach { variant ->
def variantName = variant.name.capitalize()
def externalNativeBuild = tasks.named("externalNativeBuild${variantName}")
if (externalNativeBuild) {
def copyContentToAssets = tasks.named("copy${variantName}ContentToAssets")
copyContentToAssets
copyContentToAssets.get().dependsOn externalNativeBuild
tasks.named("compile${variantName}JavaWithJavac").get().dependsOn copyContentToAssets
}
}
}