選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

build.gradle 5.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. 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. dependencies {
  63. implementation fileTree(dir: 'libs', include: ['*.jar'])
  64. implementation 'androidx.appcompat:appcompat:1.2.0'
  65. debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-5'
  66. if (!rootProject.ext.libreBuild) {
  67. implementation 'com.google.android.gms:play-services-auth:16.0.1'
  68. // Firebase
  69. // - Crashlytics
  70. // - Dynamic Links
  71. implementation 'com.google.firebase:firebase-crashlytics:17.2.1'
  72. implementation 'com.google.firebase:firebase-dynamic-links:19.1.0'
  73. }
  74. implementation project(':sdk')
  75. }
  76. gradle.projectsEvaluated {
  77. // Dropbox integration
  78. //
  79. def dropboxAppKey
  80. if (project.file('dropbox.key').exists()) {
  81. dropboxAppKey = project.file('dropbox.key').text.trim() - 'db-'
  82. }
  83. if (dropboxAppKey) {
  84. android.defaultConfig.resValue('string', 'dropbox_app_key', "${dropboxAppKey}")
  85. def dropboxActivity = """
  86. <activity
  87. android:configChanges="keyboard|orientation"
  88. android:launchMode="singleTask"
  89. android:name="com.dropbox.core.android.AuthActivity">
  90. <intent-filter>
  91. <action android:name="android.intent.action.VIEW" />
  92. <category android:name="android.intent.category.BROWSABLE" />
  93. <category android:name="android.intent.category.DEFAULT" />
  94. <data android:scheme="db-${dropboxAppKey}" />
  95. </intent-filter>
  96. </activity>"""
  97. android.applicationVariants.all { variant ->
  98. variant.outputs.each { output ->
  99. output.getProcessManifestProvider().get().doLast {
  100. def outputDir = manifestOutputDirectory.get().asFile
  101. def manifestPath = new File(outputDir, 'AndroidManifest.xml')
  102. def charset = 'UTF-8'
  103. def text
  104. text = manifestPath.getText(charset)
  105. text = text.replace('</application>', "${dropboxActivity}</application>")
  106. manifestPath.write(text, charset)
  107. }
  108. }
  109. }
  110. }
  111. // Run React packager
  112. android.applicationVariants.all { variant ->
  113. def targetName = variant.name.capitalize()
  114. def currentRunPackagerTask = tasks.create(
  115. name: "run${targetName}ReactPackager",
  116. type: Exec) {
  117. group = "react"
  118. description = "Run the React packager."
  119. doFirst {
  120. println "Starting the React packager..."
  121. def androidRoot = file("${projectDir}/../")
  122. // Set up the call to the script
  123. workingDir androidRoot
  124. // Run the packager
  125. commandLine("scripts/run-packager.sh")
  126. }
  127. // Set up dev mode
  128. def devEnabled = !targetName.toLowerCase().contains("release")
  129. // Only enable for dev builds
  130. enabled devEnabled
  131. }
  132. def packageTask = variant.packageApplicationProvider.get()
  133. packageTask.dependsOn(currentRunPackagerTask)
  134. }
  135. }
  136. if (googleServicesEnabled) {
  137. apply plugin: 'com.google.gms.google-services'
  138. }