Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.52 KB | None | 0 0
  1. apply plugin: 'com.android.library'
  2.  
  3. import org.apache.tools.ant.taskdefs.condition.Os
  4.  
  5. android {
  6. compileSdkVersion versionCompiler
  7. buildToolsVersion versionBuildTool
  8.  
  9. compileOptions {
  10. sourceCompatibility javaSourceCompatibility
  11. targetCompatibility javaTargetCompatibility
  12. }
  13.  
  14. defaultConfig {
  15. minSdkVersion 14
  16. targetSdkVersion versionTarget
  17. }
  18.  
  19. buildTypes {
  20. release {
  21. minifyEnabled false
  22. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
  23. }
  24. }
  25. sourceSets {
  26. main {
  27. jniLibs.srcDir 'src/main/libs'
  28. jni.srcDirs = []
  29. }
  30. }
  31. }
  32.  
  33. tasks.withType(JavaCompile) {
  34. compileTask -> compileTask.dependsOn ndkBuild
  35. }
  36.  
  37. task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
  38. println('executing ndkBuild')
  39. def ndkBuildingDir = project.plugins.findPlugin('com.android.library').sdkHandler.getNdkFolder().absolutePath
  40. def ndkBuildPath = ndkBuildingDir
  41. if (Os.isFamily(Os.FAMILY_WINDOWS)) {
  42. ndkBuildPath = ndkBuildingDir + '/ndk-build.cmd'
  43. } else {
  44. ndkBuildPath = ndkBuildingDir + '/ndk-build'
  45. }
  46. commandLine ndkBuildPath, '-j8', '-C', file('src/main').absolutePath
  47. }
  48.  
  49. dependencies {
  50. compile fileTree(dir: new File(buildDir, 'libs'), include: '*.jar')
  51. compile "com.android.support:support-annotations:${supportLibVersion}"
  52. compile("com.serenegiant:common:${commonLibVersion}") {
  53. exclude module: 'support-v4'
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement