marcpawl
(Marc Pawlowsky)
November 5, 2015, 4:58am
1
See https://github.com/marcpawl/gradle_native_incremental_header.git for source code that demonstrates the problem.
If after a successful native build, a header file is modified, and the project is rebuilt again then the C++ file that uses the modified header file is not compiled until gradle clean is called.
sterling
(Sterling Greene)
November 5, 2015, 2:09pm
2
Thanks!
Is your example missing files? I only see a README.
marcpawl
(Marc Pawlowsky)
November 6, 2015, 12:17am
4
I added the files. Sorry about that. Trouble with using “svn commit” all the time and then switching to “git commit”, I keep forgetting to push.
sterling
(Sterling Greene)
November 6, 2015, 1:05am
5
Awesome, thanks @marcpawl .
This is a problem with older builds too, I tried 2.7, 2.8 and 2.9-rc-1.
I raised GRADLE-3357, which will be fixed in 2.10. We’ve revamped how we track source dependencies in native code in master.
The workaround is to add ‘src’ as a srcDir in exportedHeaders like:
exportedHeaders {
srcDirs "include", "src"
}
What’s happening is local.h
is being excluded in source, which gets used as the inputs for the compile task.