Skip to content

ExtraBuildPhase is a plugin for Xcode that was created to run SwiftLint, but is customizable by shell script.

License

Notifications You must be signed in to change notification settings

norio-nomura/ExtraBuildPhase

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ExtraBuildPhase

MIT License

ExtraBuildPhase is a plugin for Xcode that was created to run SwiftLint, but is customizable by shell script.

Requirements

  • Xcode 7.1 or later
  • SwiftLint for default shell script

Installation

Xcode Plug-ins Locations are the following:

  • Local System: /Library/Application Support/Developer/Shared/Xcode/Plug-ins
  • User Home: ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins

Using Installers

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.

Manual Install

  1. Download ExtraBuildPhase.xcplugin-0.3.5.zip
  2. Unzip it
  3. Copy ExtraBuildPhase.xcplugin to either Xcode Plug-ins locations.

Build By Yourself

  1. Building the project with Xcode will install the plugin. (to User Home)

Restart Xcode after installing

Configuration

# 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 > Clean⇧⌘K"

# 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

Author

Norio Nomura

License

ExtraBuildPhase is available under the MIT license. See the LICENSE file for more info.

About

ExtraBuildPhase is a plugin for Xcode that was created to run SwiftLint, but is customizable by shell script.

Resources

License

Stars

Watchers

Forks

Packages

No packages published