Created
April 20, 2016 14:55
-
-
Save cavarzan/5cf0d5919e1d698adb0e789254ec1d6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.android.model.library' | |
def gpg_cpp_path = file(project(':library-so').projectDir).absolutePath + "" | |
// stlport configuration ["c++_static", "c++_shared", "gnustl_static", "gnustl_shared"] | |
// used to set stl and location of libgpg.a | |
def stlportType = "c++" | |
def stllinkType = "static" | |
model { | |
android { | |
compileSdkVersion = 23 | |
buildToolsVersion = "23.0.2" | |
defaultConfig.with { | |
minSdkVersion.apiLevel = 15 | |
targetSdkVersion.apiLevel = 23 | |
} | |
} | |
repositories { | |
libs(PrebuiltLibraries) { | |
router { | |
headers.srcDir "${gpg_cpp_path}/include" | |
binaries.withType(SharedLibraryBinary) { | |
sharedLibraryFile = file("${gpg_cpp_path}/libs/${targetPlatform.getName()}/librouter.so") | |
} | |
// headers.srcDir "${gpg_cpp_path}/include" | |
// binaries.withType(StaticLibraryBinary) { | |
// staticLibraryFile = file("${gpg_cpp_path}/libs/${targetPlatform.getName()}/librouter.a") | |
// } | |
} | |
} | |
} | |
android.ndk { | |
platformVersion = 11 | |
moduleName = "obc-jni" | |
stl = "gnustl_shared" | |
// stl = "gnustl_static" | |
ldLibs.addAll(["atomic", "log", "android", "EGL", "GLESv2", "z"]) | |
abiFilters.addAll(["armeabi", "armeabi-v7a", "x86", "arm64-v8a"]) | |
} | |
android.abis { | |
create("armeabi-v7a") { | |
cppFlags.addAll(["-mhard-float", "-D_NDK_MATH_NO_SOFTFP=1", "-mfloat-abi=hard"]) | |
ldLibs.add("m_hard") | |
ldFlags.add("-Wl,--no-warn-mismatch") | |
} | |
} | |
android.sources { | |
main { | |
jni { | |
source { | |
srcDirs = ["src/main/jni"] | |
} | |
dependencies { | |
library "router" linkage "shared" | |
// library "router" linkage "static" | |
} | |
} | |
} | |
} | |
} | |
dependencies { | |
compile project(":jni-model") | |
compile 'org.apache.commons:commons-lang3:3.4' | |
compile 'commons-io:commons-io:2.4' | |
} | |
tasks.all { | |
task -> if (task.name.contains('LibmylibSharedLibrary')) task.enabled = false | |
} | |
task ndkBuild(type: Exec) { | |
commandLine 'ndk-build', '-C', file('src/main/jni').absolutePath | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment