build.gradle 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. apply plugin: 'com.android.application'
  2. android {
  3. compileSdkVersion 23
  4. buildToolsVersion "23.0.3"
  5. defaultConfig {
  6. applicationId "org.libwebsockets.client"
  7. minSdkVersion 17
  8. targetSdkVersion 23
  9. versionCode 1
  10. versionName "1.0"
  11. }
  12. buildTypes {
  13. release {
  14. minifyEnabled false
  15. proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  16. }
  17. }
  18. sourceSets {
  19. main {
  20. jni.srcDirs = []
  21. }
  22. }
  23. }
  24. dependencies {
  25. compile fileTree(dir: 'libs', include: ['*.jar'])
  26. testCompile 'junit:junit:4.12'
  27. compile 'com.android.support:appcompat-v7:23.3.0'
  28. }
  29. task buildNativeLibs(type: Exec, description: "compile the native libraries") {
  30. commandLine 'make', '-f', 'NativeLibs.mk', '-C', 'src/main/jni', 'all'
  31. }
  32. task cleanNativeLibs(type: Exec, description: "clean the native libraries source tree") {
  33. commandLine 'make', '-f', 'NativeLibs.mk', '-C', 'src/main/jni', 'clean-ndk'
  34. }
  35. tasks.withType(JavaCompile) { compileTask -> compileTask.dependsOn buildNativeLibs }
  36. clean.dependsOn 'cleanNativeLibs'