Skip to content

Conversation

@heckj
Copy link
Collaborator

@heckj heckj commented Apr 15, 2025

Motivation

Makes it easier to preview documentation changes

Modifications

  • Add dependency on swift-docc-plugin
  • Add detail on how to preview into the README within the documentation target

Result

Documentation changes can be previewed by running the following command:

swift package --disable-sandbox preview-documentation --target ContainerImageBuilderPlugin

Test Plan

No functional change.

heckj added 2 commits April 15, 2025 12:33
- makes it easier to preview documentation changes
- added detail on how to preview into the README within the documentation target
@euanh euanh changed the title [docs] adds the swift-docc-plugin dependency to the package docs: Use swift-docc-plugin to preview documentation Apr 16, 2025
@euanh
Copy link
Collaborator

euanh commented Apr 16, 2025

Thanks, this is really useful. I've been using this locally but I've been concerned that adding this dependency to Package.swift might slow down builds as reported here: swiftlang/swift-docc-plugin#68. Plugins have to be built from scratch by each project which uses them, so it's important to keep the build time as short as possible.

The good news is that local testing and the CI build times for the end to end examples suggest that adding this dependency doesn't seem to slow down projects which depend on swift-container-plugin - aside perhaps from the time needed to clone the repository in the first place. Presumably this is because swift-docc-plugin is a command plugin, so no target in swift-container-plugin depends on it, so SwiftPM decides it does not need to be built for projects which only use swift-container-plugin.

@euanh euanh self-requested a review April 16, 2025 10:55
@euanh
Copy link
Collaborator

euanh commented Apr 16, 2025

It's a pity --disable-sandbox is needed, but swift-docc-plugin still supports swift-tools-version: 5.7, which does not support the .allowNetworkConnections permission in Package.swift.

@euanh euanh merged commit 55be678 into apple:main Apr 16, 2025
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants