forked from BelledonneCommunications/linphone-android
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinphoneAndroidSdk.gradle
117 lines (94 loc) · 2.9 KB
/
linphoneAndroidSdk.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// 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()
}
}
apply plugin: 'com.android.library'
dependencies {
implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.16.1'
implementation 'com.android.support:support-v4:26.0.2'
}
def srcDirs = ['submodules/mediastreamer2/java/src', 'src/linphone-wrapper', 'src/android']
def excludeFiles = []
excludeFiles.add('**/Firebase*')
excludeFiles.add('**/gcm*')
excludeFiles.add('**/mediastream/MediastreamerActivity.java')
def excludePackage = []
excludePackage.add('**/gdb.*')
excludePackage.add('**/libopenh264**')
excludePackage.add('**/**tester**')
excludePackage.add('**/LICENSE.txt')
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 'AndroidManifestSdk.xml'
java.srcDirs = srcDirs
resources.srcDirs = srcDirs
aidl.srcDirs = srcDirs
renderscript.srcDirs = srcDirs
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
java.excludes = excludeFiles
// Exclude some useless files
packagingOptions {
excludes = excludePackage
}
}
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
///////////// Task /////////////
task(releaseJavadoc, type: Javadoc, dependsOn: "assembleRelease") {
source = ['submodules/mediastreamer2/java/src', 'src/linphone-wrapper']
excludes = ['**/mediastream/MediastreamerActivity.java',
'**/**.html',
'**/**.aidl']
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += files(android.libraryVariants.release.javaCompile.classpath.files)
}
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 = "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
}