When building, testing or running a root package we want users to be able to change the traits enabled in the packages. This allows them to build binaries with different traits enabled or run tests with different traits.
Modification
This PR adds trait options to a few commands and wires them through to the ModuleGraph loading and the build description caching. The latter is important to trigger rebuilds when the trait configuration has changed. Along the way I refactored the GraphLoadingNode and externalised the logic to calculate traits since I need slightly different logic for the root nodes and for the dependency nodes.
Result
swift build/run now support passing trait configuration.
Motivation
When building, testing or running a root package we want users to be able to change the traits enabled in the packages. This allows them to build binaries with different traits enabled or run tests with different traits.
Modification
This PR adds trait options to a few commands and wires them through to the ModuleGraph loading and the build description caching. The latter is important to trigger rebuilds when the trait configuration has changed. Along the way I refactored the
GraphLoadingNode
and externalised the logic to calculate traits since I need slightly different logic for the root nodes and for the dependency nodes.Result
swift build/run
now support passing trait configuration.