homebrew-core/Formula/swiftformat.rb
2017-11-29 20:49:08 -08:00

34 lines
1.1 KiB
Ruby

class Swiftformat < Formula
desc "Formatting tool for reformatting Swift code"
homepage "https://github.com/nicklockwood/SwiftFormat"
url "https://github.com/nicklockwood/SwiftFormat/archive/0.32.0.tar.gz"
sha256 "3a8fad3b7e9289ffbf8a3fedf65e93f64548acc2bdcb76550f7fa991eef9e18d"
head "https://github.com/nicklockwood/SwiftFormat.git", :shallow => false
bottle do
cellar :any_skip_relocation
sha256 "7fd27b84804568fb0142e83689bf043f885ad256c8bb9eaebd7ba13c5c94d62c" => :high_sierra
sha256 "a720e82f63b59ef673dbf0de9dfc171c94f308e69c65366caac984216732d9f3" => :sierra
end
depends_on :xcode => ["9.0", :build]
def install
xcodebuild "-project",
"SwiftFormat.xcodeproj",
"-scheme", "SwiftFormat (Command Line Tool)",
"CODE_SIGN_IDENTITY=",
"SYMROOT=build", "OBJROOT=build"
bin.install "build/Release/swiftformat"
end
test do
(testpath/"potato.swift").write <<~EOS
struct Potato {
let baked: Bool
}
EOS
system "#{bin}/swiftformat", "#{testpath}/potato.swift"
end
end