build.gradle.in 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. //
  2. // Copyright (c) Contributors to the Open 3D Engine Project.
  3. // For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. //
  5. // SPDX-License-Identifier: Apache-2.0 OR MIT
  6. //
  7. apply plugin: "com.android.${TARGET_TYPE}"
  8. android {
  9. ${PROJECT_NAMESPACE_OPTION}
  10. ${SIGNING_CONFIGS}
  11. compileSdkVersion sdkVer
  12. buildToolsVersion buildToolsVer
  13. ndkVersion ndkPlatformVer
  14. lintOptions {
  15. abortOnError false
  16. checkReleaseBuilds false
  17. }
  18. defaultConfig {
  19. minSdkVersion minSdkVer
  20. targetSdkVersion sdkVer
  21. ${NATIVE_CMAKE_SECTION_DEFAULT_CONFIG}
  22. }
  23. buildTypes {
  24. debug {
  25. debuggable true
  26. ${NATIVE_CMAKE_SECTION_DEBUG_CONFIG}
  27. ${SIGNING_DEBUG_CONFIG}
  28. }
  29. profile {
  30. getIsDefault().set(true)
  31. debuggable true
  32. ${NATIVE_CMAKE_SECTION_PROFILE_CONFIG}
  33. ${SIGNING_PROFILE_CONFIG}
  34. }
  35. release {
  36. debuggable false
  37. minifyEnabled false
  38. ${NATIVE_CMAKE_SECTION_RELEASE_CONFIG}
  39. ${SIGNING_RELEASE_CONFIG}
  40. }
  41. }
  42. compileOptions {
  43. targetCompatibility JavaVersion.VERSION_1_8
  44. sourceCompatibility JavaVersion.VERSION_1_8
  45. }
  46. ${NATIVE_CMAKE_SECTION_ANDROID}
  47. sourceSets {
  48. main {
  49. ${OVERRIDE_JAVA_SOURCESET}
  50. jniLibs {
  51. srcDirs = ["src/main/jniLibs"${OPTIONAL_JNI_SRC_LIB_SET}]
  52. }
  53. }
  54. }
  55. packagingOptions {
  56. pickFirst '**/*.so'
  57. }
  58. // APKs will attempt to compress file types it doesn't recognized as already compressed (ie jpeg, mp3, etc)
  59. // However, when it compresses an O3DE PAK file, whether the PAK was created with compression or not,
  60. // there is a bug causing the app to softlock when attempting to open the PAK.
  61. // See https://github.com/o3de/o3de/issues/17625
  62. aaptOptions {
  63. noCompress 'pak'
  64. }
  65. }
  66. // Inject the zip64 option into package task to allow 4GiB apks
  67. tasks.withType(Zip) {
  68. if (name == "packageDebug" || name == "packageProfile" || name == "packageRelease") {
  69. zip64 = true
  70. }
  71. }
  72. ${PROJECT_DEPENDENCIES}
  73. afterEvaluate {
  74. ${CUSTOM_APPLY_ASSET_LAYOUT_DEBUG_TASK}
  75. ${CUSTOM_APPLY_ASSET_LAYOUT_PROFILE_TASK}
  76. ${CUSTOM_APPLY_ASSET_LAYOUT_RELEASE_TASK}
  77. ${CUSTOM_GRADLE_COPY_NATIVE_DEBUG_LIB_TASK}
  78. ${CUSTOM_GRADLE_COPY_NATIVE_PROFILE_LIB_TASK}
  79. ${CUSTOM_GRADLE_COPY_NATIVE_RELEASE_LIB_TASK}
  80. }