swiftlang / swift-docc-plugin

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

Adopt new SwiftPM plugin Argument Parsing API #1

Closed ethan-kusters closed 2 years ago

ethan-kusters commented 2 years ago

Summary

Updates the SwiftPM plugin to use the latest Argument Parsing API that will ship with Swift 5.6.

This also includes some general improvements to help output (--help) in preparation for the 1.0 release of the plugin.

Details

The SwiftPM plugin API has been updated so that options like --target and --product are passed directly to the plugin instead of to the package manager.

This means that instead of calling the plugin with something like:

swift package --target SwiftMarkdown generate-documentation

you would now do:

swift package generate-documentation --target SwiftMarkdown

This allows us to be a little smarter about choosing which products to build. For example, now when a user invokes the basic

swift package generate-documentation

we will also generate documentation for dependencies. Similarly, this allows clients to specify products of dependencies which makes doing something like

swift package preview-documetnation --product ArgumentParser

possible for packages that import ArgumentParser.

Dependencies

This change depends on the latest Swift 5.6 nightly toolchain that includes the new ArgumentParsing API.

Testing

Add the version of the plugin on this branch as a dependency of a package with:

.package(url: ["https://github.com/apple/swift-docc-plugin](https://github.com/ethan-kusters/swift-docc-plugin.git)", branch: "adopt-new-argument-parsing-api")

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

shahmishal commented 2 years ago

@swift-ci test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test

ethan-kusters commented 2 years ago

@swift-ci please test