Why are extra include directories added when explicitly setting the scrDirs?

software-model

(David Cowden) #1

When depending on a component from another project, I’ve noticed that regardless of how I set the exported header directories:

exportedHeaders {
    srcDir 'foo/include'
    include '**/*.h'
}

vs

exportedHeaders {
    setSrcDirs(['foo/include'])
    include '**/*.h'
}

the following include paths get passed to the compiler for things that depend on foo (not when compiling foo itself):

-I
.../libs/foo/include
-I
.../libs/src/foo/headers

The first path is what I want. The second looks like the default path, which I don’t want. How can I prevent the default path from being added? (Also, when I print the exportedHeaders during configuration, only the path I’ve specified exists.)

I’m using Gradle 2.10.