platform :ios, '11.0'
use_frameworks!

pod 'MultiSelectSegmentedControl', :path => '..'
pod 'SwiftQuality', :git => 'https://github.com/yonat/SwiftQuality'

# code quality scripts
def scripts
  script_phase :name => 'SwiftFormat',
    :execution_position => :before_compile,
    :script => 'if [ "Debug" == "${CONFIGURATION}" ]; then "${PODS_ROOT}/SwiftFormat/CommandLineTool/swiftformat" --swiftversion ${SWIFT_VERSION} --config "${PODS_ROOT}/SwiftQuality/.swiftformat" "${SRCROOT}/.." ; fi'

  script_phase :name => 'SwiftLintAutocorrect',
    :execution_position => :before_compile,
    :script => 'if [ "Debug" == "${CONFIGURATION}" ]; then "${PODS_ROOT}/SwiftLint/swiftlint" autocorrect --config "${PODS_ROOT}/SwiftQuality/.swiftlint.yml" --path "${SRCROOT}/.." ; fi'

  script_phase :name => 'SwiftLint',
    :execution_position => :after_compile,
    :script => 'if [ "Debug" == "${CONFIGURATION}" ]; then "${PODS_ROOT}/SwiftLint/swiftlint" --config "${PODS_ROOT}/SwiftQuality/.swiftlint.yml" --path "${SRCROOT}/.." ; fi'
end

target 'MultiSegmentDemo' do
  scripts
end
