File tree Expand file tree Collapse file tree 2 files changed +54
-16
lines changed Expand file tree Collapse file tree 2 files changed +54
-16
lines changed Original file line number Diff line number Diff line change @@ -6,40 +6,32 @@ opencv341 android sdk with contrib341 module build on windows.
6
6
工作需要,目前主要编译了armeabi-v7a的.so库.a库,主要用于jni编程,附带java应用层函数。
7
7
8
8
9
- ## A build.gradle for armeabi-v7a with NDK
9
+ ## A templet build.gradle for armeabi-v7a with NDK
10
+
10
11
apply plugin: 'com.android.library'
11
12
android {
12
- compileSdkVersion 23
13
-
13
+ ...
14
14
defaultConfig {
15
- minSdkVersion 21
16
- targetSdkVersion 23
17
- versionCode 1
18
- versionName "1.0"
15
+ ...
19
16
//配置NDK信息
20
17
ndk {
21
18
moduleName "opencv3"
22
19
ldLibs "log", "jnigraphics", "m", "z"
23
20
abiFilters "armeabi-v7a"
24
21
}
25
- //配置SO文件存放地址
22
+ //配置SO文件存放路径
26
23
sourceSets {
27
24
main {
28
25
jni.srcDirs = [ ]
29
26
jniLibs.srcDirs = [ 'src/main/libs']
30
27
}
31
28
}
32
29
}
33
- buildTypes {
34
- release {
35
- minifyEnabled false
36
- proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
37
- }
38
- }
39
- //设置构建脚本路径
30
+ //设置构建脚本路径,会自动索引同目录下的Application.mk
40
31
externalNativeBuild {
41
32
ndkBuild {
42
33
path 'src/main/jni/Android.mk'
43
34
}
44
35
}
45
- }
36
+ }
37
+ ...
Original file line number Diff line number Diff line change @@ -125,3 +125,49 @@ android {
125
125
126
126
dependencies {
127
127
}
128
+
129
+
130
+
131
+ /* A templet build.gradle for armeabi-v7a with NDK
132
+
133
+ apply plugin: 'com.android.library'
134
+ android {
135
+ compileSdkVersion 23
136
+
137
+ defaultConfig {
138
+ minSdkVersion 21
139
+ targetSdkVersion 23
140
+ versionCode 1
141
+ versionName "1.0"
142
+ //配置NDK信息
143
+ ndk {
144
+ moduleName "opencv3"
145
+ ldLibs "log", "jnigraphics", "m", "z"
146
+ abiFilters "armeabi-v7a"
147
+ }
148
+ //配置SO文件存放路径
149
+ sourceSets {
150
+ main {
151
+ jni.srcDirs = []
152
+ jniLibs.srcDirs = ['src/main/libs']
153
+ }
154
+ }
155
+ }
156
+ buildTypes {
157
+ release {
158
+ minifyEnabled false
159
+ proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
160
+ }
161
+ }
162
+ //设置构建脚本路径,会自动索引同目录下的Application.mk
163
+ externalNativeBuild {
164
+ ndkBuild {
165
+ path 'src/main/jni/Android.mk'
166
+ }
167
+ }
168
+ }
169
+ dependencies {
170
+ implementation fileTree(dir: 'libs', include: ['*.jar'])
171
+ implementation 'com.android.support:appcompat-v7:23.4.0'
172
+ }
173
+ */
You can’t perform that action at this time.
0 commit comments