Skip to content

Commit 8e87ac0

Browse files
committed
Added ndk compilation
1 parent 0a53abe commit 8e87ac0

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

opuslib/build.gradle

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,23 @@ android {
3434
withJavadocJar()
3535
}
3636
}
37+
38+
sourceSets.main {
39+
jni.srcDirs = [] // This prevents the auto generation of Android.mk
40+
jniLibs.srcDir 'src/main/libs' // This is not necessary unless you have precompiled libraries in your project.
41+
}
42+
43+
task ndkBuild(type: Exec) {
44+
//if (Os.isFamily(Os.FAMILY_WINDOWS)) {
45+
commandLine 'ndk-build.cmd', '-C', file('src/main/jni').absolutePath
46+
//} else {
47+
// commandLine 'ndk-build', '-C', file('src/main/jni').absolutePath
48+
//}
49+
}
50+
51+
tasks.withType(JavaCompile) {
52+
compileTask -> compileTask.dependsOn ndkBuild
53+
}
3754
}
3855

3956
dependencies {

0 commit comments

Comments
 (0)