You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.gradle 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. apply plugin: 'com.android.application'
  2. // Crashlytics integration is done as part of Firebase now, so it gets
  3. // automagically activated with google-services.json
  4. if (googleServicesEnabled) {
  5. apply plugin: 'io.fabric'
  6. }
  7. // Use the number of seconds/10 since Jan 1 2019 as the versionCode.
  8. // This lets us upload a new build at most every 10 seconds for the
  9. // next ~680 years.
  10. // https://stackoverflow.com/a/38643838
  11. def vcode = (int) (((new Date().getTime() / 1000) - 1546297200) / 10)
  12. android {
  13. compileSdkVersion rootProject.ext.compileSdkVersion
  14. buildToolsVersion rootProject.ext.buildToolsVersion
  15. defaultConfig {
  16. applicationId 'org.jitsi.meet'
  17. versionCode vcode
  18. versionName project.appVersion
  19. minSdkVersion rootProject.ext.minSdkVersion
  20. targetSdkVersion rootProject.ext.targetSdkVersion
  21. ndk {
  22. abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
  23. }
  24. }
  25. signingConfigs {
  26. debug {
  27. storeFile file('debug.keystore')
  28. storePassword 'android'
  29. keyAlias 'androiddebugkey'
  30. keyPassword 'android'
  31. }
  32. }
  33. buildTypes {
  34. debug {
  35. buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
  36. buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
  37. }
  38. release {
  39. // Uncomment the following line for singing a test release build.
  40. //signingConfig signingConfigs.debug
  41. minifyEnabled true
  42. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
  43. buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
  44. buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
  45. }
  46. }
  47. sourceSets {
  48. main {
  49. java {
  50. if (rootProject.ext.libreBuild) {
  51. srcDir "src"
  52. exclude "**/GoogleServicesHelper.java"
  53. }
  54. }
  55. }
  56. }
  57. compileOptions {
  58. sourceCompatibility JavaVersion.VERSION_1_8
  59. targetCompatibility JavaVersion.VERSION_1_8
  60. }
  61. }
  62. repositories {
  63. maven { url 'https://maven.fabric.io/public' }
  64. }
  65. dependencies {
  66. implementation fileTree(dir: 'libs', include: ['*.jar'])
  67. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  68. implementation 'androidx.appcompat:appcompat:1.1.0'
  69. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-5'
  70. if (!rootProject.ext.libreBuild) {
  71. implementation 'com.google.android.gms:play-services-auth:16.0.1'
  72. // Firebase
  73. // - Crashlytics
  74. // - Dynamic Links
  75. implementation 'com.google.firebase:firebase-core:16.0.6'
  76. implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
  77. implementation 'com.google.firebase:firebase-dynamic-links:16.1.5'
  78. }
  79. implementation project(':sdk')
  80. }
  81. gradle.projectsEvaluated {
  82. // Dropbox integration
  83. //
  84. def dropboxAppKey
  85. if (project.file('dropbox.key').exists()) {
  86. dropboxAppKey = project.file('dropbox.key').text.trim() - 'db-'
  87. }
  88. if (dropboxAppKey) {
  89. android.defaultConfig.resValue('string', 'dropbox_app_key', "${dropboxAppKey}")
  90. def dropboxActivity = """
  91. <activity
  92. android:configChanges="keyboard|orientation"
  93. android:launchMode="singleTask"
  94. android:name="com.dropbox.core.android.AuthActivity">
  95. <intent-filter>
  96. <action android:name="android.intent.action.VIEW" />
  97. <category android:name="android.intent.category.BROWSABLE" />
  98. <category android:name="android.intent.category.DEFAULT" />
  99. <data android:scheme="db-${dropboxAppKey}" />
  100. </intent-filter>
  101. </activity>"""
  102. android.applicationVariants.all { variant ->
  103. variant.outputs.each { output ->
  104. output.getProcessManifestProvider().get().doLast {
  105. def outputDir = manifestOutputDirectory.get().asFile
  106. def manifestPath = new File(outputDir, 'AndroidManifest.xml')
  107. def charset = 'UTF-8'
  108. def text
  109. text = manifestPath.getText(charset)
  110. text = text.replace('</application>', "${dropboxActivity}</application>")
  111. manifestPath.write(text, charset)
  112. }
  113. }
  114. }
  115. }
  116. // Run React packager
  117. android.applicationVariants.all { variant ->
  118. def targetName = variant.name.capitalize()
  119. def currentRunPackagerTask = tasks.create(
  120. name: "run${targetName}ReactPackager",
  121. type: Exec) {
  122. group = "react"
  123. description = "Run the React packager."
  124. doFirst {
  125. println "Starting the React packager..."
  126. def androidRoot = file("${projectDir}/../")
  127. // Set up the call to the script
  128. workingDir androidRoot
  129. // Run the packager
  130. commandLine("scripts/run-packager.sh")
  131. }
  132. // Set up dev mode
  133. def devEnabled = !targetName.toLowerCase().contains("release")
  134. // Only enable for dev builds
  135. enabled devEnabled
  136. }
  137. def packageTask = variant.packageApplicationProvider.get()
  138. packageTask.dependsOn(currentRunPackagerTask)
  139. }
  140. }
  141. if (googleServicesEnabled) {
  142. apply plugin: 'com.google.gms.google-services'
  143. }