Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build.gradle 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. apply plugin: 'com.android.application'
  2. import com.android.build.OutputFile
  3. /**
  4. * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
  5. * and bundleReleaseJsAndAssets).
  6. * These basically call `react-native bundle` with the correct arguments during the Android build
  7. * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
  8. * bundle directly from the development server. Below you can see all the possible configurations
  9. * and their defaults. If you decide to add a configuration block, make sure to add it before the
  10. * `apply from: "../../node_modules/react-native/react.gradle"` line.
  11. *
  12. * project.ext.react = [
  13. * // the name of the generated asset file containing your JS bundle
  14. * bundleAssetName: "index.android.bundle",
  15. *
  16. * // the entry file for bundle generation
  17. * entryFile: "index.android.js",
  18. *
  19. * // whether to bundle JS and assets in debug mode
  20. * bundleInDebug: false,
  21. *
  22. * // whether to bundle JS and assets in release mode
  23. * bundleInRelease: true,
  24. *
  25. * // whether to bundle JS and assets in another build variant (if configured).
  26. * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
  27. * // The configuration property can be in the following formats
  28. * // 'bundleIn${productFlavor}${buildType}'
  29. * // 'bundleIn${buildType}'
  30. * // bundleInFreeDebug: true,
  31. * // bundleInPaidRelease: true,
  32. * // bundleInBeta: true,
  33. *
  34. * // the root of your project, i.e. where "package.json" lives
  35. * root: "../../",
  36. *
  37. * // where to put the JS bundle asset in debug mode
  38. * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
  39. *
  40. * // where to put the JS bundle asset in release mode
  41. * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
  42. *
  43. * // where to put drawable resources / React Native assets, e.g. the ones you use via
  44. * // require('./image.png')), in debug mode
  45. * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
  46. *
  47. * // where to put drawable resources / React Native assets, e.g. the ones you use via
  48. * // require('./image.png')), in release mode
  49. * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
  50. *
  51. * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
  52. * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
  53. * // date; if you have any other folders that you want to ignore for performance reasons (gradle
  54. * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
  55. * // for example, you might want to remove it from here.
  56. * inputExcludes: ["android/**", "ios/**"],
  57. *
  58. * // override which node gets called and with what additional arguments
  59. * nodeExecutableAndArgs: ["node"]
  60. *
  61. * // supply additional arguments to the packager
  62. * extraPackagerArgs: []
  63. * ]
  64. */
  65. apply from: '../../node_modules/react-native/react.gradle'
  66. /**
  67. * Set this to true to create two separate APKs instead of one:
  68. * - An APK that only works on ARM devices
  69. * - An APK that only works on x86 devices
  70. * The advantage is the size of the APK is reduced by about 4MB.
  71. * Upload all the APKs to the Play Store and people will download
  72. * the correct one based on the CPU architecture of their device.
  73. */
  74. def enableSeparateBuildPerCPUArchitecture = false
  75. /**
  76. * Run Proguard to shrink the Java bytecode in release builds.
  77. */
  78. def enableProguardInReleaseBuilds = false
  79. android {
  80. compileSdkVersion 23
  81. buildToolsVersion '23.0.1'
  82. defaultConfig {
  83. applicationId 'org.jitsi.meet'
  84. minSdkVersion 16
  85. targetSdkVersion 22
  86. versionCode Integer.parseInt("${version}")
  87. versionName "1.2.${version}"
  88. ndk {
  89. abiFilters 'armeabi-v7a', 'x86'
  90. }
  91. packagingOptions {
  92. // The project react-native does not provide 64-bit binaries at the
  93. // time of this writing. Unfortunately, packaging any 64-bit
  94. // binaries into the .apk will crash the app at runtime on 64-bit
  95. // platforms.
  96. exclude 'lib/x86_64/libjingle_peerconnection_so.so'
  97. exclude 'lib/arm64-v8a/libjingle_peerconnection_so.so'
  98. }
  99. }
  100. splits {
  101. abi {
  102. reset()
  103. enable enableSeparateBuildPerCPUArchitecture
  104. universalApk false // If true, also generate a universal APK
  105. include 'armeabi-v7a', 'x86'
  106. }
  107. }
  108. buildTypes {
  109. release {
  110. minifyEnabled enableProguardInReleaseBuilds
  111. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  112. }
  113. }
  114. // applicationVariants are e.g. debug, release
  115. applicationVariants.all { variant ->
  116. variant.outputs.each { output ->
  117. // For each separate APK per architecture, set a unique version code as described here:
  118. // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
  119. def versionCodes = ['armeabi-v7a':1, 'x86':2]
  120. def abi = output.getFilter(OutputFile.ABI)
  121. if (abi != null) { // null for the universal-debug, universal-release variants
  122. output.versionCodeOverride =
  123. versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
  124. }
  125. }
  126. }
  127. }
  128. if (project.hasProperty('JITSI_SIGNING')
  129. && new File(project.property('JITSI_SIGNING')).exists()) {
  130. apply from: project.property('JITSI_SIGNING');
  131. }
  132. dependencies {
  133. compile project(':react-native-keep-awake')
  134. compile project(':react-native-vector-icons')
  135. compile project(':react-native-webrtc')
  136. compile fileTree(dir: 'libs', include: ['*.jar'])
  137. compile 'com.android.support:appcompat-v7:23.0.1'
  138. compile 'com.facebook.react:react-native:+' // From node_modules
  139. }
  140. apply from: '../../node_modules/react-native-vector-icons/fonts.gradle'
  141. // Run this once to be able to run the application with BUCK
  142. // puts all compile dependencies into folder libs for BUCK to use
  143. task copyDownloadableDepsToLibs(type: Copy) {
  144. from configurations.compile
  145. into 'libs'
  146. }