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

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