Always generate mock configuration wrappers#235
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #235 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 41 41
Lines 5752 5715 -37
=========================================
- Hits 5752 5715 -37
🚀 New features to boost your workflow:
|
…ugin setup
When Xcode builds an SPM package, context.tool(named:) returns a path
with unresolved build variables (e.g. /${BUILD_DIR}/${CONFIGURATION}/SafeDITool)
that cannot be executed as a subprocess during createBuildCommands. This
catches that failure, emits a warning, and falls back to the lightweight
PluginScanner approach already used by the XcodeBuildToolPlugin.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SafeDIMockConfigurationfor every mock-tree edge, including simple leavesSafeDIMockConfigurationwith itsType+SafeDIMock.swiftoutput instead of leaving it in the shared configuration fileWhy
Simple leaf overrides previously used raw builder values while richer nodes used configuration objects. That meant a child could change categories at the call site as it evolved from a leaf into a configurable subtree. This change makes the generated mock API structurally uniform and keeps consumer call sites stable as dependencies grow.
What changed
needsConfigurationStructsplit from mock generation so every edge now routes through.safeDIBuilderon a config objectSafeDIParametersgeneration to always store config objects for tree childrenSafeDIMockConfigurationin their dedicated mock file, while the sharedSafeDIMockConfiguration.swiftonly keeps non-rooted or orphaned config typesValidation
swift build --traits sourceBuildswift test --traits sourceBuild./CLI/lint.sh