[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
|
|
|
apply plugin: 'com.android.library'
|
2017-09-12 01:12:11 +00:00
|
|
|
apply plugin: 'maven-publish'
|
[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
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
|
|
|
|
|
|
defaultConfig {
|
|
|
|
minSdkVersion rootProject.ext.minSdkVersion
|
|
|
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
buildTypes {
|
|
|
|
debug {}
|
|
|
|
release {
|
|
|
|
minifyEnabled false
|
|
|
|
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
compile fileTree(dir: 'libs', include: ['*.jar'])
|
|
|
|
|
2017-12-12 14:35:40 +00:00
|
|
|
compile 'com.android.support:appcompat-v7:27.0.2'
|
[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
|
|
|
compile 'com.facebook.react:react-native:+'
|
|
|
|
|
|
|
|
compile project(':react-native-background-timer')
|
2017-07-21 14:41:01 +00:00
|
|
|
compile project(':react-native-fetch-blob')
|
[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
|
|
|
compile project(':react-native-immersive')
|
|
|
|
compile project(':react-native-keep-awake')
|
2017-12-12 16:26:10 +00:00
|
|
|
compile project(':react-native-locale-detector')
|
2018-02-26 19:37:12 +00:00
|
|
|
compile project(':react-native-sound')
|
[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
|
|
|
compile project(':react-native-vector-icons')
|
|
|
|
compile project(':react-native-webrtc')
|
2018-02-08 18:50:19 +00:00
|
|
|
compile project(':react-native-calendar-events')
|
2018-04-03 16:28:31 +00:00
|
|
|
|
|
|
|
testCompile 'junit:junit:4.12'
|
[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
|
|
|
}
|
|
|
|
|
|
|
|
// Build process helpers
|
|
|
|
//
|
|
|
|
|
|
|
|
void runBefore(String dependentTaskName, Task task) {
|
|
|
|
Task dependentTask = tasks.findByPath(dependentTaskName);
|
|
|
|
if (dependentTask != null) {
|
|
|
|
dependentTask.dependsOn task
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
gradle.projectsEvaluated {
|
2017-06-22 13:46:18 +00:00
|
|
|
android.buildTypes.all { buildType ->
|
|
|
|
def buildNameCapitalized = "${buildType.name.capitalize()}"
|
|
|
|
def bundlePath = "${buildDir}/intermediates/bundles/${buildType.name}"
|
|
|
|
|
|
|
|
// Bundle fonts in react-native-vector-icons.
|
|
|
|
//
|
|
|
|
|
|
|
|
def currentFontTask = tasks.create(
|
|
|
|
name: "copy${buildNameCapitalized}Fonts",
|
|
|
|
type: Copy) {
|
|
|
|
from("${projectDir}/../../fonts/jitsi.ttf")
|
|
|
|
from("${projectDir}/../../node_modules/react-native-vector-icons/Fonts/")
|
|
|
|
into("${bundlePath}/assets/fonts")
|
[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
|
|
|
}
|
2017-06-22 13:46:18 +00:00
|
|
|
|
|
|
|
currentFontTask.dependsOn("merge${buildNameCapitalized}Resources")
|
|
|
|
currentFontTask.dependsOn("merge${buildNameCapitalized}Assets")
|
|
|
|
|
|
|
|
runBefore("processArmeabi-v7a${buildNameCapitalized}Resources", currentFontTask)
|
|
|
|
runBefore("processX86${buildNameCapitalized}Resources", currentFontTask)
|
|
|
|
runBefore("processUniversal${buildNameCapitalized}Resources", currentFontTask)
|
|
|
|
runBefore("process${buildNameCapitalized}Resources", currentFontTask)
|
|
|
|
|
2018-04-05 19:12:24 +00:00
|
|
|
def currentSoundsTask = tasks.create(
|
|
|
|
name: "copy${buildNameCapitalized}Sounds",
|
|
|
|
type: Copy) {
|
|
|
|
from("${projectDir}/../../sounds/joined.wav")
|
|
|
|
from("${projectDir}/../../sounds/left.wav")
|
2018-05-17 10:40:38 +00:00
|
|
|
from("${projectDir}/../../sounds/outgoingRinging.wav")
|
|
|
|
from("${projectDir}/../../sounds/outgoingStart.wav")
|
2018-04-05 19:12:24 +00:00
|
|
|
into("${bundlePath}/assets/sounds")
|
|
|
|
}
|
|
|
|
|
|
|
|
currentSoundsTask.dependsOn("merge${buildNameCapitalized}Resources")
|
|
|
|
currentSoundsTask.dependsOn("merge${buildNameCapitalized}Assets")
|
|
|
|
|
|
|
|
runBefore("processArmeabi-v7a${buildNameCapitalized}Resources", currentSoundsTask)
|
|
|
|
runBefore("processX86${buildNameCapitalized}Resources", currentSoundsTask)
|
|
|
|
runBefore("processUniversal${buildNameCapitalized}Resources", currentSoundsTask)
|
|
|
|
runBefore("process${buildNameCapitalized}Resources", currentSoundsTask)
|
|
|
|
|
2017-06-22 13:46:18 +00:00
|
|
|
// Bundle JavaScript and React resources.
|
|
|
|
// (adapted from react-native/react.gradle)
|
|
|
|
//
|
|
|
|
|
|
|
|
// React JS bundle directories
|
|
|
|
def jsBundleDir = file("${bundlePath}/assets")
|
|
|
|
def resourcesDir = file("${bundlePath}/res/merged")
|
|
|
|
def jsBundleFile = file("${jsBundleDir}/index.android.bundle")
|
|
|
|
|
|
|
|
// Bundle task name for variant.
|
|
|
|
def bundleJsAndAssetsTaskName = "bundle${buildNameCapitalized}JsAndAssets"
|
|
|
|
|
|
|
|
def currentBundleTask = tasks.create(
|
|
|
|
name: bundleJsAndAssetsTaskName,
|
|
|
|
type: Exec) {
|
|
|
|
// Set up inputs and outputs so gradle can cache the result.
|
|
|
|
def reactRoot = file("${projectDir}/../../")
|
|
|
|
inputs.files fileTree(dir: reactRoot, excludes: ['android/**', 'ios/**'])
|
|
|
|
outputs.dir jsBundleDir
|
|
|
|
outputs.dir resourcesDir
|
|
|
|
|
|
|
|
// Set up the call to the react-native cli.
|
|
|
|
workingDir reactRoot
|
|
|
|
|
|
|
|
// Create JS bundle
|
|
|
|
def devEnabled = !buildNameCapitalized.toLowerCase().contains('release')
|
|
|
|
commandLine(
|
|
|
|
'node',
|
|
|
|
'node_modules/react-native/local-cli/cli.js',
|
|
|
|
'bundle',
|
|
|
|
'--assets-dest', resourcesDir,
|
|
|
|
'--bundle-output', jsBundleFile,
|
|
|
|
'--dev', "${devEnabled}",
|
|
|
|
'--entry-file', 'index.android.js',
|
|
|
|
'--platform', 'android',
|
|
|
|
'--reset-cache')
|
2017-07-10 15:42:03 +00:00
|
|
|
|
|
|
|
// Disable bundling on dev builds
|
2017-07-16 07:23:59 +00:00
|
|
|
enabled !devEnabled
|
2017-06-22 13:46:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process
|
|
|
|
currentBundleTask.dependsOn("merge${buildNameCapitalized}Resources")
|
|
|
|
currentBundleTask.dependsOn("merge${buildNameCapitalized}Assets")
|
|
|
|
|
|
|
|
runBefore("processArmeabi-v7a${buildNameCapitalized}Resources", currentBundleTask)
|
|
|
|
runBefore("processX86${buildNameCapitalized}Resources", currentBundleTask)
|
|
|
|
runBefore("processUniversal${buildNameCapitalized}Resources", currentBundleTask)
|
|
|
|
runBefore("process${buildNameCapitalized}Resources", currentBundleTask)
|
[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
|
|
|
}
|
|
|
|
}
|
2017-09-12 01:12:11 +00:00
|
|
|
|
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
aarArchive(MavenPublication) {
|
|
|
|
groupId 'org.jitsi.react'
|
|
|
|
artifactId 'jitsi-meet-sdk'
|
|
|
|
version '1.9.0'
|
|
|
|
|
|
|
|
artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
|
|
|
|
extension "aar"
|
|
|
|
}
|
|
|
|
pom.withXml {
|
|
|
|
def pomXml = asNode()
|
|
|
|
pomXml.appendNode('name', 'jitsi-meet-sdk')
|
|
|
|
pomXml.appendNode('description', 'Jitsi Meet SDK for Android')
|
|
|
|
def dependencies = pomXml.appendNode('dependencies')
|
|
|
|
configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
|
|
|
|
// The (third-party) React Native modules that we depend on
|
|
|
|
// are in source code form and do not have groupId. That is
|
|
|
|
// why we have a dedicated groupId for them. But the other
|
|
|
|
// dependencies come through Maven and, consequently, have
|
|
|
|
// groupId.
|
|
|
|
def groupId = it.moduleGroup
|
|
|
|
def artifactId = it.moduleName
|
|
|
|
|
|
|
|
if (artifactId.startsWith('react-native-')
|
|
|
|
&& groupId.equals('jitsi-meet')) {
|
|
|
|
groupId = rootProject.ext.moduleGroupId
|
|
|
|
}
|
|
|
|
|
|
|
|
def dependency = dependencies.appendNode('dependency')
|
|
|
|
dependency.appendNode('groupId', groupId)
|
|
|
|
dependency.appendNode('artifactId', artifactId)
|
|
|
|
dependency.appendNode('version', it.moduleVersion)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven { url "file:${rootProject.projectDir}/../../../jitsi/jitsi-maven-repository/releases" }
|
|
|
|
}
|
|
|
|
}
|