您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

build.gradle 5.5KB

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