I'm playing around with a recent snapshot (swift-DEVELOPMENT-SNAPSHOT-2020-01-28-a.xctoolchain to be exact) and am running into an issue with an Objective-C based project (but I can reproduce the issue with a C based project as well).
It looks like support for Resources broke the case where a header is in the same directory as a .m file, and you have to explicitly exclude the .h file in the manifest.
The error itself is:
error: found 1 file(s) which are unhandled; explicitly declare them as resources or exclude from the target
<PROJECT_DIR_PREFIX>/Sources/abc.h
I was able to reproduce it in a simple use case by using the Fixtures/CFamilyTargets/CLibrarySources example in the Swift Package Manager repo and modifying it by moving abc.h into the Sources directory (and deleting the now empty include directory) and running swift build.
Is this an intentional decision or a bug? If it's a bug I'm happy to file a report, but wasn't sure if I'm missing something.
For us (Firebase) in particular, a large amount of our headers are non-public and not in an include directory, which would cause us to have to restructure our entire project or manually manage the list of headers. I wasn't able to get a regular expression to match all headers, so maybe that's possible as well.
Should headers be included somehow here or should they be safely ignored?
If this is a feature or intend to change, please point it out and provide the solution for Objective-C package user. Because this make a huge pain for current 99% project.
Doesn't anyone write Objecitve-C code have the folder strcture like this ? Even Xcode's itself new created source code does not seperate the header and source files. I didn't find any open source package use this:
The question is: publicHeadersPath can not be same as sources
error: target 'tommath' has invalid header layout:
umbrella header found at './libtommath/tommath.h',
but directories exist next to it:
./libtommath/.build,
./libtommath/.git,
./libtommath/.swiftpm,
./libtommath/demo,
./libtommath/doc,
./libtommath/etc,
./libtommath/logs,
./libtommath/mtest;
consider removing them