How to use the DocC Archive Hosting Base Path build setting for Swift Packages?

The video shows you can use a 'DocC Archive Hosting Base Path' to incorporate when building the Documentation via Xcode's Build Documentation action. However, for Swift Package only projects this isn't possible since we cannot provide build settings.

Replies

Hi @fruitcoder_DE – have you tried using the Swift-DocC Plugin to build your project? There's documentation for publishing the documentation for a Swift Package to GitHub Pages here: https://apple.github.io/swift-docc-plugin/documentation/swiftdoccplugin/publishing-to-github-pages.

  • I did try exactly what it said there (I have used it before for other projects) but it doesn‘t seem to work when the package contains a macro

Add a Comment

I did try exactly what it said there (I have used it before for other projects) but it doesn‘t seem to work when the package contains a macro – @fruitcoder_DE

Ah got it – sorry to hear that. If you're able to create an issue on the Swift-DocC Plugin repo with a reproducing project, that would help us figure out what's going wrong there.

In the mean time, if xcodebuild docbuild is working for you from the command-line, you can set the base path with the DOCC_HOSTING_BASE_PATH build setting. You can see an example of that on a recent Swift forums post.