Skip to content

Conversation

heckj
Copy link
Member

@heckj heckj commented Aug 15, 2025

Adds traits to the output of the show-dependencies command for --text and --json output.

Motivation:

Exposes the default traits, if any, that are enabled by the dependencies a package.

Resolves: #9033

Modifications:

Extended the logic in show-dependencies to add in the enabledTraits for a resolved package.

Result:

The output of show-dependencies includes output akin to (traits: FirstTrait, SecondTrait) is the resolved package has traits and includes the traits that it has. If the package doesn't offer traits, no additional/new content is displayed in --text.
The JSON provided from show-dependencies --json includes a traits property, empty if there aren't any traits enabled.

@heckj
Copy link
Member Author

heckj commented Aug 15, 2025

@swift-ci please test

@heckj heckj self-assigned this Aug 15, 2025
Copy link
Contributor

@bkhouri bkhouri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is still in draft, but could we please add an automated test to ensure we don't regress?

@heckj heckj requested a review from bkhouri August 18, 2025 18:16
@heckj
Copy link
Member Author

heckj commented Aug 18, 2025

@bkhouri absolutely - I was keeping it draft until I could see what tests where running and add in something appropriate. Just added now, following the pattern of the other nearby "command tests"

@heckj heckj marked this pull request as ready for review August 18, 2025 18:17
Copy link
Contributor

@bripeticca bripeticca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great! thank you for doing this :)

@bripeticca
Copy link
Contributor

@swift-ci please test

@heckj heckj force-pushed the show-dependencies-traits branch from 8c4ef04 to 3d29dbe Compare August 26, 2025 17:39
@heckj heckj enabled auto-merge (squash) August 26, 2025 17:40
@heckj
Copy link
Member Author

heckj commented Aug 26, 2025

@swift-ci please test

@bripeticca
Copy link
Contributor

@swift-ci please test windows platform

@bripeticca bripeticca mentioned this pull request Aug 27, 2025
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.

expand the information provided by swift package show-dependencies to include traits
4 participants