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.
Description
As muter stands today, SPM projects cannot use
xcodebuild
as a test executable. This is unfortunate, since any SPM projects that targets iOS, watchOS, tvOS, or visionOS must rely onxcodebuild
to run tests with an available simulator.Build Path Changes
The biggest blocker for using
xcodebuild
in muter's current state is the use of-showBuildSettings
to get the build path. This is because-showBuildSettings
does not work the same for SPM projects as it does for Xcode projects. It requires a scheme to be passed, and it also does not output theBUILD_DIR
line needed to get the build path.As a solution to the build path issue, I've decided to utilize the ability to pass an explicit build path to
xcodebuild
with the flag-derivedDataPath
. To keep parity, I'm also using--build-path
with theswift
executable. To allow consumers to specify a custom build path, I've addedbuildPath
as a value in the muter config, defaulting to.build
.With this change, we can now run muter on an SPM project with
xcodebuild
without issue. 🎉SPM Muter Config Init
Since
xcodebuild
is now available for SPM, I've added configuration generation logic that detects if an SPM project is targeting iOS. If iOS is detected as a platform, then thexcodebuild
executable is added, along with the flags necessary to run the correct scheme and simulator.Since muter only currently supports iOS simulators, I have not added anything related to the other simulators that might be available.
Acceptance Test Additions
I've added two new example repositories for acceptance tests:
The test script runs the same acceptance test on ExampleiOSPackage as is currently run on ExampleApp. It also runs the same acceptance test on ExampleMacOSPackage as is currently run on ExampleMacOSApp.
To be able to differentiate between the output for app vs. package, I've added the suffix
spm
andxcodeproj
to the test output files. This is utilized in theAcceptanceTests
suite to verify the output of running the acceptance tests.I also changed the acceptance tests to run in a
temp
directory, which to me seems cleaner than running in theAcceptanceTests
directory. However, I'm open to undoing this change if the project maintainers prefer the old way, as it's not necessary for this MR.