diff --git a/README.md b/README.md index 6ae73ebee..d45d111a7 100644 --- a/README.md +++ b/README.md @@ -67,11 +67,9 @@ git clone https://gitlab.linphone.org/BC/public/linphone-sdk.git --recursive 2. Follow the instructions in the linphone-sdk/README file to build the SDK. -3. Edit in the linphone-sdk-android folder of this project the symbolic link (debug and/or release) to the generated AAR. -We recommend to at least create the link for the release AAR that can be used for debug APK flavor because it is smaller and will reduce the time required to install the APK. +3. Create or edit the gradle.properties file in $GRADLE_USER_HOME (usually ~/.gradle) file and add the absolute path to your linphone-sdk build directory, for example: ``` -ln -s /linphone-sdk/build/linphone-sdk/bin/outputs/aar/linphone-sdk-android-release.aar linphone-sdk-android/linphone-sdk-android-release.aar -ln -s /linphone-sdk/build/linphone-sdk/bin/outputs/aar/linphone-sdk-android-debug.aar linphone-sdk-android/linphone-sdk-android-debug.aar +LinphoneSdkBuildDir=/home//linphone-sdk/build/ ``` 4. Rebuild the app in Android Studio. diff --git a/app/build.gradle b/app/build.gradle index 657e9b40a..a821d37b5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,20 +9,6 @@ static def firebaseEnabled() { return googleFile.exists() } -static def isLocalDebugAarAvailable() { - File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar') - return debugAar.exists() -} - -static def isLocalReleaseAarAvailable() { - File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar') - return releaseAar.exists() -} - -static def isLocalAarAvailable() { - return isLocalDebugAarAvailable() || isLocalReleaseAarAvailable() -} - task getGitVersion() { def gitVersion = "4.3.0" def gitVersionStream = new ByteArrayOutputStream() @@ -76,6 +62,9 @@ excludePackage.add('**/LICENSE.txt') ///////////////////////// repositories { + maven { + url file(LinphoneSdkBuildDir + '/maven_repository/') + } maven { url "https://linphone.org/maven_repository" } @@ -103,7 +92,7 @@ android { outputFileName = "linphone-android-${variant.buildType.name}-${project.version}.apk" } - if (variant.buildType.name.equals("release")) { + if (variant.buildType.name == "release") { variant.getMergedFlavor().manifestPlaceholders = [linphone_address_mime_type: "vnd.android.cursor.item/vnd." + getPackageName() + ".provider.sip_address", linphone_file_provider: getPackageName() + ".provider"] } else { @@ -172,6 +161,7 @@ android { } dependencies { + compileOnly 'org.jetbrains:annotations:19.0.0' if (firebaseEnabled()) { implementation 'com.google.firebase:firebase-messaging:19.0.1' } @@ -179,18 +169,7 @@ dependencies { implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android:flexbox:1.1.0' implementation 'com.github.bumptech.glide:glide:4.9.0' - - if (isLocalAarAvailable()) { - if (isLocalReleaseAarAvailable()) { - //debug AAR is a lot bigger than release one, and APK install time will be much longer so use release one for day-to-day development - implementation project(path: ":linphone-sdk-android", configuration: 'release') - } else { - releaseImplementation project(path: ":linphone-sdk-android", configuration: 'release') - debugImplementation project(path: ":linphone-sdk-android", configuration: 'debug') - } - } else { - implementation "org.linphone:linphone-sdk-android:4.4+" - } + implementation "org.linphone:linphone-sdk-android:4.4+" } if (firebaseEnabled()) { apply plugin: 'com.google.gms.google-services' diff --git a/gradle.properties b/gradle.properties index d3845f634..f5f6b6b17 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,3 +7,4 @@ RELEASE_KEY_PASSWORD= org.gradle.jvmargs=-Xmx2g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 android.useAndroidX=true android.enableJetifier=true +LinphoneSdkBuildDir= \ No newline at end of file diff --git a/linphone-sdk-android/build.gradle b/linphone-sdk-android/build.gradle deleted file mode 100644 index 23bf11d67..000000000 --- a/linphone-sdk-android/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -configurations.maybeCreate("debug") -configurations.maybeCreate("release") - -File debugAar = new File('linphone-sdk-android/linphone-sdk-android-debug.aar') -File releaseAar = new File('linphone-sdk-android/linphone-sdk-android-release.aar') - -if (debugAar.exists()) { - artifacts.add("debug", file('linphone-sdk-android-debug.aar')) -} -if (releaseAar.exists()) { - artifacts.add("release", file('linphone-sdk-android-release.aar')) -} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 3c51d2094..9d495b34f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1 @@ -include ':app', ':linphone-sdk-android' +include ':app' \ No newline at end of file