2016-10-30 23:12:07 +00:00
|
|
|
apply plugin: 'com.android.application'
|
2016-10-05 14:36:59 +00:00
|
|
|
|
2019-04-30 10:24:12 +00:00
|
|
|
boolean googleServicesEnabled \
|
|
|
|
= project.file('google-services.json').exists() && !rootProject.ext.libreBuild
|
2018-12-28 09:38:56 +00:00
|
|
|
|
|
|
|
// Crashlytics integration is done as part of Firebase now, so it gets
|
|
|
|
// automagically activated with google-services.json
|
|
|
|
if (googleServicesEnabled) {
|
|
|
|
apply plugin: 'io.fabric'
|
|
|
|
}
|
|
|
|
|
2019-03-21 09:24:40 +00:00
|
|
|
// Use the number of seconds/10 since Jan 1 2019 as the versionCode.
|
|
|
|
// This lets us upload a new build at most every 10 seconds for the
|
|
|
|
// next ~680 years.
|
|
|
|
// https://stackoverflow.com/a/38643838
|
|
|
|
def vcode = (int)(((new Date().getTime()/1000) - 1546297200) / 10)
|
2018-12-28 09:38:56 +00:00
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
android {
|
[RN] Add initial Jitsi Meet SDK for Android
Dames en heren, welcome to Jitsi Meet SDK for Android, the Jitsi Meet library
for Android.
The Jitsi Meet SDK encapsulates React Native and all the dependencies Jitsi
Meet has so other aopplications can integrate it easily.
Unlike iOS, creating "fat" libraries is not allways (if at all) possible on
Android, however, effort was put into making the integration as easy as
possible.
While React Native can be embedded in native applications, I don't think it was
designed to be embedded as part of an Android library, hidden away from the
application using it. This surfaced as a number of issues which had to be
addressed specifically due to our use-case:
- Activity lifecycle methods must be linked with the React Native engine, so the
library provides wrapper methods.
- Custom fonts have to be manually added as assets, since the provided gradle
script doesn't work properly in a library target.
- The RN packager has to be manually triggered since the gradle script will no
longer do it for us.
At this stage, the Jitsi Meet application is just a small single activity
application which uses the Jitsi Meet SDK to create a single activity which
represents the entire application. Events and external conference handling are
forthcoming.
PS: Yours truly would like to add that it was a lot more fun to work on the iOS
side of things.
2017-05-22 13:33:42 +00:00
|
|
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
2018-09-21 15:01:16 +00:00
|
|
|
buildToolsVersion rootProject.ext.buildToolsVersion
|
2016-10-05 14:36:59 +00:00
|
|
|
|
|
|
|
defaultConfig {
|
2016-12-06 21:33:03 +00:00
|
|
|
applicationId 'org.jitsi.meet'
|
2019-03-21 09:24:40 +00:00
|
|
|
versionCode vcode
|
2018-11-30 16:08:48 +00:00
|
|
|
versionName project.appVersion
|
[RN] Add initial Jitsi Meet SDK for Android
Dames en heren, welcome to Jitsi Meet SDK for Android, the Jitsi Meet library
for Android.
The Jitsi Meet SDK encapsulates React Native and all the dependencies Jitsi
Meet has so other aopplications can integrate it easily.
Unlike iOS, creating "fat" libraries is not allways (if at all) possible on
Android, however, effort was put into making the integration as easy as
possible.
While React Native can be embedded in native applications, I don't think it was
designed to be embedded as part of an Android library, hidden away from the
application using it. This surfaced as a number of issues which had to be
addressed specifically due to our use-case:
- Activity lifecycle methods must be linked with the React Native engine, so the
library provides wrapper methods.
- Custom fonts have to be manually added as assets, since the provided gradle
script doesn't work properly in a library target.
- The RN packager has to be manually triggered since the gradle script will no
longer do it for us.
At this stage, the Jitsi Meet application is just a small single activity
application which uses the Jitsi Meet SDK to create a single activity which
represents the entire application. Events and external conference handling are
forthcoming.
PS: Yours truly would like to add that it was a lot more fun to work on the iOS
side of things.
2017-05-22 13:33:42 +00:00
|
|
|
|
|
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
ndk {
|
2019-03-15 14:10:29 +00:00
|
|
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
|
|
|
}
|
2018-06-07 08:38:11 +00:00
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
buildTypes {
|
2018-09-06 19:22:45 +00:00
|
|
|
debug {
|
2018-12-28 09:38:56 +00:00
|
|
|
buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
|
2019-04-30 10:24:12 +00:00
|
|
|
buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
|
2018-09-06 19:22:45 +00:00
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
release {
|
2018-09-06 19:22:45 +00:00
|
|
|
minifyEnabled true
|
2018-09-07 19:27:44 +00:00
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules-release.pro'
|
2018-12-28 09:38:56 +00:00
|
|
|
buildConfigField "boolean", "GOOGLE_SERVICES_ENABLED", "${googleServicesEnabled}"
|
2019-04-30 10:24:12 +00:00
|
|
|
buildConfigField "boolean", "LIBRE_BUILD", "${rootProject.ext.libreBuild}"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main {
|
|
|
|
java {
|
|
|
|
if (rootProject.ext.libreBuild) {
|
|
|
|
srcDir "src"
|
|
|
|
exclude "**/GoogleServicesHelper.java"
|
|
|
|
}
|
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
|
|
|
}
|
2018-06-07 08:38:11 +00:00
|
|
|
|
|
|
|
compileOptions {
|
|
|
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
|
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
|
|
}
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
|
|
|
|
2018-12-28 09:38:56 +00:00
|
|
|
repositories {
|
|
|
|
maven { url 'https://maven.fabric.io/public' }
|
|
|
|
}
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
dependencies {
|
2018-09-21 15:01:16 +00:00
|
|
|
implementation fileTree(dir: 'libs', include: ['*.jar'])
|
2019-08-15 14:54:31 +00:00
|
|
|
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
|
2019-11-26 18:50:01 +00:00
|
|
|
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
|
|
|
|
|
|
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.0-beta-5'
|
2019-04-30 10:24:12 +00:00
|
|
|
|
|
|
|
if (!rootProject.ext.libreBuild) {
|
|
|
|
implementation 'com.google.android.gms:play-services-auth:16.0.1'
|
|
|
|
|
|
|
|
// Firebase
|
|
|
|
// - Crashlytics
|
|
|
|
// - Dynamic Links
|
|
|
|
implementation 'com.google.firebase:firebase-core:16.0.6'
|
|
|
|
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
|
|
|
|
implementation 'com.google.firebase:firebase-dynamic-links:16.1.5'
|
|
|
|
}
|
2016-10-19 14:07:40 +00:00
|
|
|
|
2017-06-20 15:32:44 +00:00
|
|
|
implementation project(':sdk')
|
2016-10-05 14:36:59 +00:00
|
|
|
}
|
2018-08-10 10:30:00 +00:00
|
|
|
|
2018-09-26 21:57:44 +00:00
|
|
|
gradle.projectsEvaluated {
|
|
|
|
// Dropbox integration
|
|
|
|
//
|
|
|
|
|
2019-01-29 12:19:22 +00:00
|
|
|
def dropboxAppKey
|
|
|
|
if (project.file('dropbox.key').exists()) {
|
|
|
|
dropboxAppKey = project.file('dropbox.key').text.trim() - 'db-'
|
2018-09-26 21:57:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dropboxAppKey) {
|
|
|
|
android.defaultConfig.resValue('string', 'dropbox_app_key', "${dropboxAppKey}")
|
|
|
|
|
|
|
|
def dropboxActivity = """
|
|
|
|
<activity
|
|
|
|
android:configChanges="keyboard|orientation"
|
|
|
|
android:launchMode="singleTask"
|
|
|
|
android:name="com.dropbox.core.android.AuthActivity">
|
|
|
|
<intent-filter>
|
|
|
|
<action android:name="android.intent.action.VIEW" />
|
|
|
|
<category android:name="android.intent.category.BROWSABLE" />
|
|
|
|
<category android:name="android.intent.category.DEFAULT" />
|
|
|
|
<data android:scheme="db-${dropboxAppKey}" />
|
|
|
|
</intent-filter>
|
2019-01-29 12:19:22 +00:00
|
|
|
</activity>"""
|
2018-09-26 21:57:44 +00:00
|
|
|
|
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
variant.outputs.each { output ->
|
2019-03-20 14:12:04 +00:00
|
|
|
output.getProcessManifestProvider().get().doLast {
|
2019-03-08 13:17:45 +00:00
|
|
|
def outputDir = manifestOutputDirectory.get().asFile
|
|
|
|
def manifestPath = new File(outputDir, 'AndroidManifest.xml')
|
|
|
|
def charset = 'UTF-8'
|
|
|
|
def text
|
|
|
|
text = manifestPath.getText(charset)
|
|
|
|
text = text.replace('</application>', "${dropboxActivity}</application>")
|
|
|
|
manifestPath.write(text, charset)
|
2018-09-26 21:57:44 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-03-20 14:14:42 +00:00
|
|
|
|
|
|
|
// Run React packager
|
|
|
|
android.applicationVariants.all { variant ->
|
|
|
|
def targetName = variant.name.capitalize()
|
|
|
|
|
|
|
|
def currentRunPackagerTask = tasks.create(
|
|
|
|
name: "run${targetName}ReactPackager",
|
|
|
|
type: Exec) {
|
|
|
|
group = "react"
|
|
|
|
description = "Run the React packager."
|
|
|
|
|
|
|
|
doFirst {
|
|
|
|
println "Starting the React packager..."
|
|
|
|
|
|
|
|
def androidRoot = file("${projectDir}/../")
|
|
|
|
|
|
|
|
// Set up the call to the script
|
|
|
|
workingDir androidRoot
|
|
|
|
|
|
|
|
// Run the packager
|
|
|
|
commandLine("scripts/run-packager.sh")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set up dev mode
|
|
|
|
def devEnabled = !targetName.toLowerCase().contains("release")
|
|
|
|
|
|
|
|
// Only enable for dev builds
|
|
|
|
enabled devEnabled
|
|
|
|
}
|
|
|
|
|
|
|
|
def packageTask = variant.packageApplicationProvider.get()
|
|
|
|
|
|
|
|
packageTask.dependsOn(currentRunPackagerTask)
|
|
|
|
}
|
|
|
|
|
2018-09-26 21:57:44 +00:00
|
|
|
}
|
|
|
|
|
2018-12-28 09:38:56 +00:00
|
|
|
if (googleServicesEnabled) {
|
2018-08-10 10:30:00 +00:00
|
|
|
apply plugin: 'com.google.gms.google-services'
|
|
|
|
}
|