swiftlang / swift-docc-plugin

Swift Package Manager command plugin for Swift-DocC
https://swiftpackageindex.com/apple/swift-docc-plugin/1.3.0/documentation/swiftdoccplugin
Apache License 2.0
316 stars 54 forks source link

Add support for ObjC/C Package #55

Open Kyle-Ye opened 1 year ago

Kyle-Ye commented 1 year ago

Add support for ObjC/C Package

Checklist

Expected behavior

Generate docc preview successfully.

Actual behavior

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

Steps to Reproduce

  1. Init an empty C Package and add Documentation Catalog(XX.docc foloder).
  2. Add Swift-DocC-Plugin depenedency
  3. Run swift package --disable-sandbox preview-documentation --target XX

Swift-DocC Plugin Version Information

Swift-DocC plugin version: 1.1.0 Swift Compiler version:

swift-driver version: 1.75.2 Apple Swift version 5.8 (swiftlang-5.8.0.124.2 clang-1403.0.22.11.100)
Target: arm64-apple-macosx13.0
Kyle-Ye commented 1 year ago

We've already got clang support for ObjectiveC symbol graph generation. But this method need multi commands to achieve. It would be nice if Swift DocC Plugin could do them for us.

https://forums.swift.org/t/clang-support-for-objective-c-symbol-graph-generation/57689

Kyle-Ye commented 1 year ago

I just summarized Swift-docc-plugin's support for ObjC & Swift language with a repository.

For anyone interested, you can check it here https://github.com/Kyle-Ye/swift-docc-plugin-mix-demo