Last active
May 15, 2017 08:04
-
-
Save ph0b/418132cb2f3f03a5534c to your computer and use it in GitHub Desktop.
gradle configuration for a module depending on a prebuilt native library - using gradle-experimental:0.6.0+ plugin.
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' | |
model { | |
repositories { | |
libs(PrebuiltLibraries) { | |
mydependency { | |
headers.srcDir "src/main/jni/prebuilts/include" | |
binaries.withType(SharedLibraryBinary) { | |
sharedLibraryFile = file("src/main/jni/prebuilts/${targetPlatform.getName()}/libmydependency.so") | |
} | |
} | |
} | |
} | |
android { | |
compileSdkVersion = 23 | |
buildToolsVersion = "23.0.2" | |
defaultConfig.with { | |
minSdkVersion.apiLevel = 15 | |
targetSdkVersion.apiLevel = 23 | |
} | |
} | |
android.ndk { | |
moduleName = "mylib" | |
ldLibs.addAll(['log']) | |
cppFlags.add("-std=c++11") | |
cppFlags.add("-fexceptions") | |
stl = 'gnustl_shared' | |
platformVersion = 15 | |
} | |
android.sources { | |
main { | |
jni { | |
dependencies { | |
library "mydependency" linkage "dynamic" | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
cc @proppy
thanks to @rschiu for the pointers!