0

I'm using gradle 2.12 with build tools 'com.android.tools.build:gradle-experimental:0.6.0-alpha5'. I want to specify some task and I have trouble understanding the syntax. I'm getting errors in the task syntax part. Can someone post an example with task. Thanks!

This is what I have:

task ndkBuildName(type:Exec) {
    commandLine '/Users/Anu/android-ndk-r11b/ndk-Build',
            '-C',
            'V=1',
            'NDK_PROJECT_PATH=build/intermediates/ndk',
            'NDK_LIBS_OUT=src/main/jniLibs',
            'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
            'NDK_APPLICATION_MK=src/main/jni/Application.mk'
}

tasks.withType(JavaCompile) {
//compile(type: JavaCompile) {
    compileTask -> compileTask.dependsOn(ndkBuildName)
}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
an96
  • 31
  • 2
  • 5
  • 1
    What error are you getting ? – Shadab Ansari Mar 25 '16 at 18:40
  • A model of type 'org.gradle.api.tasks.compile.javaCompile' cannot be constructed. I think I have to use compileJava, just don't know how to use it. If someone could please post an example it will be helpful. – an96 Mar 26 '16 at 02:21
  • **JavaCompile** is not even listed in the Gradle pane (on the right side of Android Studio). You should look at that pane to see which tasks are available. – IgorGanapolsky Jul 27 '16 at 15:45

0 Answers0