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