Support ANSI commands when using xcodebuild #214
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.
My project is running into an issue where SPM isn't able to create a multi-arch binary similar to this one:
swiftlang/swift-package-manager#8013
While not quite the same issue, this forum post suggests using
xcodebuildto resolve issues when building for multiple archs:https://forums.swift.org/t/swiftpm-compile-multiple-arch-system-library/75724/3
Using
xcodebuildresolved my issue, but it causes the#if Xcodecheck withinsupportsANSICommandsto fail which breaks lots of things.This PR checks the
TERMenvironment variable instead, which Xcode sets to"dumb"to indicate that it doesn't support ANSI commands. Cursory searching online leads me to believe this is a common pattern to communicate inability to support ANSI commands.Testing:
xcodebuild build -scheme ConsoleKitExample -derivedDataPath DerivedData -destination "generic/platform=macOS"then
./DerivedData/Build/Products/Debug/ConsoleKitExample