mirror of
https://gitlab.linphone.org/BC/public/linphone-android.git
synced 2026-01-17 19:38:08 +00:00
Fixed AAR
This commit is contained in:
parent
a7107bac10
commit
9dc4f33605
3 changed files with 41 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
compileSdkVersion 27
|
||||
defaultConfig {
|
||||
applicationId "com.belledonne_communications.aaar_tester"
|
||||
minSdkVersion 21
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import android.widget.TextView;
|
|||
|
||||
import org.linphone.core.LinphoneCore;
|
||||
import org.linphone.core.LinphoneCoreFactory;
|
||||
import org.linphone.core.LinphoneCoreListenerBase;
|
||||
|
||||
public class MainActivity extends AppCompatActivity {
|
||||
|
||||
|
|
@ -19,7 +20,9 @@ public class MainActivity extends AppCompatActivity {
|
|||
LinphoneCoreFactory.instance().setDebugMode(true, getString(R.string.app_name));
|
||||
|
||||
try {
|
||||
LinphoneCore core = LinphoneCoreFactory.instance().createLinphoneCore(null, this);
|
||||
LinphoneCore core = LinphoneCoreFactory.instance().createLinphoneCore(new LinphoneCoreListenerBase() {
|
||||
|
||||
}, this);
|
||||
((TextView)findViewById(R.id.version)).setText(core.getVersion());
|
||||
} catch (Exception e) {
|
||||
((TextView)findViewById(R.id.version)).setText("Error ! " + e);
|
||||
|
|
|
|||
|
|
@ -68,7 +68,8 @@ android {
|
|||
aidl.srcDirs = submoduleDir
|
||||
renderscript.srcDirs = submoduleDir
|
||||
jniLibs.srcDirs = ['libs']
|
||||
|
||||
assets.srcDirs = ["${buildDir}/sdk-assets/assets/"]
|
||||
|
||||
java.excludes = ['**/mediastream/MediastreamerActivity.java']
|
||||
|
||||
// Exclude some useless files
|
||||
|
|
@ -81,6 +82,21 @@ android {
|
|||
}
|
||||
}
|
||||
|
||||
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") {
|
||||
|
|
@ -114,3 +130,22 @@ task sdkZip(type: Zip) {
|
|||
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'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue