forked from BelledonneCommunications/linphone-android
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle
More file actions
190 lines (164 loc) · 5.84 KB
/
build.gradle
File metadata and controls
190 lines (164 loc) · 5.84 KB
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0'
}
}
apply plugin: 'com.android.application'
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
compile 'de.timroes:aXMLRPC:1.8.0'
compile 'com.android.support:support-v4:23.3.0'
androidTestCompile fileTree(dir: 'tests/libs', include: '*.jar')
}
def allSrcDirs = ['submodules/linphone/mediastreamer2/java/src',
'submodules/linphone/java/j2se',
'submodules/linphone/java/common',
'submodules/linphone/java/impl',
'submodules/linphone/coreapi/help/java',
'src']
android {
compileSdkVersion 22
buildToolsVersion "23.0.3"
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = allSrcDirs
resources.srcDirs = allSrcDirs
aidl.srcDirs = allSrcDirs
renderscript.srcDirs = allSrcDirs
res.srcDirs = ['res']
assets.srcDirs = ['assets']
jniLibs.srcDir 'libs'
java.exclude '**/mediastream/MediastreamerActivity.java'
}
// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('tests')
androidTest {
java.srcDirs = ['tests/src']
res.srcDirs = ['tests/res']
}
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
def gitDescribe = 'git describe --always'.execute().text.trim()
defaultConfig {
versionName ""
}
buildTypes {
debug {
versionNameSuffix gitDescribe
}
release {
lintOptions {
disable 'MissingTranslation'
}
}
}
if (project.hasProperty("RELEASE_VERSION_NAME")) {
buildTypes {
release {
versionNameSuffix RELEASE_VERSION_NAME
}
}
}
if (project.hasProperty("RELEASE_STORE_FILE")) {
signingConfigs {
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
release {
signingConfig signingConfigs.release
}
}
}
task generateDebugJniHeaders { }
task generateReleaseJniHeaders { }
def coreJniClasses = [
'org.linphone.core.LinphoneAddressImpl',
'org.linphone.core.LinphoneAuthInfoImpl',
'org.linphone.core.LinphoneCallImpl',
'org.linphone.core.LinphoneCallLogImpl',
'org.linphone.core.LinphoneCallParamsImpl',
'org.linphone.core.LinphoneCallStatsImpl',
'org.linphone.core.LinphoneChatMessageImpl',
'org.linphone.core.LinphoneChatRoomImpl',
'org.linphone.core.LinphoneCoreFactoryImpl',
'org.linphone.core.LinphoneCoreImpl',
'org.linphone.core.LinphoneFriendImpl',
'org.linphone.core.LinphoneProxyConfigImpl',
'org.linphone.core.PayloadTypeImpl',
'org.linphone.core.LpConfigImpl',
'org.linphone.core.LinphoneInfoMessageImpl',
'org.linphone.core.LinphoneEventImpl',
'org.linphone.core.PresenceActivityImpl',
'org.linphone.core.PresenceModelImpl',
'org.linphone.core.PresenceNoteImpl',
'org.linphone.core.PresencePersonImpl',
'org.linphone.core.PresenceServiceImpl',
'org.linphone.core.ErrorInfoImpl',
]
task generateDebugCoreJniHeaders(type: JavahTask) {
variant = 'debug'
outputFile = file('gen/linphonecore_jni.h')
args coreJniClasses
}
generateDebugJniHeaders.dependsOn generateDebugCoreJniHeaders
task generateReleaseCoreJniHeaders(type: JavahTask) {
variant = 'release'
outputFile = file('gen/linphonecore_jni.h')
args coreJniClasses
}
generateReleaseJniHeaders.dependsOn generateReleaseCoreJniHeaders
task generateDebugXml2LpcJniHeaders(type: JavahTask) {
variant = 'debug'
outputFile = file('gen/xml2lpc_jni.h')
args 'org.linphone.tools.Xml2Lpc'
}
generateDebugJniHeaders.dependsOn generateDebugXml2LpcJniHeaders
task generateReleaseXml2LpcJniHeaders(type: JavahTask) {
variant = 'release'
outputFile = file('gen/xml2lpc_jni.h')
args 'org.linphone.tools.Xml2Lpc'
}
generateReleaseJniHeaders.dependsOn generateReleaseXml2LpcJniHeaders
task generateDebugLpc2XmlJniHeaders(type: JavahTask) {
variant = 'debug'
outputFile = file('gen/lpc2xml_jni.h')
args 'org.linphone.tools.Lpc2Xml'
}
generateDebugJniHeaders.dependsOn generateDebugLpc2XmlJniHeaders
task generateReleaseLpc2XmlJniHeaders(type: JavahTask) {
variant = 'release'
outputFile = file('gen/lpc2xml_jni.h')
args 'org.linphone.tools.Lpc2Xml'
}
generateReleaseJniHeaders.dependsOn generateReleaseLpc2XmlJniHeaders
}
class JavahTask extends Exec {
def setVariant(String variant) {
def compileTaskName = "compile${variant.capitalize()}JavaWithJavac"
executable 'javah'
args '-classpath', "${->project[compileTaskName].destinationDir}"
dependsOn compileTaskName
}
def setOutputFile(File outputFile) {
args '-o', outputFile
}
}