kernel_memory_dump

gradle build NDK

May 29th, 2015
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 1.36 KB | None | 0 0
  1.  
  2. import org.apache.tools.ant.taskdefs.condition.Os
  3.  
  4. apply plugin: 'com.android.application'
  5.  
  6. android {
  7.     compileSdkVersion 22
  8.     buildToolsVersion "22.0.1"
  9.  
  10.     defaultConfig {
  11.         applicationId "com.example.gp.ndk"
  12.         minSdkVersion 16
  13.         targetSdkVersion 22
  14.         versionCode 1
  15.         versionName "1.0"
  16.         ndk {
  17.             moduleName "ndkLib"
  18.         }
  19.         sourceSets.main {
  20.  
  21.             jni.srcDirs = [] //disable automatic ndk-build call
  22.             jniLibs.srcDir 'src/main/libs' //set .so files location to libs
  23.         }
  24.         // call regular ndk-build(.cmd) script from app directory
  25.         task ndkBuild(type: Exec) {
  26.             if (Os.isFamily(Os.FAMILY_WINDOWS)) {
  27.                 commandLine 'cmd','ndk-build.cmd', '-C', file('src/main/jni/').absolutePath
  28.             } else {
  29.                 commandLine 'ndk-build', '-C', file('src/main').absolutePath
  30.             }
  31.         }
  32.         tasks.withType(JavaCompile) {
  33.             compileTask -> compileTask.dependsOn ndkBuild
  34.         }
  35.  
  36.     }
  37.     buildTypes {
  38.         release {
  39.             minifyEnabled false
  40.             proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  41.         }
  42.  
  43.     }
  44. }
  45.  
  46. dependencies {
  47.     compile fileTree(dir: 'libs', include: ['*.jar'])
  48.     compile 'com.android.support:appcompat-v7:22.1.1'
  49. }
Advertisement
Add Comment
Please, Sign In to add comment