-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle
96 lines (86 loc) · 2.14 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
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion '25.0.0'
defaultConfig {
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
aidl {
srcDir 'src'
}
jni {
srcDirs = []
}
jniLibs {
srcDirs 'libs'
}
}
}
/*
sourceSets {
main {
java {
srcDir 'src'
}
res {
srcDir 'res'
}
assets {
srcDir 'assets'
}
resources {
srcDir 'src'
}
aidl {
srcDir 'src'
}
jni {
srcDirs = []
}
jniLibs {
srcDirs 'libs'
}
}
}
*/
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
commandLine ndkDir + "\\ndk-build.cmd",
'NDK_PROJECT_PATH=build/intermediates/ndk',
'NDK_LIBS_OUT=libs',
'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
'NDK_APPLICATION_MK=src/main/jni/Application.mk',
'OPEN-CV-SDK=' + OPEN_CV_SDK
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
defaultConfig {
ndk {
abiFilters "armeabi-v7a"
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
}