I'm trying to add some functionality to the DocC plugin and I'm struggling to find a way to quickly iterate, and ideally step through, the plugin code. Also, I realize this is in part the age-old question, how do I edit package dependencies.
I have an Vapor SPM project (i.e. Package.swift), and I initially added the DocC plugin to my Package.swift, referencing my local git clone like this:
.package(url: "/Users/rmann/Projects/Personal/`SwiftDocCPlugin`/swift-docc-plugin", branch: "rmann/access"),
Then on the command line I invoked
% swift package --disable-sandbox preview-documentation --target App
And I saw it fetch from my local copy (Fetching /Users/rmann/Projects/Personal/SwiftDocCPlugin/swift-docc-plugin
).
Unfortunately, changes I make in my local copy aren't picked up when I invoke the plugin a second time.
I realized I might've set it up wrong in Package.swift, so I changed it to this:
.package(path: "/Users/rmann/Projects/Personal/SwiftDocCPlugin/swift-docc-plugin"),
But the behavior is the same.
All the instructions I can find online for making a dependency editable seems to only apply to Xcode, and not swift build
or swift package generate-documentation
.
Moving on to the harder question: how can I debug the plugin in Xcode (e.g. set breakpoints, step, etc., and of course edit and test changes)?