Skip to content

Commit e82192c

Browse files
committed
Update build.gradle and README.md
1 parent e6e0dab commit e82192c

File tree

2 files changed

+54
-16
lines changed

2 files changed

+54
-16
lines changed

README.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,32 @@ opencv341 android sdk with contrib341 module build on windows.
66
工作需要,目前主要编译了armeabi-v7a的.so库.a库,主要用于jni编程,附带java应用层函数。
77

88

9-
## A build.gradle for armeabi-v7a with NDK
9+
## A templet build.gradle for armeabi-v7a with NDK
10+
1011
apply plugin: 'com.android.library'
1112
android {
12-
compileSdkVersion 23
13-
13+
...
1414
defaultConfig {
15-
minSdkVersion 21
16-
targetSdkVersion 23
17-
versionCode 1
18-
versionName "1.0"
15+
...
1916
//配置NDK信息
2017
ndk {
2118
moduleName "opencv3"
2219
ldLibs "log", "jnigraphics", "m", "z"
2320
abiFilters "armeabi-v7a"
2421
}
25-
//配置SO文件存放地址
22+
//配置SO文件存放路径
2623
sourceSets {
2724
main {
2825
jni.srcDirs = []
2926
jniLibs.srcDirs = ['src/main/libs']
3027
}
3128
}
3229
}
33-
buildTypes {
34-
release {
35-
minifyEnabled false
36-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
37-
}
38-
}
39-
//设置构建脚本路径
30+
//设置构建脚本路径,会自动索引同目录下的Application.mk
4031
externalNativeBuild {
4132
ndkBuild {
4233
path 'src/main/jni/Android.mk'
4334
}
4435
}
45-
}
36+
}
37+
...

build.gradle

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,49 @@ android {
125125

126126
dependencies {
127127
}
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+
*/

0 commit comments

Comments
 (0)