Commit f25d422b authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Added back linphoneAndroidSdk

parent 1de6f3f9
......@@ -7,6 +7,7 @@
adb.pid
bc-android.keystore
bin
bin-sdk
build
certdata.txt
check_tools.mk
......
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.linphone.core"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="3401"
android:versionName="3.4.1">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26"/>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<manifest package="org.linphone"
xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="auto"
android:versionCode="3320"
android:versionName="3.3.2">
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="26"/>
</manifest>
#!/bin/bash
# Script found at http://everydaywithlinux.blogspot.fr/2012/11/patch-strings-in-binary-files-with-sed.html
function patch_strings_in_file() {
local FILE="$1"
local PATTERN="$2"
local REPLACEMENT="$3"
# Find all unique strings in FILE that contain the pattern
STRINGS=$(strings ${FILE} | grep ${PATTERN} | sort -u -r)
if [ "${STRINGS}" != "" ] ; then
echo "File '${FILE}' contain strings with '${PATTERN}' in them:"
for OLD_STRING in ${STRINGS} ; do
# Create the new string with a simple bash-replacement
NEW_STRING=${OLD_STRING//${PATTERN}/${REPLACEMENT}}
# Create null terminated ASCII HEX representations of the strings
OLD_STRING_HEX="$(echo -n ${OLD_STRING} | xxd -g 0 -u -ps -c 256)00"
NEW_STRING_HEX="$(echo -n ${NEW_STRING} | xxd -g 0 -u -ps -c 256)00"
if [ ${#NEW_STRING_HEX} -le ${#OLD_STRING_HEX} ] ; then
# Pad the replacement string with null terminations so the
# length matches the original string
while [ ${#NEW_STRING_HEX} -lt ${#OLD_STRING_HEX} ] ; do
NEW_STRING_HEX="${NEW_STRING_HEX}00"
done
# Now, replace every occurrence of OLD_STRING with NEW_STRING
echo -n "Replacing ${OLD_STRING} with ${NEW_STRING}... "
hexdump -ve '1/1 "%.2X"' ${FILE} | \
sed "s/${OLD_STRING_HEX}/${NEW_STRING_HEX}/g" | \
xxd -r -p > ${FILE}.tmp
chmod --reference ${FILE} ${FILE}.tmp
mv ${FILE}.tmp ${FILE}
echo "Done!"
else
echo "New string '${NEW_STRING}' is longer than old" \
"string '${OLD_STRING}'. Skipping."
fi
done
fi
}
patch_strings_in_file libs/armeabi-v7a/liblinphone-armeabi-v7a.so "./obj/local/armeabi-v7a/libffmpeg-linphone-arm.so" "libffmpeg-linphone-arm.so"
patch_strings_in_file libs/x86/liblinphone-x86.so "./obj/local/x86/libffmpeg-linphone-x86.so" "libffmpeg-linphone-x86.so"
......@@ -31,7 +31,6 @@ apply plugin: 'com.android.application'
def excludeFiles = []
// Remove or comment if you want to use those
excludeFiles.add('src/android/org/linphone/tutorials/*.java')
excludeFiles.add('**/gcm*')
def excludePackage = []
......@@ -118,12 +117,12 @@ dependencies {
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:support-v4:27.0.1'
if (isLocalAarAvailable()) {
/*if (isLocalAarAvailable()) {
releaseImplementation project(path: ":linphone-sdk-android", configuration: 'release')
debugImplementation project(path: ":linphone-sdk-android", configuration: 'debug')
} else {
} else {*/
implementation "org.linphone.legacy:linphone-sdk-android:4.2+"
}
//}
}
apply plugin: 'com.google.gms.google-services'
\ No newline at end of file
#!/bin/sh
error_on_quit=0
echo_err() {
echo "$@" >&2
error_on_quit=1
}
check_installed() {
if [ -z "$(which $1)" ]; then
echo_err "Could not find $1. Please install $2."
return 1
fi
return 0
}
for prog in automake autoconf pkg-config java ant yasm nasm wget; do
check_installed "$prog" "it"
done
if [ $(uname) = "Darwin" ]; then
check_installed "libtool" "libtool"
else
check_installed "libtoolize" "libtool"
fi
check_installed "ndk-build" "android NDK"
if check_installed "android" "android SDK"; then
check_installed "adb" "android SDK platform tools"
# check that at least one target is installed
if [ -z "$(android list target -c)" ]; then
echo_err "Install at least one android target in the android SDK"
fi
fi
if nasm -f elf32 2>&1 | grep -q "fatal: unrecognised output format"; then
echo_err "Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly."
fi
if ! (find submodules/linphone/mediastreamer2 -mindepth 1 2>/dev/null | grep -q . \
|| find submodules/linphone/oRTP -mindepth 1 2>/dev/null | grep -q .); then
echo_err "Missing some git submodules. Did you run 'git submodule update --init --recursive'?"
fi
# Android NDK should NOT be simlinked!
if [ -L "$ANDROID_NDK" ] && [ -d "$ANDROID_NDK" ]; then
echo_err "ANDROID_NDK=$ANDROID_NDK must NOT be a symbolic link, please modify it accordingly"
fi
if [ $error_on_quit = 0 ]; then
rm -f check_tools.mk
touch check_tools.mk
echo "JAVA=\"$(which java)\"" >> check_tools.mk
echo "ANTLR=\"$(which java)\" -jar \"submodules/externals/antlr3/antlr-3.2.jar\"" >> check_tools.mk
else
echo "Failed to detect required tools, aborting."
fi
exit $error_on_quit
// Project information
buildDir = 'bin'
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
maven { url "https://raw.github.com/synergian/wagon-git/releases"}
}
}
configurations {
javadocDeps
deployerJars
}
apply plugin: 'maven'
apply plugin: 'com.android.library'
dependencies {
compile group: 'org.apache.commons', name: 'commons-compress', version: '+'
javadocDeps group: 'org.apache.commons', name: 'commons-compress', version: '+'
deployerJars "ar.com.synergian:wagon-git:0.2.5"
}
def submoduleDir = ['submodules/mediastreamer2/java/src',
'submodules/linphone/java/j2se',
'submodules/linphone/java/common',
'submodules/linphone/java/impl',
'submodules/linphone/coreapi/help/examples/java'
'submodules/linphone/wrappers/java/classes/tools']
def excludePackage = []
excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
def excludeFiles = []
excludeFiles.add(''**/mediastream/MediastreamerActivity.java')
excludeFiles.add('H264Helper.java')
excludeFiles.add('OpenH264DownloadHelper.java')
excludeFiles.add('OpenH264DownloadHelperListener.java')
android {
defaultConfig {
compileSdkVersion 26
buildToolsVersion "27.0.3"
multiDexEnabled true
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
sourceSets {
main {
manifest.srcFile 'AndroidManifestLibrary.xml'
java.srcDirs = submoduleDir
resources.srcDirs = submoduleDir
aidl.srcDirs = submoduleDir
renderscript.srcDirs = submoduleDir
jniLibs.srcDirs = ['libs']
assets.srcDirs = ["${buildDir}/sdk-assets/assets/"]
java.excludes = excludeFiles
// Exclude some useless files
packagingOptions {
excludes = excludePackage
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
def rootSdk
if (file('liblinphone-sdk/android-arm64/share/linphone/rootca.pem').exists() )
rootSdk = 'liblinphone-sdk/android-arm64'
else if (file('liblinphone-sdk/android-arm/share/linphone/rootca.pem').exists() )
rootSdk = 'liblinphone-sdk/android-arm'
else if (file('liblinphone-sdk/android-armv7/share/linphone/rootca.pem').exists() )
rootSdk = 'liblinphone-sdk/android-armv7'
else if (file('liblinphone-sdk/android-x86/share/linphone/rootca.pem').exists() )
rootSdk = 'liblinphone-sdk/android-x86'
else {
println ("native sdk not ready yet")
rootSdk = ""
}
///////////// Task /////////////
task(releaseJavadoc, type: Javadoc, dependsOn: "assembleRelease") {
source = submoduleDir
excludes = ['**/mediastream/MediastreamerActivity.java',
'**/**.html',
'**/**.aidl']
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += files(android.libraryVariants.release.javaCompile.classpath.files)
classpath += configurations.javadocDeps
options.encoding = 'UTF-8'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
task androidJavadocsJar(type: Jar, dependsOn: releaseJavadoc) {
classifier = 'javadoc'
from releaseJavadoc.destinationDir
}
task sdkZip(type: Zip) {
String appName = "liblinphone-android-sdk"
String gitSha = 'git describe --always'.execute().text.trim()
String newSdkName = appName + "-" + gitSha + ".zip"
from('bin/libs',
'bin/outputs/aar')
include '*'
archiveName newSdkName
}
task copyAssets(type: Sync) {
from rootSdk
into "${buildDir}/sdk-assets/assets/org.linphone.core"
include '**/*_grammar'
//rename '(.*)', '$1'.toLowerCase()
eachFile {
path = path.toLowerCase() //to workaround case insensitive fs (macosx)
println("Syncing sdk asset ${sourcePath} to ${path}")
}
doFirst {
println("Syncing sdk assets into root dir ${destinationDir}")
}
// do not copy those
includeEmptyDirs = false
}
project.tasks['preBuild'].dependsOn 'copyAssets'
def gitversion = new ByteArrayOutputStream()
task getGitVersion {
exec {
commandLine 'git', 'describe', '--abbrev=0', '--always'
standardOutput = gitversion
}
}
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: 'git:master://git@gitlab.linphone.org:BC/public/maven_repository.git'){
authentication(privateKey: '/home/jenkins/maven.key')
}
pom.project {
groupId 'org.linphone'
artifactId 'liblinphone-sdk'
version project.hasProperty("debug") ? gitversion + "-DEBUG" : gitversion
}
}
}
}
project.tasks['uploadArchives'].dependsOn 'getGitVersion'
// Project information
buildDir = 'bin'
buildDir = 'bin-sdk'
buildscript {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
mavenLocal()
google()
jcenter()
}
}
apply plugin: 'com.android.library'
dependencies {
compile group: 'org.apache.commons', name: 'commons-compress', version: '+'
compile 'com.android.support:support-v4:26.0.2'
}
apply plugin: 'com.android.library'
def srcDirs = ['submodules/mediastreamer2/java/src',
'submodules/linphone/java/j2se',
'submodules/linphone/java/common',
'submodules/linphone/java/impl',
'submodules/linphone/coreapi/help/examples/java',
'submodules/linphone/wrappers/java/classes/tools/',
'src/android']
///// Exclude Files /////
def excludeFiles = []
// Exclude firebase file if not enable
excludeFiles.add('**/Firebase*')
// Remove or comment if you want to use those
excludeFiles.add('**/gcm*')
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
excludeFiles.add('H264Helper.java')
excludeFiles.add('OpenH264DownloadHelper.java')
excludeFiles.add('OpenH264DownloadHelperListener.java')
def excludePackage = []
......@@ -56,23 +36,31 @@ excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
/////////////////////////
repositories {
maven {
// Replace snapshots by releases for releases !
url "https://linphone.org/snapshots/maven_repository"
}
}
android {
defaultConfig {
compileSdkVersion 26
buildToolsVersion "27.0.3"
multiDexEnabled true
}
lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
disable 'MissingTranslation', 'UnusedResources'
}
sourceSets {
main {
manifest.srcFile 'AndroidManifestSdk.xml'
manifest.srcFile 'AndroidManifest.xml'
def srcDirs = ['src/android']
java.srcDirs = srcDirs
resources.srcDirs = srcDirs
aidl.srcDirs = srcDirs
......@@ -83,7 +71,6 @@ android {
java.excludes = excludeFiles
// Exclude some useless files
packagingOptions {
excludes = excludePackage
}
......@@ -92,40 +79,37 @@ android {
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
///////////// Task /////////////
task(releaseJavadoc, type: Javadoc, dependsOn: "assembleRelease") {
source = ['submodules/mediastreamer2/java/src',
'submodules/linphone/java/j2se',
'submodules/linphone/java/common',
'submodules/linphone/java/impl',
'submodules/linphone/coreapi/help/java']
excludes = ['**/mediastream/MediastreamerActivity.java',
'**/**.html',
'**/**.aidl']
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += files(android.libraryVariants.release.javaCompile.classpath.files)
packagingOptions {
pickFirst 'META-INF/NOTICE'
pickFirst 'META-INF/LICENSE'
exclude 'META-INF/MANIFEST.MF'
}
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
static def isLocalDebugAarAvailable() {
File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar')
return debugAar.exists()
}
task androidJavadocsJar(type: Jar, dependsOn: releaseJavadoc) {
classifier = 'javadoc'
from releaseJavadoc.destinationDir
static def isLocalReleaseAarAvailable() {
File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar')
return releaseAar.exists()
}
task sdkZip(type: Zip) {
String appName = "linphone-android-sdk"
String gitSha = 'git describe --always'.execute().text.trim()
String newSdkName = appName + "-" + gitSha + ".zip"
from('bin/libs',
'bin/outputs/aar')
include '*'
archiveName newSdkName
static def isLocalAarAvailable() {
return isLocalDebugAarAvailable() || isLocalReleaseAarAvailable()
}
dependencies {
implementation 'org.apache.commons:commons-compress:1.16.1'
implementation 'com.google.firebase:firebase-messaging:15.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:support-v4:27.0.1'
/*if (isLocalAarAvailable()) {
releaseImplementation project(path: ":linphone-sdk-android", configuration: 'release')
debugImplementation project(path: ":linphone-sdk-android", configuration: 'debug')
} else {*/
implementation "org.linphone.legacy:linphone-sdk-android:4.2+"
//}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment