-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Traits docs #9048
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Traits docs #9048
Conversation
@swift-ci please test |
…ation of traits and wording updates across the API surface
… article to reference traits for using them
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking wonderful! Just a few comments for you to check out :)
Sources/PackageManagerDocs/Documentation.docc/AddingDependencies.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/AddingDependencies.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/AddingDependencies.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/Dependencies/PackageTraits.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/AddingDependencies.md
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Thanks for working on this @heckj !
Sources/PackageManagerDocs/Documentation.docc/AddingDependencies.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/Dependencies/PackageTraits.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/Dependencies/PackageTraits.md
Outdated
Show resolved
Hide resolved
Within the package, traits express conditional compilation, and may be used to declare additional dependencies that are enabled when that trait is active. | ||
|
||
Traits are identified by their names, which are name-spaced within the package that hosts them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC the latest is that traits use be valid Swift identifiers. We can link to the Swift book's grammar section on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the SE docs, it's the identifiers with the addition of +
and -
, but I'll simplify this up. The SE proposal and internal docs were quite specific, so I reflected that here. Please take a look at the revised content and verify that it's accurate
Sources/PackageManagerDocs/Documentation.docc/Dependencies/PackageTraits.md
Outdated
Show resolved
Hide resolved
Sources/PackageManagerDocs/Documentation.docc/Dependencies/PackageTraits.md
Show resolved
Hide resolved
@swift-ci test windows |
Co-authored-by: Franz Busch <privat@franz-busch.de>
Co-authored-by: Bri Peticca <bripeticca@gmail.com>
Co-authored-by: Bri Peticca <bripeticca@gmail.com>
Co-authored-by: Bri Peticca <bripeticca@gmail.com>
Co-authored-by: Bri Peticca <bripeticca@gmail.com>
@swift-ci please test |
@swift-ci please test windows |
@swift-ci please test macOS |
@swift-ci please test linux |
1 similar comment
@swift-ci please test linux |
Adds documentation for the Swift 6.1 traits feature ### Motivation: - Show how to consume packages that provide traits - Show how to present traits from your package(s) - Updating PackageDescription API to use slightly more readable content related to traits. ### Modifications: - updated PackageDescription API around traits - added curation (organization) for Traits and Package/Dependency/Traits - extended `Using Dependencies` article to touch on traits and how to consume packages that provide them - added an article to share patterns to use when providing a traits from your own package ### Result: Updated content and one additional article in the central documentation for Swift Package Manager that illustrates how to consume and provide packages with traits. --------- Co-authored-by: Franz Busch <privat@franz-busch.de> Co-authored-by: Bri Peticca <bripeticca@gmail.com>
Adds documentation for the Swift 6.1 traits feature
Motivation:
Modifications:
Using Dependencies
article to touch on traits and how to consume packages that provide themResult:
Updated content and one additional article in the central documentation for Swift Package Manager that illustrates how to consume and provide packages with traits.