forked from acomminos/Jumble
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
100 lines (82 loc) · 2.87 KB
/
build.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
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
}
}
apply plugin: 'com.android.library'
apply plugin: 'maven'
group = 'com.github.velegip'
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
repositories {
google()
jcenter()
}
dependencies {
implementation 'com.google.protobuf:protobuf-java:3.4.0'
api 'com.madgag.spongycastle:core:1.51.0.0'
// Custom PKCS12 keybag parse modifications to support Mumble unencrypted certificates
// Source: https://github.com/Morlunk/spongycastle/tree/pkcs12-keybag-fixes
api files('libs/sc-morlunk-prov-1.51.0.0.jar', 'libs/sc-morlunk-pkix-1.51.0.0.jar')
implementation 'com.googlecode.javacpp:javacpp:0.7'
implementation 'com.intellij:annotations:12.0@jar'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
def getNdkPath() {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def ndkdir = properties.getProperty('ndk.dir', null)
if (ndkdir == null)
throw new GradleException('NDK location not found. Define location with "ndk.dir" in the "local.properties" file.')
return ndkdir
}
def getNdkBuildCmd() {
def ndkbuild = getNdkPath() + File.separator + "ndk-build"
if (System.properties['os.name'].toLowerCase().contains('windows')) {
ndkbuild = ndkbuild + ".cmd"
}
return ndkbuild
}
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
sourceSets {
main {
res.srcDirs = ['src/main/res']
jniLibs.srcDirs = ['src/main/libs/']
jni.srcDirs = [] // This prevents the auto generation of Android.mk
}
}
defaultConfig {
testApplicationId "com.morlunk.jumble.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
minSdkVersion 16
targetSdkVersion 28
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
stl "gnustl_static"
cFlags "-I\$(LOCAL_PATH)/speex/include/ -I\$(LOCAL_PATH)/celt-0.11.0-src/include/ -I\$(LOCAL_PATH)/celt-0.7.0-src/include/ -I\$(LOCAL_PATH)/opus/include -D__EMX__ -DUSE_KISS_FFT -DFIXED_POINT -DEXPORT='' -DHAVE_CONFIG_H -fvisibility=hidden -DOPUS_BUILD -DVAR_ARRAYS -DFIXED_POINT"
}
}
// Trigger NDK build on java compilation task.
task ndkBuild(type: Exec) {
commandLine getNdkBuildCmd(), '-C', file('src/main/jni/').absolutePath
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
}