axmol/tests/cpp-tests/proj.android/app/build.gradle

115 lines
3.1 KiB
Groovy
Raw Normal View History

2015-05-15 16:37:43 +08:00
apply plugin: 'com.android.application'
2022-10-01 16:24:52 +08:00
apply from: project(':libaxmol').projectDir.toString() + "/axutils.gradle"
2015-05-15 16:37:43 +08:00
android {
2017-06-05 11:35:48 +08:00
compileSdkVersion PROP_COMPILE_SDK_VERSION.toInteger()
2015-05-15 16:37:43 +08:00
// Setup native build tools: ndk & cmake
2022-08-08 18:02:17 +08:00
def nbtInfo = axutils.findNativeBuildTools(project)
ndkVersion = nbtInfo[0]
if(nbtInfo[1]) {
ndkPath = nbtInfo[1]
2021-05-15 00:12:41 +08:00
}
def cmakeVer = nbtInfo[2]
2022-01-28 18:25:50 +08:00
2015-05-15 16:37:43 +08:00
defaultConfig {
2022-10-01 16:24:52 +08:00
applicationId "org.axmol.cpp_tests"
2017-06-05 11:35:48 +08:00
minSdkVersion PROP_MIN_SDK_VERSION
targetSdkVersion PROP_TARGET_SDK_VERSION
2015-05-15 16:37:43 +08:00
versionCode 1
versionName "1.0"
externalNativeBuild {
cmake {
targets 'cpp_tests'
arguments "-DCMAKE_FIND_ROOT_PATH=", "-DANDROID_STL=c++_shared", "-DANDROID_TOOLCHAIN=clang", "-DANDROID_ARM_NEON=TRUE"
cppFlags "-frtti -fexceptions -fsigned-char"
V3 android cmake support, add mac/ios support (#18646) * CMake build improvements * android cmake support * Enable proguard for cocos2d * examples & test cmake support * add android build type param to gradle.properties file * less warnings * update all android configs to recomended settings * fix network cmake error * fix js-tests cmake error * android build config, add cmake * android build config, add cmake * add lua share lib * android lua cmake build fix * fix * luajit test * run fail, still * fix js-warning * correct lua main include * lua test project cmake support android * try to add lua-template cmake support * lua template fix * js_tests support cmake on android * js-tests improve * cmake support js-template * test to realise prebuild * cmake improve, no feature * improve templates cmake * refactor cmake struct * correct cpp-tests cmake * cpp-templates cmake improve * typo fix * cmake struct refator * change default option * adapt new project struct * uniform cmake test style * add_dependencies to support make -j * little struct improve * little fix * adapt cmake bin dir * little improve about cmake version * change build all tests condition * add source_group for Xcode * add mark source files * add more mark source code * add template project to test * add macos info.plist template * add pak macos for all project * lua test icon fix * not consider lua project for now * modify pak method * add another ios toolchain * add ios system library * update ios toolchain, and reduce ios compile errors * reduce error * make ios engine lib compile pass * cpp-empty-test ios bundle * cpp-tests ios support * js-tests ios support * templates project support ios * fix the way of lua-tests package * try to fix lua-template on macOS * comment lua-template sim file * improve display on xcode * update cmake readme * check android compile again * fix android compile error * fix linux cmake res error * update deps version, for cmake * fix lua_template linux compile error * close android cmake support for now * review template android share library name * change PROP_BUILD_TOOLS_VERSION version to 27.0.1 * change android compile version * make `PROP_APP_PLATFORM` back, add comments for android native build * Revert "make `PROP_APP_PLATFORM` back, add comments for android native build" This reverts commit 272ddc19886891b9502cde070753a870c0fdb588.
2018-02-08 09:24:33 +08:00
}
}
ndk {
abiFilters = []
abiFilters.addAll(PROP_APP_ABI.split(':').collect{it as String})
}
2015-05-15 16:37:43 +08:00
}
sourceSets.main {
java.srcDir "src"
res.srcDir "res"
manifest.srcFile "AndroidManifest.xml"
2019-07-24 09:53:02 +08:00
assets.srcDir "assets"
}
externalNativeBuild {
cmake {
2022-01-28 18:25:50 +08:00
version "$cmakeVer"
path "../../CMakeLists.txt"
V3 android cmake support, add mac/ios support (#18646) * CMake build improvements * android cmake support * Enable proguard for cocos2d * examples & test cmake support * add android build type param to gradle.properties file * less warnings * update all android configs to recomended settings * fix network cmake error * fix js-tests cmake error * android build config, add cmake * android build config, add cmake * add lua share lib * android lua cmake build fix * fix * luajit test * run fail, still * fix js-warning * correct lua main include * lua test project cmake support android * try to add lua-template cmake support * lua template fix * js_tests support cmake on android * js-tests improve * cmake support js-template * test to realise prebuild * cmake improve, no feature * improve templates cmake * refactor cmake struct * correct cpp-tests cmake * cpp-templates cmake improve * typo fix * cmake struct refator * change default option * adapt new project struct * uniform cmake test style * add_dependencies to support make -j * little struct improve * little fix * adapt cmake bin dir * little improve about cmake version * change build all tests condition * add source_group for Xcode * add mark source files * add more mark source code * add template project to test * add macos info.plist template * add pak macos for all project * lua test icon fix * not consider lua project for now * modify pak method * add another ios toolchain * add ios system library * update ios toolchain, and reduce ios compile errors * reduce error * make ios engine lib compile pass * cpp-empty-test ios bundle * cpp-tests ios support * js-tests ios support * templates project support ios * fix the way of lua-tests package * try to fix lua-template on macOS * comment lua-template sim file * improve display on xcode * update cmake readme * check android compile again * fix android compile error * fix linux cmake res error * update deps version, for cmake * fix lua_template linux compile error * close android cmake support for now * review template android share library name * change PROP_BUILD_TOOLS_VERSION version to 27.0.1 * change android compile version * make `PROP_APP_PLATFORM` back, add comments for android native build * Revert "make `PROP_APP_PLATFORM` back, add comments for android native build" This reverts commit 272ddc19886891b9502cde070753a870c0fdb588.
2018-02-08 09:24:33 +08:00
}
2015-05-15 16:37:43 +08:00
}
signingConfigs {
V3 android cmake support, add mac/ios support (#18646) * CMake build improvements * android cmake support * Enable proguard for cocos2d * examples & test cmake support * add android build type param to gradle.properties file * less warnings * update all android configs to recomended settings * fix network cmake error * fix js-tests cmake error * android build config, add cmake * android build config, add cmake * add lua share lib * android lua cmake build fix * fix * luajit test * run fail, still * fix js-warning * correct lua main include * lua test project cmake support android * try to add lua-template cmake support * lua template fix * js_tests support cmake on android * js-tests improve * cmake support js-template * test to realise prebuild * cmake improve, no feature * improve templates cmake * refactor cmake struct * correct cpp-tests cmake * cpp-templates cmake improve * typo fix * cmake struct refator * change default option * adapt new project struct * uniform cmake test style * add_dependencies to support make -j * little struct improve * little fix * adapt cmake bin dir * little improve about cmake version * change build all tests condition * add source_group for Xcode * add mark source files * add more mark source code * add template project to test * add macos info.plist template * add pak macos for all project * lua test icon fix * not consider lua project for now * modify pak method * add another ios toolchain * add ios system library * update ios toolchain, and reduce ios compile errors * reduce error * make ios engine lib compile pass * cpp-empty-test ios bundle * cpp-tests ios support * js-tests ios support * templates project support ios * fix the way of lua-tests package * try to fix lua-template on macOS * comment lua-template sim file * improve display on xcode * update cmake readme * check android compile again * fix android compile error * fix linux cmake res error * update deps version, for cmake * fix lua_template linux compile error * close android cmake support for now * review template android share library name * change PROP_BUILD_TOOLS_VERSION version to 27.0.1 * change android compile version * make `PROP_APP_PLATFORM` back, add comments for android native build * Revert "make `PROP_APP_PLATFORM` back, add comments for android native build" This reverts commit 272ddc19886891b9502cde070753a870c0fdb588.
2018-02-08 09:24:33 +08:00
release {
if (project.hasProperty("RELEASE_STORE_FILE")) {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
}
2015-05-15 16:37:43 +08:00
buildTypes {
release {
debuggable false
jniDebuggable false
renderscriptDebuggable false
minifyEnabled true
shrinkResources true
2015-05-15 16:37:43 +08:00
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfig signingConfigs.release
}
}
debug {
debuggable true
jniDebuggable true
renderscriptDebuggable true
}
}
aaptOptions {
noCompress 'mp3','ogg','wav','mp4','ttf','ttc'
}
}
android.applicationVariants.all { variant ->
2019-07-24 09:53:02 +08:00
delete "${projectDir}/assets"
def targetName = variant.name.capitalize()
def copyTaskName = "copy${targetName}ResourcesToAssets"
tasks.register(copyTaskName) {
copy {
2019-07-24 09:53:02 +08:00
from "${projectDir}/../../Resources"
into "${projectDir}/assets"
exclude "**/*.gz"
2015-05-15 16:37:43 +08:00
}
}
2019-07-24 09:53:02 +08:00
tasks.getByName("pre${targetName}Build").dependsOn copyTaskName
2015-05-15 16:37:43 +08:00
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
2022-10-01 16:24:52 +08:00
implementation project(':libaxmol')
2015-05-15 16:37:43 +08:00
}
project.afterEvaluate {
if (tasks.findByName("externalNativeBuildDebug")) {
compileDebugJavaWithJavac.dependsOn externalNativeBuildDebug
}
if (tasks.findByName("externalNativeBuildRelease")) {
compileReleaseJavaWithJavac.dependsOn externalNativeBuildRelease
}
}