= Introduction = Until today, integrating liblinphone sdk into a third party application required compiling a sdk from the sources or importing sdk binary files from: http://www.linphone.org/technical-corner/liblinphone/downloads In order to ease integration of this sdk, we adapted a Gitlab repository as a Maven one. Maven is a standardized tool to manage and build Java-based projects, which core unit of work is Project Object Model. With Gradle and this Maven repository, we now offer the ability to either host or import remotely liblinphone sdk, as any future library. = How to produce and host Liblinphone SDK on our Maven repository = To host Liblinphone SDK and allow future remote import, follow theses steps: == Get Linphone-Android and deploy locally Liblinphone SDK == git clone git@gitlab.linphone.org:BC/public/linphone-android.git cd linphone-android git checkout -b master origin/master git submodule sync && git submodule update ~-~-init ~-~-recursive ./prepare.py -c && ./prepare.py && make == Binary and Maven files production == This part requires a private SSH key used to write right to the repository, it must be asked to Simon Morlat, Jehan Monnier, Sylvain Berfini or Erwan Croze. Then it must be placed into liblinphone-sdk folder. === Settings === Set the liblinphone-sdk/build.gradle and gradle.properties files as in the maven_repository Git project. liblinphone-sdk/build.gradle: allprojects { repositories { ... maven { url "https://raw.github.com/synergian/wagon-git/releases"} } } configurations { ... deployerJars } apply plugin: 'maven' ... dependencies { ... deployerJars "ar.com.synergian:wagon-git:0.2.5" } ///////////// Task ///////////// uploadArchives { repositories { mavenDeployer { configuration = configurations.deployerJars repository(url: 'git:master://git@gitlab.linphone.org:BC/public/maven_repository.git'){ authentication(privateKey: privateKey) } pom.project { groupId 'org.linphone.maven' artifactId 'liblinphone-sdk' version project.hasProperty("debug") ? "4.0.1-DEBUG": "4.0.1" } } } } gradle.properties: privateKey=./maven_rsa === Options explanation === -configuration: uses settings and deployment forms from wagon-git project, which allows gradle to push right to maven_repository. -repository: the link to our maven_repository. In case of future modification, keep the 'git:master:~/~/' part, it is needed for wagon-git to handle sending. -authentification: uses a private key corresponding to the deploy key assigned to this project , defined in gradle.properties. -pom.project: theses options will define the way we call the dependency in the last part, as following: 'groupId:artifactId:version' For other libraries or versions, just edit artifactId or version. Keep the -DEBUG part in the code. Maven favors convention over configuration. === Production === Check if linphone-android builds on the right device. Then, in a terminal located at linphone-android's root, type: gradle clean assemble uploadArchives or gradle clean assembleDebug uploadArchives Warning: If a not working version is produced, before building it again, clear the whole gradle cache ($HOME/.gradle/caches/), or gradle will produce the same. = How to use hosted Liblinphone SDK as a remote dependency = In another linphone-android project, in which you can delete liblinphone-sdk folder, edit linphone-android build.gradle like the one located in maven_repository root: == Set our Maven repository source == allprojects { repositories { maven{ url "https://gitlab.linphone.org/BC/public/maven_repository/raw/master" } } } Be sure to keep the raw/master part in future modification, as it defines the true path to files, not the one to navigate in web browser. == Change our local project dependency to remote dependency == dependencies { // implementation project(':liblinphone-sdk') releaseImplementation 'org.linphone.maven:liblinphone-sdk:4.0.1' debugImplementation 'org.linphone.maven:liblinphone-sdk:4.0.1-DEBUG' } Comment release or debug line if no remote library is available for it. Use the settings provided in the creation part so gradle can find the right dependency: 'groupId:artifactId:version' In case of another library need or newer version, provided it is hosted, just change artifactId and version in accordance to its declaration in the creation part. = Sources = All of these links contributed to teach me the way to produce this repository: https://docs.gradle.org/current/userguide/maven_plugin.html https://github.com/synergian/wagon-git https://jeroenmols.com/blog/2016/02/05/wagongit/ http://kodbiro.com/use-github-pages-as-your-own-maven-repository/ http://downright-amazed.blogspot.com/2011/09/hosting-maven-repository-on-github-for.html