How to add a single file to paths in Android studio 1.3+ with experimental gradle plugin (NDK)?

蓝咒 提交于 2020-01-07 03:05:45

问题


There are a lot of examples with adding a whole source folder to paths like a

cppFlags += "-I${file("src/main/jni/native_app_glue")}".toString()

in new experimental gradle plugin for AS 1.3+

Is there a way to add single source file to it?


回答1:


The snippet you're showing is adding an include directory, not sources. It will add headers, not .c/.cpp files.

I haven't found a way to add a single source.

The plugin will look for all the sources inside jni folders. You can add a jni folder using jni.source.srcDirs:

android.sources{
    main.jni {
        source {
            srcDirs += "src/main/other_jni_sources"
        }
    }
}


来源:https://stackoverflow.com/questions/32818293/how-to-add-a-single-file-to-paths-in-android-studio-1-3-with-experimental-gradl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!