Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 

247 linhas
9.6 KiB

  1. apply plugin: "com.android.application"
  2. apply plugin: 'com.google.gms.google-services'
  3. import com.android.build.OutputFile
  4. /**
  5. * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  6. * and bundleReleaseJsAndAssets).
  7. * These basically call `react-native bundle` with the correct arguments during the Android build
  8. * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
  9. * bundle directly from the development server. Below you can see all the possible configurations
  10. * and their defaults. If you decide to add a configuration block, make sure to add it before the
  11. * `apply from: "../../node_modules/react-native/react.gradle"` line.
  12. *
  13. * project.ext.react = [
  14. * // the name of the generated asset file containing your JS bundle
  15. * bundleAssetName: "index.android.bundle",
  16. *
  17. * // the entry file for bundle generation. If none specified and
  18. * // "index.android.js" exists, it will be used. Otherwise "index.js" is
  19. * // default. Can be overridden with ENTRY_FILE environment variable.
  20. * entryFile: "index.android.js",
  21. *
  22. * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
  23. * bundleCommand: "ram-bundle",
  24. *
  25. * // whether to bundle JS and assets in debug mode
  26. * bundleInDebug: false,
  27. *
  28. * // whether to bundle JS and assets in release mode
  29. * bundleInRelease: true,
  30. *
  31. * // whether to bundle JS and assets in another build variant (if configured).
  32. * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
  33. * // The configuration property can be in the following formats
  34. * // 'bundleIn${productFlavor}${buildType}'
  35. * // 'bundleIn${buildType}'
  36. * // bundleInFreeDebug: true,
  37. * // bundleInPaidRelease: true,
  38. * // bundleInBeta: true,
  39. *
  40. * // whether to disable dev mode in custom build variants (by default only disabled in release)
  41. * // for example: to disable dev mode in the staging build type (if configured)
  42. * devDisabledInStaging: true,
  43. * // The configuration property can be in the following formats
  44. * // 'devDisabledIn${productFlavor}${buildType}'
  45. * // 'devDisabledIn${buildType}'
  46. *
  47. * // the root of your project, i.e. where "package.json" lives
  48. * root: "../../",
  49. *
  50. * // where to put the JS bundle asset in debug mode
  51. * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
  52. *
  53. * // where to put the JS bundle asset in release mode
  54. * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
  55. *
  56. * // where to put drawable resources / React Native assets, e.g. the ones you use via
  57. * // require('./image.png')), in debug mode
  58. * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
  59. *
  60. * // where to put drawable resources / React Native assets, e.g. the ones you use via
  61. * // require('./image.png')), in release mode
  62. * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
  63. *
  64. * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
  65. * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
  66. * // date; if you have any other folders that you want to ignore for performance reasons (gradle
  67. * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
  68. * // for example, you might want to remove it from here.
  69. * inputExcludes: ["android/**", "ios/**"],
  70. *
  71. * // override which node gets called and with what additional arguments
  72. * nodeExecutableAndArgs: ["node"],
  73. *
  74. * // supply additional arguments to the packager
  75. * extraPackagerArgs: []
  76. * ]
  77. */
  78. project.ext.react = [
  79. enableHermes: false, // clean and rebuild if changing
  80. ]
  81. apply from: "../../node_modules/react-native/react.gradle"
  82. /**
  83. * Set this to true to create two separate APKs instead of one:
  84. * - An APK that only works on ARM devices
  85. * - An APK that only works on x86 devices
  86. * The advantage is the size of the APK is reduced by about 4MB.
  87. * Upload all the APKs to the Play Store and people will download
  88. * the correct one based on the CPU architecture of their device.
  89. */
  90. def enableSeparateBuildPerCPUArchitecture = false
  91. /**
  92. * Run Proguard to shrink the Java bytecode in release builds.
  93. */
  94. def enableProguardInReleaseBuilds = false
  95. /**
  96. * The preferred build flavor of JavaScriptCore.
  97. *
  98. * For example, to use the international variant, you can use:
  99. * `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
  100. *
  101. * The international variant includes ICU i18n library and necessary data
  102. * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
  103. * give correct results when using with locales other than en-US. Note that
  104. * this variant is about 6MiB larger per architecture than default.
  105. */
  106. def jscFlavor = 'org.webkit:android-jsc:+'
  107. /**
  108. * Whether to enable the Hermes VM.
  109. *
  110. * This should be set on project.ext.react and mirrored here. If it is not set
  111. * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
  112. * and the benefits of using Hermes will therefore be sharply reduced.
  113. */
  114. def enableHermes = project.ext.react.get("enableHermes", false);
  115. android {
  116. compileSdkVersion rootProject.ext.compileSdkVersion
  117. compileOptions {
  118. sourceCompatibility JavaVersion.VERSION_1_8
  119. targetCompatibility JavaVersion.VERSION_1_8
  120. }
  121. defaultConfig {
  122. multiDexEnabled true
  123. applicationId "com.desihealth.customer"
  124. minSdkVersion rootProject.ext.minSdkVersion
  125. targetSdkVersion rootProject.ext.targetSdkVersion
  126. versionCode 1
  127. versionName "1.0"
  128. }
  129. splits {
  130. abi {
  131. reset()
  132. enable enableSeparateBuildPerCPUArchitecture
  133. universalApk false // If true, also generate a universal APK
  134. include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
  135. }
  136. }
  137. signingConfigs {
  138. debug {
  139. storeFile file('debug.keystore')
  140. storePassword 'android'
  141. keyAlias 'androiddebugkey'
  142. keyPassword 'android'
  143. }
  144. release {
  145. if (project.hasProperty('MYAPP_UPLOAD_STORE_FILE')) {
  146. storeFile file(MYAPP_UPLOAD_STORE_FILE)
  147. storePassword MYAPP_UPLOAD_STORE_PASSWORD
  148. keyAlias MYAPP_UPLOAD_KEY_ALIAS
  149. keyPassword MYAPP_UPLOAD_KEY_PASSWORD
  150. }
  151. }
  152. }
  153. buildTypes {
  154. debug {
  155. signingConfig signingConfigs.debug
  156. }
  157. release {
  158. // Caution! In production, you need to generate your own keystore file.
  159. // see https://facebook.github.io/react-native/docs/signed-apk-android.
  160. signingConfig signingConfigs.release
  161. minifyEnabled enableProguardInReleaseBuilds
  162. proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
  163. }
  164. }
  165. packagingOptions {
  166. pickFirst "lib/armeabi-v7a/libc++_shared.so"
  167. pickFirst "lib/arm64-v8a/libc++_shared.so"
  168. pickFirst "lib/x86/libc++_shared.so"
  169. pickFirst "lib/x86_64/libc++_shared.so"
  170. }
  171. // applicationVariants are e.g. debug, release
  172. applicationVariants.all { variant ->
  173. variant.outputs.each { output ->
  174. // For each separate APK per architecture, set a unique version code as described here:
  175. // https://developer.android.com/studio/build/configure-apk-splits.html
  176. def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
  177. def abi = output.getFilter(OutputFile.ABI)
  178. if (abi != null) { // null for the universal-debug, universal-release variants
  179. output.versionCodeOverride =
  180. versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
  181. }
  182. }
  183. }
  184. }
  185. dependencies {
  186. implementation fileTree(dir: "libs", include: ["*.jar"])
  187. //noinspection GradleDynamicVersion
  188. implementation "com.facebook.react:react-native:+" // From node_modules
  189. implementation 'com.google.firebase:firebase-analytics:17.2.2'
  190. implementation 'com.android.support:design:27.1.0'
  191. implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
  192. implementation project(':react-native-twilio-video-webrtc')
  193. implementation(project(':react-native-maps')){
  194. exclude group: 'com.google.android.gms', module: 'play-services-base'
  195. exclude group: 'com.google.android.gms', module: 'play-services-maps'
  196. }
  197. implementation 'com.google.android.gms:play-services-base:17.2.1'
  198. implementation 'com.google.android.gms:play-services-maps:17.0.0'
  199. debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
  200. exclude group:'com.facebook.fbjni'
  201. }
  202. debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
  203. exclude group:'com.facebook.flipper'
  204. }
  205. debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
  206. exclude group:'com.facebook.flipper'
  207. }
  208. if (enableHermes) {
  209. def hermesPath = "../../node_modules/hermes-engine/android/";
  210. debugImplementation files(hermesPath + "hermes-debug.aar")
  211. releaseImplementation files(hermesPath + "hermes-release.aar")
  212. } else {
  213. implementation jscFlavor
  214. }
  215. }
  216. // Run this once to be able to run the application with BUCK
  217. // puts all compile dependencies into folder libs for BUCK to use
  218. task copyDownloadableDepsToLibs(type: Copy) {
  219. from configurations.compile
  220. into 'libs'
  221. }
  222. apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)