ExtraBuildPhase is a plugin for Xcode that was created to run SwiftLint, but is customizable by shell script.
MIT License
ExtraBuildPhase is a plugin for Xcode that was created to run SwiftLint, but is customizable by shell script.
Xcode Plug-ins Locations are the following:
/Library/Application Support/Developer/Shared/Xcode/Plug-ins
~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
brew cask install extrabuildphase
Note: Homebrew-Casks's install location has changed from Local System to User Home. If you have installed 0.3 or earlier with Homebrew-Cask, please remove ExtraBuildPhase.xcplugin
manually from Local System.
ExtraBuildPhase.xcplugin
to either Xcode Plug-ins locations.Restart Xcode after installing
# Change shell script
defaults write io.github.norio-nomura.ExtraBuildPhase shellScript -string '
if which swiftlint >/dev/null; then
if [ -f .swiftlint.yml ]; then
CONFIG="--config .swiftlint.yml"
elif [ -f $HOME/.swiftlint.yml ]; then
CONFIG="--config $HOME/.swiftlint.yml"
fi
swiftlint lint --quiet --use-script-input-files $CONFIG
fi
exit 0 # ignore result of swiftlint
'
# Changes will be applied after "Product > CleanK"
# Show environment variables in build log
defaults write io.github.norio-nomura.ExtraBuildPhase showEnvVarsInLog -bool true
# Run shell script not only on Xcode, but also xcodebuild.
defaults write io.github.norio-nomura.ExtraBuildPhase isNotLimitedToXcode -bool true
Norio Nomura
ExtraBuildPhase is available under the MIT license. See the LICENSE file for more info.