"Fossies" - the Fresh Open Source Software Archive 
Member "jitsi-meet-7693/android/sdk/build.gradle" (8 Dec 2023, 9181 Bytes) of package /linux/misc/jitsi-meet-7693.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Java source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
1 apply plugin: 'com.android.library'
2 apply plugin: 'maven-publish'
3
4 android {
5 compileSdkVersion rootProject.ext.compileSdkVersion
6 ndkVersion rootProject.ext.ndkVersion
7
8 defaultConfig {
9 minSdkVersion rootProject.ext.minSdkVersion
10 targetSdkVersion rootProject.ext.targetSdkVersion
11 }
12
13 buildTypes {
14 debug {
15 buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
16 buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${rootProject.ext.googleServicesEnabled}"
17 }
18 release {
19 minifyEnabled false
20 proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
21 buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
22 buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${rootProject.ext.googleServicesEnabled}"
23 }
24 }
25
26 sourceSets {
27 main {
28 java {
29 exclude "test/"
30 }
31 }
32 }
33 }
34
35 dependencies {
36 implementation fileTree(dir: 'libs', include: ['*.jar'])
37 implementation 'androidx.appcompat:appcompat:1.4.1'
38 implementation 'androidx.fragment:fragment:1.4.1'
39 implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
40 implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
41
42 //noinspection GradleDynamicVersion
43 api 'com.facebook.react:react-native:+'
44 //noinspection GradleDynamicVersion
45 implementation 'org.webkit:android-jsc:+'
46
47 implementation 'com.facebook.fresco:animated-gif:2.5.0'
48 implementation 'com.dropbox.core:dropbox-core-sdk:4.0.1'
49 implementation 'com.jakewharton.timber:timber:4.7.1'
50 implementation 'com.squareup.duktape:duktape-android:1.3.0'
51 implementation 'com.google.code.gson:gson:2.8.6'
52 implementation "androidx.startup:startup-runtime:1.1.0"
53
54 // Only add these packages if we are NOT doing a LIBRE_BUILD
55 if (!rootProject.ext.libreBuild) {
56 implementation project(':react-native-amplitude')
57 implementation project(':react-native-giphy')
58 implementation(project(":react-native-google-signin")) {
59 exclude group: 'com.google.android.gms'
60 exclude group: 'androidx'
61 }
62 }
63
64 implementation project(':react-native-async-storage')
65 implementation project(':react-native-background-timer')
66 implementation project(':react-native-calendar-events')
67 implementation project(':react-native-community_clipboard')
68 implementation project(':react-native-community_netinfo')
69 implementation project(':react-native-default-preference')
70 implementation(project(':react-native-device-info')) {
71 exclude group: 'com.google.firebase'
72 exclude group: 'com.google.android.gms'
73 exclude group: 'com.android.installreferrer'
74 }
75 implementation project(':react-native-gesture-handler')
76 implementation project(':react-native-get-random-values')
77 implementation project(':react-native-immersive-mode')
78 implementation project(':react-native-keep-awake')
79 implementation project(':react-native-orientation-locker')
80 implementation project(':react-native-pager-view')
81 implementation project(':react-native-performance')
82 implementation project(':react-native-safe-area-context')
83 implementation project(':react-native-screens')
84 implementation project(':react-native-slider')
85 implementation project(':react-native-sound')
86 implementation project(':react-native-splash-screen')
87 implementation project(':react-native-svg')
88 implementation project(':react-native-video')
89 implementation project(':react-native-webrtc')
90 implementation project(':react-native-webview')
91
92 testImplementation 'junit:junit:4.12'
93 }
94
95
96 // Here we bundle all assets, resources and React files. We cannot use the
97 // react.gradle file provided by react-native because it's designed to be used
98 // in an application (it taps into applicationVariants, but the SDK is a library
99 // so we need libraryVariants instead).
100 android.libraryVariants.all { def variant ->
101 // Create variant and target names
102 def targetName = variant.name.capitalize()
103 def targetPath = variant.dirName
104
105 // React js bundle directories
106 def jsBundleDir = file("$buildDir/generated/assets/react/${targetPath}")
107 def resourcesDir = file("$buildDir/generated/res/react/${targetPath}")
108
109 def jsBundleFile = file("$jsBundleDir/index.android.bundle")
110
111 def currentBundleTask = tasks.create(
112 name: "bundle${targetName}JsAndAssets",
113 type: Exec) {
114 group = "react"
115 description = "bundle JS and assets for ${targetName}."
116
117 // Create dirs if they are not there (e.g. the "clean" task just ran)
118 doFirst {
119 jsBundleDir.deleteDir()
120 jsBundleDir.mkdirs()
121 resourcesDir.deleteDir()
122 resourcesDir.mkdirs()
123 }
124
125 // Set up inputs and outputs so gradle can cache the result
126 def reactRoot = file("${projectDir}/../../")
127 inputs.files fileTree(dir: reactRoot, excludes: ["android/**", "ios/**"])
128 outputs.dir jsBundleDir
129 outputs.dir resourcesDir
130
131 // Set up the call to the react-native cli
132 workingDir reactRoot
133
134 // Set up dev mode
135 def devEnabled = !targetName.toLowerCase().contains("release")
136
137 // Run the bundler
138 commandLine(
139 "node",
140 "node_modules/react-native/local-cli/cli.js",
141 "bundle",
142 "--platform", "android",
143 "--dev", "${devEnabled}",
144 "--reset-cache",
145 "--entry-file", "index.android.js",
146 "--bundle-output", jsBundleFile,
147 "--assets-dest", resourcesDir)
148
149 // Disable bundling on dev builds
150 enabled !devEnabled
151 }
152
153 currentBundleTask.ext.generatedResFolders = files(resourcesDir).builtBy(currentBundleTask)
154 currentBundleTask.ext.generatedAssetsFolders = files(jsBundleDir).builtBy(currentBundleTask)
155 variant.registerGeneratedResFolders(currentBundleTask.generatedResFolders)
156
157 def mergeAssetsTask = variant.mergeAssetsProvider.get()
158 def mergeResourcesTask = variant.mergeResourcesProvider.get()
159
160 mergeAssetsTask.dependsOn(currentBundleTask)
161 mergeResourcesTask.dependsOn(currentBundleTask)
162
163 mergeAssetsTask.doLast {
164 def assetsDir = mergeAssetsTask.outputDir.get()
165
166 // Bundle sounds
167 //
168 copy {
169 from("${projectDir}/../../sounds")
170 include("*.wav")
171 include("*.mp3")
172 into("${assetsDir}/sounds")
173 }
174
175 // Copy React assets
176 //
177 if (currentBundleTask.enabled) {
178 copy {
179 from(jsBundleFile)
180 into(assetsDir)
181 }
182 }
183 }
184
185 mergeResourcesTask.doLast {
186 // Copy React resources
187 //
188 if (currentBundleTask.enabled) {
189 copy {
190 from(resourcesDir)
191 into(mergeResourcesTask.outputDir.get())
192 }
193 }
194 }
195 }
196
197
198 publishing {
199 publications {
200 aarArchive(MavenPublication) {
201 groupId 'org.jitsi.react'
202 artifactId 'jitsi-meet-sdk'
203 version System.env.OVERRIDE_SDK_VERSION ?: project.sdkVersion
204
205 artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
206 extension "aar"
207 }
208 pom.withXml {
209 def pomXml = asNode()
210 pomXml.appendNode('name', 'jitsi-meet-sdk')
211 pomXml.appendNode('description', 'Jitsi Meet SDK for Android')
212 def dependencies = pomXml.appendNode('dependencies')
213 configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
214 // The (third-party) React Native modules that we depend on
215 // are in source code form and do not have groupId. That is
216 // why we have a dedicated groupId for them. But the other
217 // dependencies come through Maven and, consequently, have
218 // groupId.
219 def groupId = it.moduleGroup
220 def artifactId = it.moduleName
221
222 if (artifactId.startsWith('react-native-')) {
223 groupId = rootProject.ext.moduleGroupId
224 }
225
226 def dependency = dependencies.appendNode('dependency')
227 dependency.appendNode('groupId', groupId)
228 dependency.appendNode('artifactId', artifactId)
229 dependency.appendNode('version', it.moduleVersion)
230 }
231 }
232 }
233
234 }
235 repositories {
236 maven {
237 url rootProject.ext.mavenRepo
238 if (!rootProject.ext.mavenRepo.startsWith("file")) {
239 credentials {
240 username rootProject.ext.mavenUser
241 password rootProject.ext.mavenPassword
242 }
243 }
244 }
245 }
246 }