Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

build.gradle 6.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. // Top-level build file where you can add configuration options common to all
  2. // sub-projects/modules.
  3. buildscript {
  4. repositories {
  5. jcenter()
  6. maven { url 'https://maven.google.com' }
  7. }
  8. dependencies {
  9. classpath 'com.android.tools.build:gradle:3.0.0-beta4'
  10. // NOTE: Do not place your application dependencies here; they belong
  11. // in the individual module build.gradle files.
  12. }
  13. }
  14. allprojects {
  15. repositories {
  16. mavenLocal()
  17. jcenter()
  18. maven { url "https://maven.google.com" } // Required for appcompat.
  19. // React Native (JS, Obj-C sources, Android binaries) is installed from
  20. // npm.
  21. maven { url "$rootDir/../node_modules/react-native/android" }
  22. }
  23. // Third-party react-native modules which Jitsi Meet SDK for Android depends
  24. // on and which are not available in third-party Maven repositories need to
  25. // be deployed in a Maven repository of ours.
  26. //
  27. if (project.name.startsWith('react-native-')) {
  28. apply plugin: 'maven-publish'
  29. publishing {
  30. publications {}
  31. repositories {
  32. maven { url "file:${rootProject.projectDir}/../../../jitsi/jitsi-maven-repository/releases" }
  33. }
  34. }
  35. }
  36. afterEvaluate { project ->
  37. if (project.name.startsWith('react-native-')) {
  38. def npmManifest = project.file('../package.json')
  39. def json = new groovy.json.JsonSlurper().parseText(npmManifest.text)
  40. // React Native modules have an npm peer dependency on react-native,
  41. // they do not have an npm dependency on it. Further below though we
  42. // choose a react-native version (range) when we represent them as
  43. // Maven artifacts. Effectively, we are forking the projects by not
  44. // complying with the full range of their npm peer dependency and,
  45. // consequently, we should qualify their version.
  46. def versionQualifier = '-jitsi-1'
  47. if ('react-native-webrtc'.equals(project.name))
  48. versionQualifier = '-jitsi-1'
  49. project.version = "${json.version}${versionQualifier}"
  50. project.android {
  51. compileSdkVersion rootProject.ext.compileSdkVersion
  52. buildToolsVersion rootProject.ext.buildToolsVersion
  53. defaultConfig {
  54. minSdkVersion rootProject.ext.minSdkVersion
  55. targetSdkVersion rootProject.ext.targetSdkVersion
  56. }
  57. }
  58. task androidJavadocs(type: Javadoc) {
  59. source = android.sourceSets.main.java.source
  60. classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
  61. failOnError false
  62. }
  63. task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
  64. classifier = 'javadoc'
  65. from androidJavadocs.destinationDir
  66. }
  67. task androidSourcesJar(type: Jar) {
  68. classifier = 'sources'
  69. from android.sourceSets.main.java.source
  70. }
  71. publishing.publications {
  72. aarArchive(MavenPublication) {
  73. groupId rootProject.ext.moduleGroupId
  74. artifactId project.name
  75. version project.version
  76. artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
  77. extension "aar"
  78. }
  79. artifact(androidSourcesJar)
  80. artifact(androidJavadocsJar)
  81. pom.withXml {
  82. def pomXml = asNode()
  83. pomXml.appendNode('name', project.name)
  84. pomXml.appendNode('description', json.description)
  85. pomXml.appendNode('url', json.homepage)
  86. if (json.license) {
  87. def license = pomXml.appendNode('licenses').appendNode('license')
  88. license.appendNode('name', json.license)
  89. license.appendNode('distribution', 'repo')
  90. }
  91. def dependencies = pomXml.appendNode('dependencies')
  92. configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
  93. def artifactId = it.moduleName
  94. def version = it.moduleVersion
  95. // React Native signals breaking changes by
  96. // increasing the minor version number. So the
  97. // (third-party) React Native modules we utilize can
  98. // depend not on a specific react-native release but
  99. // a wider range.
  100. if (artifactId.equals('react-native')) {
  101. def versionNumber = VersionNumber.parse(version)
  102. version = "${versionNumber.major}.${versionNumber.minor}"
  103. }
  104. def dependency = dependencies.appendNode('dependency')
  105. dependency.appendNode('groupId', it.moduleGroup)
  106. dependency.appendNode('artifactId', artifactId)
  107. dependency.appendNode('version', version)
  108. }
  109. }
  110. }
  111. }
  112. }
  113. }
  114. }
  115. ext {
  116. compileSdkVersion = 25
  117. buildToolsVersion = "25.0.3"
  118. minSdkVersion = 16
  119. targetSdkVersion = 25
  120. // The Maven artifact groupdId of the third-party react-native modules which
  121. // Jitsi Meet SDK for Android depends on and which are not available in
  122. // third-party Maven repositories so we have to deploy to a Maven repository
  123. // of ours.
  124. moduleGroupId = 'com.facebook.react'
  125. }
  126. // Force the version of the Android build tools we have chosen on all
  127. // subprojects. The forcing was introduced for react-native and the third-party
  128. // modules that we utilize such as react-native-background-timer.
  129. subprojects { subproject ->
  130. afterEvaluate{
  131. if (subproject.plugins.hasPlugin('android')
  132. || subproject.plugins.hasPlugin('android-library')) {
  133. android {
  134. buildToolsVersion rootProject.ext.buildToolsVersion
  135. }
  136. }
  137. }
  138. }