Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

build.gradle 6.0KB

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