Swinject / Swinject

Dependency injection framework for Swift with iOS/macOS/Linux
MIT License
6.3k stars 514 forks source link

Build issue: Integration of SwiftLint into Xcode project not working on Apple Silicon Macs #532

Open KarinBerg opened 1 year ago

KarinBerg commented 1 year ago

Problem: The integration of SwiftLint into the Swinject Xcode project not working on Apple Silicon Macs if you installed SwiftLint via Homebrew.

This is from the README.md of "https://github.com/realm/SwiftLint": If you installed SwiftLint via Homebrew on Apple Silicon, you might experience this warning:

warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint

That is because Homebrew on Apple Silicon installs the binaries into the /opt/homebrew/bin folder by default. To instruct Xcode where to find SwiftLint, you can either add /opt/homebrew/bin to the PATH environment variable in your build phase

if [[ "$(uname -m)" == arm64 ]]; then
    export PATH="/opt/homebrew/bin:$PATH"
fi

if which swiftlint > /dev/null; then
  swiftlint
else
  echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
BProg commented 8 months ago

Thanks, it works 👍🏽 Can this be merged?