[RN] SDK building, installing, and publishing
Based on work authored by Shuai Li <sli@atlassian.com>, Daniel Ornelas <dornelas@atlassian.com>, and Lyubo Marinov <lmarinov@atlassian.com>.
This commit is contained in:
parent
4b2795502c
commit
72c9933e73
|
@ -99,8 +99,8 @@ see our [guidelines for contributing](CONTRIBUTING.md).
|
|||
Jitsi Meet provides a very flexible way of embedding it in external applications by using the [Jitsi Meet API](doc/api.md).
|
||||
|
||||
## Mobile app
|
||||
Jitsi Meet is also available as a React Native application for Android and iOS.
|
||||
Instructions on how to build it can be found [here](doc/mobile.md).
|
||||
Jitsi Meet is also available as a React Native app for Android and iOS.
|
||||
Instructions on how to build it can be found [here](doc/mobile.md).
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
|
|
|
@ -1,9 +1,26 @@
|
|||
# Jitsi Meet SDK for Android
|
||||
|
||||
This directory contains the source code of the Jitsi Meet app and the Jitsi Meet
|
||||
SDK for Android.
|
||||
## Build
|
||||
|
||||
## Jitsi Meet SDK
|
||||
1. Install all required [dependencies](https://github.com/jitsi/jitsi-meet/blob/master/doc/mobile.md).
|
||||
|
||||
2. ```bash
|
||||
cd android/
|
||||
./gradlew :sdk:assembleRelease
|
||||
```
|
||||
|
||||
3. ```bash
|
||||
./gradlew :sdk:publish
|
||||
cd ../
|
||||
```
|
||||
|
||||
## Install
|
||||
|
||||
Add the Maven repository
|
||||
`https://github.com/jitsi/jitsi-maven-repository/raw/master/releases` and the
|
||||
dependency `org.jitsi.react:jitsi-meet-sdk:1.9.0` into your `build.gradle`.
|
||||
|
||||
## API
|
||||
|
||||
Jitsi Meet SDK is an Android library which embodies the whole Jitsi Meet
|
||||
experience and makes it reusable by third-party apps.
|
||||
|
|
|
@ -7,7 +7,7 @@ android {
|
|||
defaultConfig {
|
||||
applicationId 'org.jitsi.meet'
|
||||
versionCode Integer.parseInt("${version}")
|
||||
versionName "1.4.${version}"
|
||||
versionName "1.9.${version}"
|
||||
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
|
|
|
@ -18,14 +18,111 @@ allprojects {
|
|||
repositories {
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
maven {
|
||||
// Google's maven repository, required for AppCompat
|
||||
url "https://maven.google.com"
|
||||
maven { url "https://maven.google.com" } // Required for appcompat.
|
||||
// React Native (JS, Obj-C sources, Android binaries) is installed from
|
||||
// npm.
|
||||
maven { url "$rootDir/../node_modules/react-native/android" }
|
||||
}
|
||||
|
||||
// Third-party react-native modules which Jitsi Meet SDK for Android depends
|
||||
// on and which are not available in third-party Maven repositories need to
|
||||
// be deployed in a Maven repository of ours.
|
||||
//
|
||||
|
||||
if (project.name.startsWith('react-native-')) {
|
||||
apply plugin: 'maven-publish'
|
||||
publishing {
|
||||
publications {}
|
||||
repositories {
|
||||
maven { url "file:${rootProject.projectDir}/../../../jitsi/jitsi-maven-repository/releases" }
|
||||
}
|
||||
}
|
||||
maven {
|
||||
// All of React Native (JS, Obj-C sources, Android binaries) is
|
||||
// installed from npm.
|
||||
url "$rootDir/../node_modules/react-native/android"
|
||||
}
|
||||
|
||||
afterEvaluate { project ->
|
||||
if (project.name.startsWith('react-native-')) {
|
||||
def npmManifest = project.file('../package.json')
|
||||
def json = new groovy.json.JsonSlurper().parseText(npmManifest.text)
|
||||
|
||||
// React Native modules have an npm peer dependency on react-native,
|
||||
// they do not have an npm dependency on it. Further below though we
|
||||
// choose a react-native version (range) when we represent them as
|
||||
// Maven artifacts. Effectively, we are forking the projects by not
|
||||
// complying with the full range of their npm peer dependency and,
|
||||
// consequently, we should qualify their version.
|
||||
def versionQualifier = '-jitsi-1'
|
||||
if ('react-native-webrtc'.equals(project.name))
|
||||
versionQualifier = '-jitsi-1'
|
||||
|
||||
project.version = "${json.version}${versionQualifier}"
|
||||
|
||||
project.android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
buildToolsVersion rootProject.ext.buildToolsVersion
|
||||
defaultConfig {
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
}
|
||||
}
|
||||
|
||||
task androidJavadocs(type: Javadoc) {
|
||||
source = android.sourceSets.main.java.source
|
||||
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
||||
failOnError false
|
||||
}
|
||||
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
|
||||
classifier = 'javadoc'
|
||||
from androidJavadocs.destinationDir
|
||||
}
|
||||
task androidSourcesJar(type: Jar) {
|
||||
classifier = 'sources'
|
||||
from android.sourceSets.main.java.source
|
||||
}
|
||||
|
||||
publishing.publications {
|
||||
aarArchive(MavenPublication) {
|
||||
groupId rootProject.ext.moduleGroupId
|
||||
artifactId project.name
|
||||
version project.version
|
||||
|
||||
artifact("${project.buildDir}/outputs/aar/${project.name}-release.aar") {
|
||||
extension "aar"
|
||||
}
|
||||
artifact(androidSourcesJar)
|
||||
artifact(androidJavadocsJar)
|
||||
pom.withXml {
|
||||
def pomXml = asNode()
|
||||
pomXml.appendNode('name', project.name)
|
||||
pomXml.appendNode('description', json.description)
|
||||
pomXml.appendNode('url', json.homepage)
|
||||
if (json.license) {
|
||||
def license = pomXml.appendNode('licenses').appendNode('license')
|
||||
license.appendNode('name', json.license)
|
||||
license.appendNode('distribution', 'repo')
|
||||
}
|
||||
|
||||
def dependencies = pomXml.appendNode('dependencies')
|
||||
configurations.getByName('releaseCompileClasspath').getResolvedConfiguration().getFirstLevelModuleDependencies().each {
|
||||
def artifactId = it.moduleName
|
||||
def version = it.moduleVersion
|
||||
// React Native signals breaking changes by
|
||||
// increasing the minor version number. So the
|
||||
// (third-party) React Native modules we utilize can
|
||||
// depend not on a specific react-native release but
|
||||
// a wider range.
|
||||
if (artifactId.equals('react-native')) {
|
||||
def versionNumber = VersionNumber.parse(version)
|
||||
version = "${versionNumber.major}.${versionNumber.minor}"
|
||||
}
|
||||
|
||||
def dependency = dependencies.appendNode('dependency')
|
||||
dependency.appendNode('groupId', it.moduleGroup)
|
||||
dependency.appendNode('artifactId', artifactId)
|
||||
dependency.appendNode('version', version)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +132,12 @@ ext {
|
|||
buildToolsVersion = "25.0.3"
|
||||
minSdkVersion = 16
|
||||
targetSdkVersion = 25
|
||||
|
||||
// The Maven artifact groupdId of the third-party react-native modules which
|
||||
// Jitsi Meet SDK for Android depends on and which are not available in
|
||||
// third-party Maven repositories so we have to deploy to a Maven repository
|
||||
// of ours.
|
||||
moduleGroupId = 'com.facebook.react'
|
||||
}
|
||||
|
||||
// Force the version of the Android build tools we have chosen on all
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
android {
|
||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||
|
@ -53,7 +54,6 @@ gradle.projectsEvaluated {
|
|||
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")
|
||||
|
@ -82,7 +82,6 @@ gradle.projectsEvaluated {
|
|||
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/**'])
|
||||
|
@ -119,3 +118,46 @@ gradle.projectsEvaluated {
|
|||
runBefore("process${buildNameCapitalized}Resources", currentBundleTask)
|
||||
}
|
||||
}
|
||||
|
||||
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" }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
# Jitsi Meet mobile apps
|
||||
# Jitsi Meet apps for Android and iOS
|
||||
|
||||
Jitsi Meet can also be built as a standalone mobile application for
|
||||
iOS and Android. It uses the [React Native] framework.
|
||||
Jitsi Meet can also be built as a standalone app for Android or iOS. It uses the
|
||||
[React Native] framework.
|
||||
|
||||
First make sure the [React Native dependencies] are installed.
|
||||
|
||||
**NOTE**: This document assumes the app is being built on a macOS system.
|
||||
|
||||
**NOTE**: The app must be built for an actual device since the simulators don't
|
||||
work properly with the native plugins we require.
|
||||
**NOTE**: This document assumes the app is being built on a macOS system.
|
||||
|
||||
**NOTE**: Node 6.X and npm 3.X are recommended for building.
|
||||
|
||||
|
@ -95,17 +92,15 @@ build environment. Make sure you follow it closely.
|
|||
|
||||
It will be launched on the connected Android device.
|
||||
|
||||
|
||||
## Debugging
|
||||
|
||||
The official documentation on [debugging] is quite extensive, it is the
|
||||
The official documentation on [debugging] is quite extensive and specifies the
|
||||
preferred method for debugging.
|
||||
|
||||
**NOTE**: When using Chrome Developer Tools for debugging the JavaScript code
|
||||
is being interpreted by Chrome's V8 engine, instead of JSCore which
|
||||
React Native uses. It's important to keep this in mind due to potential
|
||||
differences in supported JavaScript features.
|
||||
|
||||
**NOTE**: When using Chrome Developer Tools for debugging the JavaScript source
|
||||
code is being interpreted by Chrome's V8 engine, instead of JSCore which React
|
||||
Native uses. It's important to keep this in mind due to potential differences in
|
||||
supported JavaScript features.
|
||||
|
||||
[Android Studio]: https://developer.android.com/studio/index.html
|
||||
[debugging]: https://facebook.github.io/react-native/docs/debugging.html
|
||||
|
|
|
@ -1,9 +1,19 @@
|
|||
# Jitsi Meet SDK for iOS
|
||||
|
||||
This directory contains the source code of the Jitsi Meet app and the Jitsi Meet
|
||||
SDK for iOS.
|
||||
## Build
|
||||
|
||||
## Jitsi Meet SDK
|
||||
1. Install all required [dependencies](https://github.com/jitsi/jitsi-meet/blob/master/doc/mobile.md).
|
||||
|
||||
2. `xcodebuild -workspace ios/jitsi-meet.xcworkspace -scheme JitsiMeet -destination='generic/platform=iOS' -configuration Release archive`
|
||||
|
||||
## Install
|
||||
|
||||
After successfully building Jitsi Meet SDK for iOS, copy
|
||||
`ios/sdk/JitsiMeet.framework` (if the path points to a symbolic link, follow the
|
||||
symbolic link) and
|
||||
`node_modules/react-native-webrtc/ios/WebRTC.framework` into your project.
|
||||
|
||||
## API
|
||||
|
||||
JitsiMeet is an iOS framework which embodies the whole Jitsi Meet experience and
|
||||
makes it reusable by third-party apps.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.4</string>
|
||||
<string>1.9</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
ActionType = "Xcode.IDEStandardExecutionActionsCore.ExecutionActionType.ShellScriptAction">
|
||||
<ActionContent
|
||||
title = "Run Script"
|
||||
scriptText = "exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal if [ "true" == ${ALREADYINVOKED:-false} ] then echo "RECURSION: Detected, stopping" else export ALREADYINVOKED="true" # make sure the output directory exists mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" echo "Building for iPhoneSimulator" xcodebuild -workspace "${WORKSPACE_PATH}" -scheme "${TARGET_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' ONLY_ACTIVE_ARCH=NO ARCHS='i386 x86_64' BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" ENABLE_BITCODE=YES OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE=bitcode clean build # Step 1. Copy the framework structure (from iphoneos build) to the universal folder echo "Copying to output folder" cp -R "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${FULL_PRODUCT_NAME}" "${UNIVERSAL_OUTPUTFOLDER}/" # Step 2. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule/." if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule" fi # Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory echo "Combining executables" lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${EXECUTABLE_PATH}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${EXECUTABLE_PATH}" "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${EXECUTABLE_PATH}" # Step 4. Create universal binaries for embedded frameworks #for SUB_FRAMEWORK in $( ls "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Frameworks" ); do #BINARY_NAME="${SUB_FRAMEWORK%.*}" #lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Frameworks/${SUB_FRAMEWORK}/${BINARY_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${SUB_FRAMEWORK}/${BINARY_NAME}" "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${TARGET_NAME}.framework/Frameworks/${SUB_FRAMEWORK}/${BINARY_NAME}" #done # Step 5. Convenience step to copy the framework to the project's directory echo "Copying to project dir" yes | cp -Rf "${UNIVERSAL_OUTPUTFOLDER}/${FULL_PRODUCT_NAME}" "${PROJECT_DIR}" open "${PROJECT_DIR}" fi">
|
||||
scriptText = "exec > /tmp/${PROJECT_NAME}_archive.log 2>&1 UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal if [ "true" == ${ALREADYINVOKED:-false} ] then echo "RECURSION: Detected, stopping" else export ALREADYINVOKED="true" # make sure the output directory exists mkdir -p "${UNIVERSAL_OUTPUTFOLDER}" echo "Building for iPhoneSimulator" xcodebuild -workspace "${WORKSPACE_PATH}" -scheme "${TARGET_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 6' ONLY_ACTIVE_ARCH=NO ARCHS='i386 x86_64' BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" ENABLE_BITCODE=YES OTHER_CFLAGS="-fembed-bitcode" BITCODE_GENERATION_MODE=bitcode clean build # Step 1. Copy the framework structure (from iphoneos build) to the universal folder echo "Copying to output folder" cp -R "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${FULL_PRODUCT_NAME}" "${UNIVERSAL_OUTPUTFOLDER}/" # Step 2. Copy Swift modules from iphonesimulator build (if it exists) to the copied framework directory SIMULATOR_SWIFT_MODULES_DIR="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule/." if [ -d "${SIMULATOR_SWIFT_MODULES_DIR}" ]; then cp -R "${SIMULATOR_SWIFT_MODULES_DIR}" "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Modules/${TARGET_NAME}.swiftmodule" fi # Step 3. Create universal binary file using lipo and place the combined executable in the copied framework directory echo "Combining executables" lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${EXECUTABLE_PATH}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${EXECUTABLE_PATH}" "${BUILD_DIR}/${CONFIGURATION}-iphoneos/${EXECUTABLE_PATH}" # Step 4. Create universal binaries for embedded frameworks #for SUB_FRAMEWORK in $( ls "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Frameworks" ); do #BINARY_NAME="${SUB_FRAMEWORK%.*}" #lipo -create -output "${UNIVERSAL_OUTPUTFOLDER}/${TARGET_NAME}.framework/Frameworks/${SUB_FRAMEWORK}/${BINARY_NAME}" "${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${SUB_FRAMEWORK}/${BINARY_NAME}" "${ARCHIVE_PRODUCTS_PATH}${INSTALL_PATH}/${TARGET_NAME}.framework/Frameworks/${SUB_FRAMEWORK}/${BINARY_NAME}" #done # Step 5. Convenience step to copy the framework to the project's directory echo "Copying to project dir" yes | cp -Rf "${UNIVERSAL_OUTPUTFOLDER}/${FULL_PRODUCT_NAME}" "${PROJECT_DIR}" fi">
|
||||
<EnvironmentBuildable>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<string>1.9.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
|
|
Loading…
Reference in New Issue