title: How to use experimental gradle plugin to define multiple JNI modules?
body: <p>My app has several JNI modules. I use Android.mk to define modules and what files to be built for each module. So I had to disable automatic ndk-build call. My gradle contains the following:</p>
  
  <pre><code>sourceSets.main {
      jni.srcDirs = [] //disable automatic ndk-build call with auto-generated Android.mk file
      jniLibs.srcDirs = ['src/main/libs']
  }
  
  task buildNative(type: Exec, description: 'Compile JNI source via NDK') {
  commandLine "ndk-build.cmd",
          '-C', file('src/main/jni').absolutePath,
          '-j', Runtime.runtime.availableProcessors(),
          'all'
  }
  
  tasks.withType(JavaCompile) {
      compileTask -&gt; compileTask.dependsOn buildNative
  }
  </code></pre>
  
  <p>Since now Android Studio support NDK and native debugging, I'd need to use new experimental gradle plugin. There's a section that I need to specify the module name. </p>
  
  <pre><code>android.ndk {
      // All configurations that can be changed in android.ndk.
      moduleName = "native"
      toolchain = "clang"
      toolchainVersion = "3.5"
      // Note that CFlags has a capital C, which is inconsistent with
      // the naming convention of other properties.  This is a
      // technical limitation that will be resolved
      CFlags += "-DCUSTOM_DEFINE"
      cppFlags += "-DCUSTOM_DEFINE"
      ldFlags += "-L/custom/lib/path"
      ldLibs += "log"
      stl = "stlport_static"
  }
  </code></pre>
  
  <p>However, all examples I see only specify one module and there's no way to specify which file to be built against that module.</p>
  
  <p>Does anybody have any idea how to define several modules and specify files for each module in this new experimental gradle plugin?</p>