The project structure for a Swift package that includes DocC documentation is shown below for a package named CalcMaker. Are the Sources and Tests directories required for Swift packages? Does the DocC documentation have to go within the Sources/CalcMaker directory?
Instead of having a bunch of sub-directories, is it possible to flatten the project structure like the tree shown below? This removes the Sources and Tests directories and puts the package, tests, and documentation directories at the top level of the project.
you can move the tests to whatever directory you like with the target path argument, but i don’t know of any way to outline the documentation directory from the source directory of its associated module.
The documentation catalog ('.docc' directory) needs to be in the same directory as the sources for that target. This is how it gets associated with the target.
In the second structure the documentation won't be associated with either target which means that it won't be used when building documentation for either target.
you need to specify path: "Tests", otherwise it will look for a nested directory Tests/Tests.
SwiftPM already has awareness of .docc directories. (although arguably, it shouldn’t?)
if we have already accepted that SwiftPM is responsible for documentation discovery, then it’s not a huge stretch to wonder if we should be able to specify a custom location for the documentation.