1

I am working on an Objective-C library, that is also available via Swift Package Manager, namely Sentry. We want to generate API docs using DocC, but I am running into the problem where when I generate the documentation I get this error:

error: target 'Sentry' is not a Swift source module

Weirdly enough when I build the documentation within Xcode itself (Product -> Build Documentation) it works perfectly well.

This is the command I am using on the command line to try to generate the docs:

swift package \
  generate-documentation \
  --allow-writing-to-directory ./docs \
  --target Sentry \
  --output-path ./docs \
  --transform-for-static-hosting \
  --hosting-base-path Sentry

And our Package.swift can be found here.

So why is it that Xcode can generate the docs perfectly fine, but I can't do it using swift-docc-plugin?

Kevin Renskers
  • 5,156
  • 4
  • 47
  • 95

0 Answers0