简体   繁体   English

gradle实验性ndk仅构建目录的子集

[英]gradle experimental ndk build only subset of directory

I am using gradle2.9 with the gradle-experimental-0.6.0-alpha3 plugin for android studio and I have a problem I cannot seem to solve. 我正在将gradle2.9与gradle-experimental-0.6.0-alpha3插件用于android studio,但有一个我似乎无法解决的问题。

This is my directory structure: 这是我的目录结构:

  • TopDir TOPDIR
    • fileA.cpp fileA.cpp
    • dirA DIRA
      • fileA1.cpp fileA1.cpp
      • fileA2.cpp fileA2.cpp

I want to compile fileA.cpp, fileA1.cpp but not fileA2.cpp 我想编译fileA.cpp,fileA1.cpp但不编译fileA2.cpp

1°) I tried using selective dir includes: 1°)我尝试使用选择性目录包括:

android.sources {
    main {
        jni {
            source {
               srcDirs = ["dirA","dirA1/fileA1.cpp"]
            }
        }
    }
}

but I got the error that dirA1/fileA1.cpp is not a directory, and I can't find a way to include a file. 但是我收到dirA1 / fileA1.cpp不是目录的错误,并且找不到包含文件的方法。

2°) I tried using selective dir excludes: 2°)我尝试使用选择性目录排除:

android.sources {
    main {
        jni {
            source {
               srcDirs = ["TopDir"]
               exclude "fileA2.cpp"
            }
        }
    }
}

but that didn't work either, because exclude waits for a directory. 但这也不起作用,因为exclude等待目录。 Even using wildcards (like "exclude *A2*") doesn't seems to work. 即使使用通配符(例如“排除* A2 *”)似乎也不起作用。

Does anyone knows a way to do this (even if it requires including file one by one) using the new gradle experimental tools? 有谁知道使用新的gradle实验工具执行此操作的方法(即使需要逐个添加文件)?

对于排除,您可以使用通配符,例如

exclude "**/*A2.cpp"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM